This project is read-only.

How to create a mixed workspace

Topics: APIs
Jun 26, 2014 at 4:05 PM
Hello,

I'd like to create a solution in which some projects are loaded from disk (therefore, the workspace containing the solution should be a MSBuildWorkspace), but other projects are hand-made (and therefore, the workspace containing the solution should be a CustomWorkspace).

Since a workspace cannot be both, I'm a little bit stuck here... I'd appreciate any idea. I thought maybe I could create two workspaces, and then move one project from one solution to the other, but since the structure is heavily dependent on Ids, I don't think it could work out.
Jul 9, 2014 at 3:49 AM
Edited Jul 9, 2014 at 3:59 AM
There's no support for it directly. However that shouldn't stop you. You could use the MSBuildWorkspace to open the projects from disk. You could then define a subclass of CustomWorkspace and use the SetSolution method giving it the current solution from the MSBuildWorkspace, then use the CustomWorkspace API to add more projects.

The ids only need to be unique within a solution. Multiple workspaces can use the same ids.