Let's take a solution containing a single Debug configuration. Let's add two projects to this solution - App1 and Library1. Now, App1 contains DebugApp configuration, Library1 contains DebugLibrary configuration and the solution is set to build these configurations on its' Debug configuration.
App1 contains a reference to Library1 and utilizes some of the types declared there.
When I open this solution through MSBuildWorkSpace.OpenSolutionAsync() method, and then get Compilation objects for each project, I get compilation errors in App1 compilation about types declared in Library1.
The problem is, it is impossible to open the whole solution with correct configuration for each of these two projects, as I can only specify a single Configuration|%Name% pair when creating the MSBuildWorkSpace.
It is possible to open each project in a separate workspace, passing the correct configuration to each one, but then one project references another one, as in the case of App1 and Library1, I still get the compilation errors, as Library1 does not have DegubApp configuration and vice versa.
We've created a workaround for this by opening each project separately and then adding them to a single solution through AddProject mthod, but this seems unreliable (for example, we had to rearrenge project references for each project as when opened in a separate workspace it will have a different GUID id from another workspace) and it takes a lot longer then just using OpenSolutionAsync method, as each project opened in a separate workspace also loads all of its' dependencies (with possible incorrect configurations).
Let's take a solution containing a single
Debug
configuration. Let's add two projects to this solution -App1
andLibrary1
. Now, App1 containsDebugApp
configuration,Library1
containsDebugLibrary
configuration and the solution is set to build these configurations on its'Debug
configuration.App1
contains a reference toLibrary1
and utilizes some of the types declared there.When I open this solution through
MSBuildWorkSpace.OpenSolutionAsync()
method, and then getCompilation
objects for each project, I get compilation errors inApp1
compilation about types declared inLibrary1
.The problem is, it is impossible to open the whole solution with correct configuration for each of these two projects, as I can only specify a single
Configuration|%Name%
pair when creating the MSBuildWorkSpace.It is possible to open each project in a separate workspace, passing the correct configuration to each one, but then one project references another one, as in the case of
App1
andLibrary1
, I still get the compilation errors, asLibrary1
does not haveDegubApp
configuration and vice versa.We've created a workaround for this by opening each project separately and then adding them to a single solution through
AddProject
mthod, but this seems unreliable (for example, we had to rearrenge project references for each project as when opened in a separate workspace it will have a different GUID id from another workspace) and it takes a lot longer then just usingOpenSolutionAsync
method, as each project opened in a separate workspace also loads all of its' dependencies (with possible incorrect configurations).