VS.NET: Changing Web application location

While developing applications in VS.NET, the project will not open if the project directory is changed or renamed. This can be resolved by editing the .webInfo file in the project.

Consider that we create a new project from VS.NET an specify location as 'http://localhost/works/Webapplication1', VS.NET will do the following:

1. Create a physical folder where this virtual location is mapped, say as d:worksWebApplication1
2. Create at the required project files including Global.asax, web.config etc.
3. Now, you can add Web Forms and continue with the development of web pages.

Suppose now we need to move the application from 'works' folder to 'testing' folder, that is in 'd:testing'. The steps to be followed are:

1. Move the 'WebApplicaiton1' directory from 'd:works' to 'd:testing'
2. Now if you try to open the project, VS.NET throws error that 'file path does not correspond to the url'
3. To resolve this problem, in the 'webapplication1', you can find the file 'webapplication1.csproj.webinfo'

The content will be

    <Web URLPath =
"http://localhost/works/WebApplication1/WebApplication1.csproj" />

Modify the XML content as

    <Web URLPath="http://localhost/testing/WebApplication1/WebApplication1.csproj" />

4. Now the project can be opened and you can

    Requires Free Membership to View

continue with development.

This was first published in February 2002

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.