Search code examples
c#asp.netvisual-web-developerserver-configuration

Visual Web Developer (Express): Setting Document Root for Dev Environment


I'm developing a site in Visual Web Dev Express, and when I run/debug, I'd like to be able to set my application's document root so that I can use safer paths, like "/css/style.css' instead of "css/style.css". How would I accomplish this?


Solution

    • Click on the web site node in the solution explorer.
    • Press F4 to see the properties window.
    • Change the virtual path from /projectname to /

    Bear in mind that this has an impact on how you expect the application/web site to be deployed. If it is ever used outside the root of a web server, the URL paths will be incorrect.