dotnet build : not able to pass arguments to msbuild
See original GitHub issueSteps to reproduce
We are not able to execute command `dotnet.exe build -p:Version using the latest build on dotnet cli. It used to work in earlier versions of dotnet cli.
https://github.com/Microsoft/vstest/blob/master/scripts/build.ps1#L170
Is passing args to msbuild no more supported using -p
switch? If yes, what is the alternate to pass those options to msbuild.
Expected behavior
dotnet.exe should pass -p:Version=15.0.0 (msbuild args) to msbuild.
Actual behavior
Getting this error : Unrecognized command or argument ‘-p’
Environment data
dotnet --info
output:
.NET Command Line Tools (2.0.0-preview1-005625)
Product Information: Version: 2.0.0-preview1-005625 Commit SHA-1 hash: 485237a8a0
Runtime Environment: OS Name: Windows OS Version: 10.0.14393 OS Platform: Windows RID: win10-x64 Base Path: D:\vstest\tools\dotnet\sdk\2.0.0-preview1-005625\
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
The workaround for these cases is to use
/
rather than-
to prefix args to be forwarded to MSBuild.Also,
-warnaserror
fordotnet restore
is not working. https://github.com/Microsoft/vstest/blob/master/scripts/build.ps1#L152