i have some visual studio projects which depend on other projects, which have different configurations.
example:
Project MyProject (Configuration: Release)
References:
Project LibA (Configuration: Release_DontLink)
Project LibB (Configuration: Release
Building using Visual Studio works correctly as the Configurations to be used for the different projects are stored inside the solution file.
But when i use msbuild to build MyProject, it builds the Release configuration of LibA, which is incorrect. Since both LibA and LibB are used by numerous other Projects, i cant change those configurations, i only have control over MyProject.
Is there any way to build MyProject using MsBuild without changing the LibA and LibB projects?
Possibly related question: Configuration for ProjectReference in MSBuild, however i did not fully understand the answer, and i think it would require me to change LibA/LibB
On the solution level (i.e: MyProject.sln), open the property pages and set the
Releaseconfiguration to buildRelease_DontLinkconfiguration for projectLibA. If you don’t have control over the sln file, you should be able to create a copy of it (i.e: MyProject.Release.sln).Then build the solution with:
Alternatively (not even remotely a best practice), after building
MyProjectbuildLibAwhile overriding itsOutDirproperty: