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 last published in February 2002

Dig Deeper on Microsoft .NET Web services

PRO+

Content

Find more PRO+ content and other member only offers, here.

Start the conversation

Send me notifications when other members comment.

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

Please create a username to comment.

-ADS BY GOOGLE

SearchSoftwareQuality

SearchCloudApplications

SearchAWS

TheServerSide

SearchWinDevelopment

Close