Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

How to prevent unit test libraries download when a production build is made using c# and dotnet cli?

$
0
0

In another languages, when a build for production is performed, there are configurations to avoid libraries or dependencies not related to the build like: unit test, code coverage, etc

nodes js

npm install --production

java

<dependency>...<scope>test</scope>...</dependency>mvn clean package

So my question is:

How to skip unit test libraries download on production build using c# and dotnet?

Unsuccessful attempts

Workaround

To have 02 different *.csproj

  • src/Api.csproj with required runtime dependencies
  • test/Api.Test.csproj with only unit test dependencies

This is a problem because I cannot set the csproj for testing when I run custom tasks

dotnet msbuild  -target:DisplayMessages --project test/Api.Test.csproj

Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>