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 test - allow to specify msbuild properties

See original GitHub issue

At 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:open
  • Created 2 years ago
  • Reactions:1
  • Comments:21 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
baronfelcommented, Feb 2, 2022

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.

0reactions
StefanSchoofcommented, Jul 7, 2023

I today found out that a dotnet build --property:SkipFrontendBuild=true is working, but for test I need to have a dotnet test -p:SkipFrontendBuild=true and a --property is silently ignored . Took me a moment.

Read more comments on GitHub >

github_iconTop 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 >

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