This article has been archived. It is offered "as is" and will no longer be updated.
If you add project dependencies to an Enterprise Template project by using Microsoft Visual Studio 2003, the project dependencies are not saved when you close and then reopen the Enterprise Template project.
This problem occurs because the dependency information does not persist correctly for Enterprise Template subprojects when you close and then reopen the Enterprise Template project in Visual Studio .NET 2003.
To work around this problem, use a project reference.
If you create a project that depends on the file output of another project, and you want to set project dependencies to influence the build order of the projects, you can use a project reference.
A project reference performs the following functions:
References the build output of the referenced project.
Automatically updates the build order to make sure that the referenced project is built before the project that references it is built.
Add a project reference
In Visual Studio .NET, create an Enterprise Template project.
Add a Class Library project to the Enterprise Template project.
Add an ASP.NET Web application project to the Enterprise Template project.
Add a reference to the class library DLL to the ASP.NET Web application project. Call the methods of the class library DLL in the ASP.NET Web application project.
Build the solution.
On the Debug menu, click Start.
Modify the class library DLL.
On the Debug menu, click Start.
Notice that the class library is built first and the modifications that you made in step 7 appear in the build of the Enterprise Template project.
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.
Steps to reproduce the problem
Start Visual Studio .NET 2003.
Create an Enterprise Template project:
On the File menu, point to New, and then click Project. The New Project dialog box appears.
Under Project Types, expand Other Projects, and then click Enterprise Template Projects.
Under Templates, click Enterprise Template Project.
In the Name box, type MyTemplate, and then click OK.
Add any existing ASP.NET Web application project to the MyTemplate project:
In Solution Explorer, right-click MyTemplate, point to Add, and then click Existing Project. The Add Existing Project dialog box appears.
In the Add Existing Project dialog box, click an ASP.NET Web application project, and then click Open.
Repeat step 3 to add an existing class library DLL to the MyTemplate project.
Add project dependencies to the MyTemplate project:
In the Solution Explorer, click MyTemplate.
On the Project menu, click Project Dependencies. The Project Dependencies dialog box appears.
In the Project Dependencies dialog box, click the Dependencies tab. Notice that the projects that you added to the MyTemplate project in steps 3 and 4 appear in the Projects box.
Under Projects, select the project that you added in step 3.
In Depends on box, click to select the check box next to the class library DLL that you added in step 4.
Click the Build Order tab. Notice the build sequence of the projects.
Save the MyTemplate project.
Reopen the MyTemplate project.
Notice that the project dependencies that you set in step 5 have not been saved.
For more information, visit the following Microsoft Developer Network (MSDN) Web sites: