Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debug VS2010 website at root instead of subdirectory

So I inherited an IIS website and I am not familiar with the tools. When I run project it wants to start up at localhost/myApp/. If I do not have IIS configured to start up in this location then debugger fails to attach. However, I have code that assumes my site is on the root directory. I am on IIS 7 and Win 7 x64.

when I debug the website from inside VS2010 how do I tell it that my website is located at localhost/? My project is the one highlighted in red.

enter image description hereenter image description hereenter image description here

like image 470
mrtsherman Avatar asked Feb 21 '11 20:02

mrtsherman


2 Answers

To debug the website using root with visual studio in a website project do the following:

  1. Push F4 to bring up the properties window.
  2. Change the Virtual Path to '/' and then your good to go.
like image 116
nawdzy Avatar answered Nov 03 '22 18:11

nawdzy


The reason you can't change the starting url is because of the way the project was added to the solution. When the Web Site project is listed as a url instead of as a local file system path, it is because the project was added to the solution by using Add > Existing Web Site > Local IIS option. When a project is added in this manner, then Visual Studio.NET will not allow you to change the path.

In order to change the path, you should remove the project from your solution and add it back to the solution using Add > Existing Web Site > File System. Use the Add Existing Web Site dialog to navigate to the project folder (the same folder that is used as the Physical Path for the site in IIS). When the project is readded it will be listed in the Solution Explorer by the local path (i.e., E:\inetput\myapp) instead of the localhost url. From there, all of the options under Start Options should be configurable.

like image 25
rsbarro Avatar answered Nov 03 '22 16:11

rsbarro