I have a situation similar to the following:
A solution with two projects, A and B, with A referencing B. In addition to the standard build configs, Debug and Release, I would like to add a third Staging, which lets me do some config transforms for project A only. The Staging build config would have no effect on B and so I don't add it to the project.
Using the solution configuration manager, it's easy to set this scenario up...when the Active Configuration is Staging, A will use Staging and B will use Debug. The solution builds as expected. However, running
msbuild A.csproj /p:Configuration=Staging
will fail with The OutputPath property is not set for project B since B does not have the Staging build config.
My question is if there is a simple way to avoid this when building the project via msbuild
Adding the Staging config to B would work, but it seems cleaner to only add build configs to the projects they affect, and leave the rest alone. In a solution with many projects, ensuring every project has all of the possible build configs is not ideal (though not exactly terrible, either).