Click here to Skip to main content
Click here to Skip to main content

How to copy and configure ASP.NET projects between different local computers

, 13 Mar 2005
Rate this:
Please Sign up or sign in to vote.
This article describes how to copy project files from one disk source containing an invalid URL path, and set it up to allow VS.NET to accept the project by configuring a proper mapping.

Introduction

I wrote this article because I had many questions asked of me regarding the "simple" act of copying Visual Studio .NET projects from removable disk drives to a local machine. The issue is how the webinfo file was first created in the original project and what Visual Studio .NET looks for to map your project to the URL. The software is not "smart" enough to know that you saved your project on a floppy disk just so you could work on the project somewhere else on a different machine. So, when you try opening a project from a floppy drive, you get a type of error message that tells you the file path (from the A: drive) does not correspond to the URL that you set up with the original application, like with your localhost URL.

My example shows you how to copy VS.NET to accept your project by doing three general things, which are a) Change the vbproj.webinfo file to correspond to the path you want to work on in the destination computer, b) copy the project file to that destination path you specified and c) change the folder to an application in IIS.

Symptomatic type of error message:


Reason: The file path of the destination project does not map correctly to the project path specified in the webinfo file when trying to open it in Visual Studio .NET. For smaller projects with several files, it may be more convenient to just create a new project in VS.NET and add files to it from another project on a different disk location by using the Project menu in VS.NET. However, in larger projects that contain many files this option may be impractical. To get around adding all these files manually, follow these steps.

Steps to copy your project from one disk location to another computer with a different disk location or file path name and configure it appropriately to run.

  1. Go to the project you want to copy, such as one saved on an A: floppy drive.
  2. Find the vbproj.webinfo folder (or csproj.webinfo for C#) and double-click this file. It should look something like this:

<VisualStudioUNCWeb>

<Web URLPath = "http://localhost/ControlsList/WebForms/ControlsList.vbproj" />

</VisualStudioUNCWeb>

  1. This file is what is mapped between VS.NET and IIS from the original project. Note: localhost can also appear as the actual name of your local computer, whatever name you may have given it.
  2. Next, change the path name to the folder you want to copy your project to. For example, lets say we want to copy this project to just the ControlsList folder in the server root folder, so we would modify this as:

<VisualStudioUNCWeb>

<Web URLPath = "http://localhost/ControlsList/ControlsList.vbproj" />

</VisualStudioUNCWeb>

  1. Save this file and close it.
  2. Using Windows Explorer, copy your project folder from the source disk, (which will contain all the projects files from the A: drive in our example above) to the C:\Inetpub\wwwroot directory. Remember we changed the webinfo file to just have this folder in the server root. Now, it will have a physical file path of C:\Inetpub\wwwroot\ControlsList
  3. Go to the Internet Information Services console. In Windows XP, choose ‘Control Panel-> Performance and Maintenance-> Administrative Tools and double-click Information Internet Services.
  4. Expand the (local computer) plus sign and expand the Default Web Site section (show in the diagram):

  5. Go to the folder you copied from the A: drive to the wwwroot folder. For our example, the folder is named ‘ControlsList’. Notice how it is shown as a folder as like so:
  6. Right click on the folder and select ‘Properties” as shown here.

  7. Under the application settings, click the “Create” button for the “Application name:” property.

    Notice that you will see the folder name appear in the text box and the button text changes from "Create" to “Remove" (shown here):

  8. Click on Apply and click OK.
  9. Notice in the Internet Information Services panel how the folder icon changes from a folder icon to an application icon as shown here:
  10. Lastly go to Visual Studio .NET and BUILD your project.
  11. Run your project with the IDE or browser.

    If you see a “Parse error message: Could not load type <packagefolder>.<WebformClass>” (shown below) when you run your project, then the issue may be because:

    1. You did not successfully convert the project folder into an application. To correct this, follow the above steps 7 through 15 again.
    2. You did not build your project. To do so in VS.NET, from the Build menu, either build or rebuild you project.
Server Error in '/' Application.

Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load type 'ControlsList.WebForm1'.

Source Error:

Line 1: <%@ Page Language="vb" AutoEventWireup="false" Codebehind="ControlsList.aspx.vb" Inherits="ControlsList.WebForm1"%>

Line 2: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

Line 3: <HTML>


Source File: c:\inetpub\wwwroot\ControlsList\ControlsList.aspx Line: 1




Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

harryteck
Web Developer
United States United States
Harry is a .NET Developer for a major financial institution building web and stand alone applications and class libraries. He also has experience teaching courses on ASP.NET and Microsoft databases. He holds a graduate degree in Information Science.

Comments and Discussions

 
GeneralCan't display the application in web browser PinmemberLian_H19-Jun-08 5:25 
GeneralRe: Can't display the application in web browser Pinmemberharryteck19-Jun-08 15:34 
GeneralCommand line for COPY PROJECT in VS.NET 2003 Pinmemberlochan_indiana6-Sep-07 8:53 
QuestionCannot run the project after copy to new system? Pinmembermrajanikrishna25-May-06 16:11 
AnswerRe: Cannot run the project after copy to new system? Pinmemberharryteck26-May-06 3:23 
GeneralRe: Cannot run the project after copy to new system? Pinmembermrajanikrishna26-May-06 14:55 
GeneralRe: Cannot run the project after copy to new system? Pinmemberharryteck27-May-06 17:13 
QuestionRe: Cannot run the project after copy to new system? Pinmembermrajanikrishna28-May-06 15:06 
QuestionHow to open the web app on the internet PinmemberHF Solutions3-Mar-06 12:46 
AnswerRe: How to open the web app on the internet Pinmemberharryteck5-Mar-06 14:22 
QuestionWorking in a Different Pool PinmemberCentinell26-Feb-06 3:12 
AnswerRe: Working in a Different Pool Pinmemberharryteck26-Feb-06 8:54 
GeneralThanks for saving me time!! Pinmemberjumpstart791-Feb-06 22:21 
GeneralRe: Thanks for saving me time!! Pinmemberharryteck2-Feb-06 17:23 
QuestionContinuation to an earlier Query :Error in writing to the Event Log PinmemberAanchal Naidu16-Dec-05 12:55 
GeneralThanks Harry and one more Query PinmemberAanchal Naidu16-Dec-05 12:18 
GeneralRe: Thanks Harry and one more Query Pinmemberharryteck17-Dec-05 4:40 
GeneralRe: Thanks Harry and one more Query Pinmemberharryteck17-Dec-05 4:47 
QuestionRe: Thanks Harry and one more Query PinmemberAanchal Naidu18-Dec-05 4:37 
QuestionQuestions regarding:How to copy and configure ASP.NET projects between different local computers PinmemberAanchal Naidu16-Dec-05 5:11 
AnswerRe: Questions regarding:How to copy and configure ASP.NET projects between different local computers Pinmemberharryteck16-Dec-05 6:24 
Generalcopy and configure ASP.NET projects between different local computers Pinmembersidda23-Nov-05 12:22 
GeneralRe: copy and configure ASP.NET projects between different local computers Pinmemberharryteck23-Nov-05 14:16 
QuestionHow to use my web application on another computer PinmemberNisarat30-Jun-05 18:43 
AnswerRe: How to use my web application on another computer Pinmemberharryteck2-Jul-05 8:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web02 | 2.8.141022.2 | Last Updated 13 Mar 2005
Article Copyright 2005 by harryteck
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid