Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Escape , and ;= doesn't work for global property when build with dotnet, but html encode %3C and %3B= works well #10128

Open
JaynieBai opened this issue May 13, 2024 · 3 comments

Comments

@JaynieBai
Copy link
Member

JaynieBai commented May 13, 2024

Issue Description

  1. Test escape ',' and "," and %3C in the powershell , cmd, bash and zsh. Found "," and ',' is not supported in the following 4 shells and cmd error is different from others.

  2. Test ";=" and ';=' and %3B in 4 shells. Found when ";=" and ';=' global property, it reports error in 4 shells with the same error MSB1006: Property is not valid. But = and ; work well separately for global property

Powershell

With quotes: MSBUILD : error MSB1005: Specify a property and its value.

With double quotes: MSBUILD : error MSB1005: Specify a property and its value.

Html Codes. Works well

image

CMD

With quotes: MSBUILD : error MSB1006: Property is not valid.

With double quotes: MSBUILD : error MSB1005: Specify a property and its value.

With html codes: Good
image

bash

With quotes: MSBUILD : error MSB1005: Specify a property and its value.

With double quotes: MSBUILD : error MSB1005: Specify a property and its value.

Html codes: works well

image

ZSH

With quotes: MSBUILD : error MSB1005: Specify a property and its value.

With double quotes: MSBUILD : error MSB1005: Specify a property and its value.

Html codes work well
image

Steps to Reproduce

custom-proj1.zip
dotnet version 9.0.100-preview.3.24204.13

  1. dotnet build custom-proj1.csproj /t:Init /p:F1=","
  2. dotnet build custom-proj1.csproj /t:Init /p:F1=";="

Expected Behavior

dotnet build should support such properties "," and ";=" as msbuild.exe

Actual Behavior

Dotnet build doesn't support the global property ", " and ";="

Analysis

No response

Versions & Configurations

No response

@JaynieBai JaynieBai added the bug label May 13, 2024
@JaynieBai JaynieBai changed the title [Bug]: Escape , and ;= doesn't work for global property, but html encode %3C and %3B= works well with dotnet msbuild [Bug]: Escape , and ;= doesn't work for global property when build with dotnet, but html encode %3C and %3B= works well May 13, 2024
@AR-May
Copy link
Member

AR-May commented May 14, 2024

@JaynieBai could you please check whether it is shell or msbuild parsing causing this error? For that, please check which parameters msbuild received. You can set $env:MSBUILDDEBUGONSTART=1, run the build, start debugging and look the parameters that msbuild received in the code.

@JaynieBai
Copy link
Member Author

When run with dotnet, the CommandLine is D:\WORK\msbuild\artifacts\bin\bootstrap\core\sdk\9.0.100-rc.1.24452.12\MSBuild.dll .\MyApp.csproj /p:F1=,
Image

When run with msbuild.exe, the CommandLine is D:\WORK\msbuild\artifacts\bin\bootstrap\net472\MSBuild\Current\Bin\MSBuild.exe .\MyApp.csproj /p:F1=","

Image

So for dotnet build, we have to execute dotnet D:\WORK\msbuild\artifacts\bin\bootstrap\core\sdk\9.0.100-rc.1.24452.12\MSBuild.dll .\MyApp.csproj /p:F1=\",\" with escape character "

@JaynieBai
Copy link
Member Author

JaynieBai commented Nov 7, 2024

@rainersigwald This seems duplicate with #471 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants