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 CLI '--configuration' option normalizes 'release' argument to 'Release' if ran on solution, but does not do that if ran on project

See original GitHub issue

running dotnet build -c release <myfile>.sln will produce dlls in <project path>/bin/Release/

but

running dotnet build -c release <myfile>.csproj will produce dlls in <project path>/bin/release/


The use case problem is that in the latest SDK RID can not be specified on solution level - so projects should be built one-by-one, but dotnet test still can be ran for the whole solution. So if you build all projects with dotnet build -c release <project>.csproj and then try dotnet test -c release <solution>.sln it will fail to locate dlls.


dotnet version 3.1.403 msbuild version 16.7.0+7fb82e5b2 OS official mcr dotnet core image on 3.1-alpine: Linux c53f91ba3edd 4.19.128-microsoft-standard #1 SMP Tue Jun 23 12:58:10 UTC 2020 x86_64 Linux

https://github.com/lGSMl/dotnet-issue-showcase/runs/1865106137

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
joeloffcommented, Feb 9, 2021

Thanks, this helps a lot. I had access to view the build output.

0reactions
joeloffcommented, Feb 10, 2021

I’m able to repro this now locally. I suspect what’s happening is that when using the .sln file, the configurations values are always defined as “Debug” or “Release” and it then passes that as the $(Configuration), which will be problematic for something like Linux.

Read more comments on GitHub >

github_iconTop Results From Across the Web

dotnet run command - .NET CLI
The dotnet run command provides a convenient option to run your application from the source code.
Read more >
MSBuild reference for .NET SDK projects
This property is useful if you run dotnet publish on a solution file, as it allows automatic selection of projects that should be...
Read more >
dotnet build command - .NET CLI
The dotnet build command builds a project and all of its dependencies.
Read more >
dotnet clean command - .NET CLI
The dotnet clean command cleans the current directory. ... If a project or solution file is not specified, MSBuild searches the current ...
Read more >
dotnet publish command - .NET CLI
The dotnet publish command publishes a .NET project or solution to a directory.
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