Microsoft KB Archive/317786

= How to manage multi-project solutions in Visual Studio .NET or in Visual Studio 2005 =

Article ID: 317786

Article Last Modified on 3/29/2007

-

APPLIES TO


 * Microsoft Visual Basic 2005
 * Microsoft Visual Studio .NET 2003 Professional Edition
 * Microsoft Visual Studio .NET 2002 Professional Edition

-



This article was previously published under Q317786



IN THIS TASK
SUMMARY
 * Requirements
 * Managing Projects in Visual Studio .NET

REFERENCES



SUMMARY
The information in this article applies to Microsoft Visual Basic .NET or Microsoft Visual Basic 2005. This article explains how to create a multi-language, multi-project solution that contains four different types of projects. After you create the solution, the focus of the article shifts to how to manage the build configuration and startup projects for the various projects in the solution.

back to the top

Requirements
The following items describe the recommended hardware, software, network infrastructure, skills and knowledge, and service packs that you will need.
 * SQL Server 7.0 or later with the Northwind database.
 * Microsoft Visual Studio .NET or Microsoft Visual Studio 2005.

Applies To:
 * Visual Studio .NET or Visual Studio 2005
 * Visual Basic .NET or Visual Basic 2005
 * C#

Prior Knowledge required:
 * None, but familiarity with SQL Enterprise Manager is helpful.

back to the top

Managing Multi-Project Solutions in Visual Studio .NET or in Visual Studio 2005
This article describes how to create a multi-language, multi-project solution that contains four different types of projects. After you create the solution, the focus of the article shifts to how to manage the build configuration and startup projects for the various projects in the solution.
 * 1) Click Start, point to Programs, point to Microsoft Visual Studio .NET, and then click Microsoft Visual Studio .NET.

Note In Visual Studio 2005, lick Start, point to Programs, point to Microsoft Visual Studio 2005, and then click Microsoft Visual Studio 2005.
 * 1) On the File menu, click New Project.
 * 2) In the New Project dialog box, click Visual Basic Projects under Project Types, click Visual Basic Projects, and then click ASP .NET Web Service under Templates.

Note In Visual Studio 2005, click Visual Basic in the Language box in the New Web Site dialog box.
 * 1) In the Location field, replace &quot;WebService1&quot; (without quotation marks) with &quot;HowToWebService&quot; (without quotation marks), and then click OK.
 * 2) In Solution Explorer, right-click Solution HowToWebService, point to Add, and then click New Project.
 * 3) In the New Project dialog box, click Visual C# Projects under Project Types, and then click Windows Application under Templates.

Note In Visual Studio 2005, click Visual C# under Project Types.
 * 1) In the Name field, type HowToClient, and then click OK.
 * 2) Right-click Solution HowToWebService, point to Add, and then click New Project.
 * 3) In the New Project dialog box, click Other Projects, and then click Database Projects.
 * 4) In Templates, click Database Project. Name this project &quot;HowToDB&quot; (without quotation marks), and then click OK.
 * 5) In the Add Database Reference dialog box, click Add New Reference.
 * 6) In the Data Link Properties dialog box, type localhost as the server name.
 * 7) In the User name field, type sa, and then click to select the Blank Password check box (or type the appropriate credentials for your local SQL Server).
 * 8) In the bottom drop-down menu, click Northwind, and then click OK.
 * 9) Right-click Solution HowToWebService, point to Add, and then click New Project.
 * 10) In the New Project dialog box, click Setup and Deployment Project under Project Types, and then click Setup Project under Templates.
 * 11) In the Name field, type HowToSetup, and then click OK.
 * 12) In Solution Explorer, right-click HowToSetup, point to Add, and then click Project Output.

This determines what the deployment project packages up and installs.
 * 1) In the Add Project Output Group dialog box, click HowToClient on the Project menu, click to select the Primary Output check box, and then click OK.
 * 2) In Solution Explorer, right-click HowToSetup, point to View, and then click Custom Actions.

Note that adding &quot;Primary output&quot; is the only requirement for a proper installation.
 * 1) Right-click Custom Actions, and then click Add Custom Action.
 * 2) In the Select Item in Project dialog box, click Application Folder on the Look in menu.
 * 3) Under the Look in menu, click Primary output from HowToClient (Active), and then click OK.
 * 4) Press CTRL+SHIFT+S to save the solution.
 * 5) In Solution Explorer, right-click Solution HowToWebService, and then click Set Startup Projects.
 * 6) In the Solution HowToWebService Property Pages dialog box, click Multiple Startup Projects.
 * 7) In the Action column, click Start without Debugging for both projects.
 * 8) Click OK.
 * 9) Right-click Solution HowToWebService, and then click Configuration Manager.

The dialog box that appears permits you to set which Projects are built and the build configuration.
 * 1) In Configuration, click to select the Release check box for HowToClient, click to select the Build check box for HowToSetup, and then click Close.
 * 2) Press CTRL+SHIFT+B or right-click the Solution file, and then click Build Solution.

The Output window displays the continuous build output, which should end with &quot;Build: 3 succeeded, 0 failed, 0 skipped&quot; (without quotation marks).
 * 1) Right-click HowToSetup, and then click Build. (To build each project individually, right-click the Project and, then click Build.)
 * 2) Press CRTL + F5 to build, and then run the Solution. After the Solution is built both the Windows Form from the HowToClient application and the Service1.asmx file for the HowToWebService starts to indicate that both projects have started.

back to the top