dotnet test - allow to specify msbuild properties
See original GitHub issueAt the moment if you run dotnet test myexample.csproj
- by default it would try to build and run that test.
I however would like to pass extra msbuild parameters to project file, so I could mimic project presence in solution.
Normally you would like to set SolutionName
and SolutionDir
properties, but it’s possible that even custom properties needs to be defined.
Command line syntax could be extended to be something like this:
dotnet test -pSolutioName=mySolution myexample.csproj
(Pure example, dev team can decide best approach)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:21 (12 by maintainers)
Top Results From Across the Web
dotnet test command - .NET CLI
The dotnet test command is used to execute unit tests in a given project. ... setting the MSBuild DefineConstants property to DEV :...
Read more >MSBuild reference for .NET SDK projects
Use the NetStandardImplicitPackageVersion property when you want to specify a framework version that's lower than the metapackage version. The ...
Read more >dotnet msbuild command - .NET CLI
The dotnet msbuild command allows access to a fully functional MSBuild. The command has the exact same capabilities as the existing MSBuild ......
Read more >dotnet build command - .NET CLI
The dotnet build command builds a project and all of its dependencies. ... accepts MSBuild options, such as -p for setting properties or...
Read more >MSBuild Properties
MSBuild lets you set properties on the command line by using the -property (or -p) switch. These global property values override property values ......
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
Figured it out - this is actually an unanticipated interaction of the current argument configuration of the parser. Line 36, where the
SlnOrProjectArgument
is added to the options to forward, is where the-p
argument is added. This is…unanticipated…to say the least.I today found out that a
dotnet build --property:SkipFrontendBuild=true
is working, but for test I need to have adotnet test -p:SkipFrontendBuild=true
and a--property
is silently ignored . Took me a moment.