Search code examples
visual-studio-2010cassini

Why does Visual Studio append the solution path to the root url when using default server?


When I use the default server in Visual Studio 2010 (Not sure if this is cassini or IIS?), the the last folder within the path at which I open the web site project (not a solution), is appended to the losthost url.

For example:

C:\myproject\mywebsite1\

Would open a url at the following:

http://localhost:x/mywebsite1/login.aspx.

This seems to cause problems with CSS files and javascript not resolving etc, but if I change the url to http://localhost:x/login.aspx I then get an error stating the aspx file is not present.

Why is an extra folder appended? This is highly annoying, I just want the files being served to be in the root URL path as they are in the website project.


Solution

  • Go to your project, right click, properties and under the web tab, you should have checked Use Visual Studio Development Server, there you can specify a port and a virtual path, probably you have /mywebsite1 there, just delete that virtual path.

    You asked this some time ago, but hope it helps anyway.