dotnet build parameters (-p) don't work when joined by semicolon (;) in dotnet 6.0.400
See original GitHub issueDescribe the bug
Using multiple MSBuild parameters joined by a semicolon in a dotnet build
command don’t work anymore in dotnet 6.0.400.
To Reproduce
Executing the following command doesn’t work anymore:
dotnet build -p:propertyA=valueA;propertyB=valueB
But changing it to this does:
dotnet build -p:propertyA=valueA -p:propertyB=valueB
In my case, the command:
dotnet build -p:Version=1.1.1.1;AdditionalConstants=Beta
resulted in the following error:
Error NETSDK1018: Invalid NuGet version string: '1.1.1.1;AdditionalConstants=Beta'.
Exceptions (if any)
N/A
Further technical details
- Using dotnet version 6.0.400 (previously worked in version 6.0.302)
- Command being executed as part of an Azure DevOps build pipeline
Issue Analytics
- State:
- Created a year ago
- Reactions:13
- Comments:11 (3 by maintainers)
Top Results From Across the Web
dotnet build command - .NET CLI
The dotnet build command builds a project and all of its dependencies.
Read more >dotnet run command - .NET CLI
The dotnet run command provides a convenient option to run your application from the source code.
Read more >NETSDK1045: The current .NET SDK does not support ...
This error occurs when the build tools can't find the version of the .NET SDK that's needed to build a project. This is...
Read more >MSBuild reference for .NET SDK projects
This page is a work in progress and does not list all of the useful MSBuild properties for the .NET SDK. For a...
Read more >Why don't any of these methods work for installing .Net ...
I make it run with the APT package solution, in fact there is a conflict between Ubuntu packages (Jammy feed) and Microsoft Package...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I would like to emphasize that this causes build failures from one day to another in Azure Pipelines because of the way the
DotNetCoreCLI
task runs the dotnet command. In our case we run dotnet using arguments like these:And it fails because under the hood dotnet will be run using this argument:
Which since 6.0.400 will lead to the build configuration actually being
Release;InformationalVersion=Foo
instead ofRelease
.As you can see we don’t specify semicolons or commas anywhere and we don’t have a way to specify multiple
-p
options on the command line. I can see that this may need to be fixed in Azure Pipelines instead but I suspect this combination to lead to build failures all over the place.can confirm this too. as a workaround i found out that comma (“,”) works as a separator, but semicolon (“;”) does not.
For us this breaks the “pack” task (and a few others) in Azure Devops Pipelines, as they use semicolon as a seperator (and we can’t change that)