question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet build : not able to pass arguments to msbuild

See original GitHub issue

Steps 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:closed
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jonsequiturcommented, Mar 23, 2017

The workaround for these cases is to use / rather than - to prefix args to be forwarded to MSBuild.

0reactions
harshjain2commented, Mar 23, 2017

Also, -warnaserror for dotnet restore is not working. https://github.com/Microsoft/vstest/blob/master/scripts/build.ps1#L152

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pass msbuild parameters to dotnet run command
The use case we have in mind is to use dotnet watch with the run command and to pass msbuild parameters to the...
Read more >
dotnet build command - .NET CLI
When dotnet build is run automatically by dotnet run , arguments like -property:property=value aren't respected. Running dotnet build is ...
Read more >
MSBuild Command-Line Reference
Pass the parameters that you specify to the console logger, which displays build information in the console window. You can specify the ...
Read more >
dotnet publish command - .NET CLI
Any parameters passed to dotnet publish are passed to MSBuild. The -c and -o parameters map to MSBuild's Configuration and PublishDir ...
Read more >
Common MSBuild Project Properties
List of common properties and parameters. Property or parameter name, Project types, Description. AdditionalLibPaths .NET, Specifies additional ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found