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.

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

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

Modify the XML content as

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

4. Now the project can be opened and you can continue with development.
This was first published in February 2002

Dig deeper on Microsoft .NET Web services

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

0 comments

Oldest 

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:

-ADS BY GOOGLE

SearchSoftwareQuality

SearchCloudApplications

SearchAWS

TheServerSide

SearchWinDevelopment

Close