Skip to content

Solution build configurations ignored when using "dotnet build" and "dotnet run" #10336

Discussion options

You must be logged in to vote

I can think of the following approaches, ordered by descending preference:

  1. Add SetConfiguration metadata to the ProjectReference item, to choose a configuration that is supported by the referenced project. Common MSBuild project items
  2. Run MSBuild on the solution rather than on an individual project, but specify the project as part of the target. Build specific targets in solutions by using MSBuild.exe
  3. Add a custom target that runs after AssignProjectConfiguration and replaces unsupported configurations with supported ones. This might be incompatible with MSBuild static graph.
  4. Set properties to fake a solution build and cause AssignProjectConfiguration itself to choose the same configurat…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@PJB3005
Comment options

Answer selected by PJB3005
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants