I have a .NET Core 3 project that references several other projects. My main root project has a Release-X
build configuration, but the other projects only have a Release
configuration, no matching Release-X
configuration.
When I try to publish my main root project using this...
dotnet publish MyProject.csproj -c Release-X
... It appears to use some mysterious non-existing default build configuration for all the referenced projects. (I can tell because the referenced projects allow unsafe code in all of their build configurations, but building with the above command results in unsafe code errors.)
I want to be able to build my main root project using its Release-X
build configuration but build all referenced projects using their Release
configurations. How do I do this?