Solution build configurations ignored when using "dotnet build" and "dotnet run" #10336
|
Hi, sorry if this is the wrong place to ask. In our project's solution file we have more than the usual Debug & Release configurations, we also have "Tools" and "DebugOpt". These configurations are however exclusive to the main code of our project (so not used for any analyzers we also have in-tree). This means the solution config looks like this. Most things use "Tools" but some configurations are set to "Release": This works fine, however I just discovered that This causes loud compilation failures in our project on default config, but I am more concerned in general about the implications of this. It means that every time somebody uses is there anything I can specify here so that |
Replies: 3 comments 1 reply
|
I can think of the following approaches, ordered by descending preference:
|
|
The core problem here is that solution configurations are used only when building in the context of a solution, while For |
|
I've written a workaround based on @KalleOlaviNiemitalo's suggestion 4. It also solves issues with restore operations, which is ignoring solution configuration even when building in the context of a solution. |

I can think of the following approaches, ordered by descending preference:
SetConfigurationmetadata to theProjectReferenceitem, to choose a configuration that is supported by the referenced project. Common MSBuild project items