Tuesday, August 19, 2008

[C#, VS2008 ] One Solution, Mulitple Projects

So I was trying to create one solution which would act as a master build to build the multiple Silverlight projects we have on the go. I ran into slight issues when setting this up, so I thought I'd outline how I did it.

1. Create a "Blank Solution" project.
1a. File -> New Project
1b. Select "Blank Solution" from Other Project Types -> Visual Studio Solutions

2. Force VS2008 to always show the main solution.
This helps when adding existing projects, since for some reason the default in VS2008 is to make the first project you add to the solution the root... making it hard to add multiple projects. *
2a. Go to Tools -> Options [Show all settings] -> Projects and Solutions
2b. Check "Always show solution".

3. Add the desired projects.
3a. Right click the Solution in the solution explorer and Add -> Existing Project.
3b. Browse to select the csproj file from the desired project.
3c. Repeat a&b for all desired projects.

4. Setup any dependencies between the projects.
This step may not be needed if each project already has correct dependencies setup.
4a. Right click the Solution and go to "Project Dependencies"
4b. Select each project from the drop down and select any dependencies if they exist.

That should be it! Build your solution, and all the projects included in the solution should be built in the respective project folders.

* Thanks to Danny-T.co.uk


.

No comments: