Microsoft KB Archive/830611

= You cannot open ASP.NET Web application project after deployment =

Article ID: 830611

Article Last Modified on 3/27/2007

-

APPLIES TO


 * Microsoft ASP.NET 1.0
 * Microsoft ASP.NET 1.1
 * Microsoft Visual Studio .NET 2002 Professional Edition
 * Microsoft Visual Studio .NET 2002 Enterprise Architect
 * Microsoft Visual Studio .NET 2002 Enterprise Developer
 * Microsoft Visual Studio .NET 2002 Academic Edition
 * Microsoft Visual Studio .NET 2003 Professional Edition
 * Microsoft Visual Studio .NET 2003 Enterprise Architect
 * Microsoft Visual Studio .NET 2003 Enterprise Developer
 * Microsoft Visual Studio .NET 2003 Academic Edition
 * Microsoft Visual Studio 2005 Professional Edition
 * Microsoft Visual Studio 2005 Standard Edition

-



SYMPTOMS
You create an ASP.NET Web application project, and then you deploy the project on another computer. When you try to open the deployed project, you may receive the following error message:

The project you are trying to open is a Web project. You need to open it by specifying its URL path.



WORKAROUND
To work around this problem, use any of the following methods. For more information about each of these methods, click the method to view the procedure.
 * Manually copy the project files to the deployment computer
 * Deploy the project by using the same virtual directory name
 * Rename the Webinfo file and the project files

Manually copy the project files to the deployment computer

 * 1) On the deployment computer, create a folder named Project1 in the C:\Inetpub\Wwwroot folder.
 * 2) On the deployment computer, create a virtual directory named Project1, and then map this virtual directory to the C:\Inetpub\Wwwroot\Project1 folder.
 * 3) Copy all the project files from the   computer to the C:\Inetpub\Wwwroot\Project1 folder that you created on the deployment computer.

Note  is a placeholder for the name of the development (or source) server.

back to the top

Deploy the project by using the same virtual directory name
When you deploy the project by using Microsoft Windows Installer, change the name of the virtual directory of the project to be the same as the name of the virtual directory of the original project (Project1). By default, the virtual directory name that the Setup wizard provides is the name of the Web Setup project (WebSetupProject1).

For more information, see step 5 of the &quot;Run your Web Setup project on a remote (deployment) computer&quot; section of this article.

back to the top

Rename the Webinfo file and the project files
After you deploy the project by using a Web Setup project, rename the Webinfo file and the project files to map to the virtual directory of the project. To do this, follow these steps:
 * 1) In Microsoft Windows Explorer, locate to the C:\Inetpub\wwwroot\WebSetupProject1 folder.
 * 2) Rename the following file, depending on your project:
 * 3) * If you are using Microsoft Visual C# .NET or Microsoft Visual C# 2005, rename the Project1.csproj.webinfo file to WebSetupProject1.csproj.webinfo.
 * 4) * If you are using Microsoft Visual Basic .NET or Microsoft Visual Basic 2005, rename the Project1.vbproj.webinfo file to WebSetupProject1.vbproj.webinfo.
 * 5) Rename the following file, depending on your project:
 * 6) * If you are using Visual C# .NET or Visual C# 2005, rename the Project1.csproj file to WebSetupProject1.csproj.
 * 7) * If you are using Visual Basic .NET or Visual Basic 2005, rename the Project1.vbproj file to WebSetupProject1.vbproj.

back to the top



STATUS
This behavior is by design.



Methods to deploy a Web application project on a remote (deployment) computer
To deploy a Web application project on a deployment computer, use any of the following methods:  Manually copy the project to the deployment computer. Create the project on the deployment computer.

For more information, click the following article number to view the article in the Microsoft Knowledge Base:

822316 How to create a new ASP.NET Web application on a remote Web server

 Copy the project by using the Project Copy option in Microsoft Visual Studio .NET or in Microsoft Visual Studio 2005.

For more information, click the following article number to view the article in the Microsoft Knowledge Base:

326495 How to move your Visual Studio .NET Web project to another computer

 Deploy the project by using the Web Setup option in Visual Studio .NET or in Microsoft Visual Studio 2005.

If you use this method, you may receive the error message that appears in the &quot;Symptoms&quot; section of this article.

Steps to reproduce the behavior
To reproduce this problem, follow these steps:
 * 1) Create an ASP.NET Web application.
 * 2) Add a Web Setup project to your solution.
 * 3) Add the Web application files to your Web Setup project.
 * 4) Configure the Bootstrapper URL for your Web Setup project.
 * 5) Copy files to the bootstrapping application folder.
 * 6) Run your Web Setup project on a remote (deployment) computer.

Step 1: Create an ASP.NET Web application

 * 1) Start Visual Studio .NET or Visual Studio 2005.
 * 2) Use Visual C# .NET or Visual C# 2005 or use Visual Basic .NET or Visual Basic 2005 to create an ASP.NET Web Application project. Name the project Project1.

Note In Visual Studio 2005, create an ASP.NET Web Site project.
 * 1) On the Build menu, click Build Solution.

back to the steps

Step 2: Add a Web Setup project to your solution

 * 1) In Solution Explorer, right-click the Project1 solution, point to Add, and then click Add New Project. The New Project dialog box appears.
 * 2) Under Project Types, click Setup and Deployment Projects.
 * 3) Under Templates, click Web Setup Project.
 * 4) In the Name text box, type WebSetupProject1.
 * 5) In the Location text box, type C:\DeployFolder, and then click OK.

back to the steps

Step 3: Add the Web application files to Your Web Setup project

 * 1) In the File System (WebSetupProject1) window, right-click Web Application Folder, point to Add, and then click File. The Add Files dialog box appears.
 * 2) Locate the C:\Inetpub\wwwroot\Project1 folder.
 * 3) Select all the files that are in the Project1 folder, and then click Open.
 * 4) In the File System (WebSetupProject1) window, expand Web Application Folder.
 * 5) Under Web Application Folder, right-click bin, point to Add, and then click File. The Add Files dialog box appears.
 * 6) Locate the C:\Inetpub\wwwroot\Project1\bin folder.
 * 7) Click the Project1.dll file, and then click Open.

back to the steps

Step 4: Configure the Bootstrapper URL for your Web Setup project

 * 1) In Solution Explorer, right-click WebSetupProject1, and then click Properties. The WebSetupProject1 Property Pages dialog box appears.
 * 2) In the Bootstrapper list box, click Web Bootstrapper. The Web Bootstrapper Settings dialog box appears.
 * 3) In the Setup folder URL text box, type http:// /Bootstrap1, and then click OK.

Note  is a placeholder for the name of your Web server.
 * 1) In the WebSetupProject1 Property Pages dialog box, click OK.
 * 2) In Solution Explorer, right-click WebSetupProject1, and then click Build.

back to the steps

Step 5: Copy files to the bootstrapping application folder

 * 1) In the C:\Inetpub\Wwwroot folder, create a folder that is named Bootstrap1.
 * 2) Create a virtual directory that is named Bootstrap1, and then map this virtual directory to the C:\Inetpub\wwwroot\Bootstrap1 folder.
 * 3) Copy the following files from the C:\DeployFolder\WebSetupProject1\debug folder to the C:\Inetpub\wwwroot\Bootstrap1 folder:
 * 4) * Setup.Exe
 * 5) * WebSetupProject1.msi

back to the steps

Step 6: Run your Web Setup project on a remote (deployment) computer
 Start Microsoft Internet Explorer.</li> Type the following URL in the address bar, and then press ENTER:

http:// /Bootstrap1/Setup.Exe

Note  is a placeholder for the name of your Web server.</li> In the File Download dialog box, click Open.</li> In the Security Warning dialog box, click Yes.</li> In the WebSetupProject1 dialog box, click Next.</li> Keep WebSetupProject1 in the Virtual directory text box. Click Next.</li> On the Confirm Installation page of the WebSetupProject1 dialog box, click Next.</li> On the Installation Complete page of the WebSetupProject1 dialog box, click Close.</li> Locate the C:\Inetpub\wwwroot\WebSetupProject1 folder.</li> Open the following file in a text editor such as Notepad:  If you are using Visual C# .NET or Visual C# 2005, open the Project1.csproj.webinfo file.</li> If you are using Visual Basic .NET or Visual Basic 2005, open the Project1.vbproj.webinfo file.</li></ul> </li>  Modify the URLPath element as follows:

Visual C# .NET or Visual C# 2005 code <VisualStudioUNCWeb> <Web URLPath = &quot;http://localhost/WebSetupProject1/WebSetupProject1.csproj&quot; /> </VisualStudioUNCWeb> Visual Basic .NET or Visual Basic 2005 code <VisualStudioUNCWeb> <Web URLPath = &quot;http://localhost/WebSetupProject1/WebSetupProject1.vbproj&quot; /> </VisualStudioUNCWeb> </li> Save the file as one of the following, depending on your project:  If you are using Visual C# .NET or Visual C# 2005, save the file as WebSetupProject1.csproj.webinfo .</li> <li>If you are using Visual Basic .NET or Visual Basic 2005, save the file as WebSetupProject1.vbproj.webinfo .</li></ul> </li> <li>Open the following file, depending on your project: <ul> <li>If you are using Visual C# .NET or Visual C# 2005, open the Project1.csproj file.</li> <li>If you are using Visual Basic .NET or Visual Basic 2005, open the Project1.vbproj file.</li></ul>

You may receive the error message that appears in the &quot;Symptoms&quot; section of this article.</li></ol>

back to the steps

back to the &quot;Workaround&quot; section

<div class="references_section">