Unable to start debugging on the web server

I have created a new website in IIS7 lets say http://abc.testwebsite.com this website was pointing to the physical path of my web project directory.

Than i open my project VS 2010 and change its properties using following method

  1. Right click Project in solution explorer
  2. go to Project Properties at the bottom of menu
  3. a configuration page will be opened. Select Web tab and from Servers section select radio button saying "Use Local IIS Web Server
  4. in text box right under that radio button, give that URL where you have created a website pointing to your this project. Lets say, in my case i used [http://abc.testwebsite.com]
  5. Save the properties page.


than as we normally do i was just clicking play button in visual studio but i was getting an error saying "Unable to start debugger on the webserver...."


I dig around the internet and found that i am missing one very major step and that is an entry in my host file.

Actually this happens that whenever you want to create a new alias on your IIS or you want to open any alias from any other IIS which is not public but, it is in your local intranet, you must have to add an entry in your host file to pretend that you are actually accessing a public website.

 For adding entry in host file  

  1. Go to following path of your hard drive
    1. :\\windows\system32\drivers\etc\ .   normally as we install windows  in C: drive so the path would be C:\Windows\System32\drivers\etc\
  1. Open Notepad and drag files named "hosts" into notepad. 
  2. add a new entry in that file having following charcteristics 
    1. IP  website name
    2. lets say if i want to add http://abc.testwebsite.com] website to my host file my entry would be something like
      1. 127.0.0.1   http://abc.testwebsite.com
  3.  Save the file and close the window.

Now again open your project in visual Studio and re-run the project. it will  run successfully.


hope this article helped you, if yes. please do give your feedback and if not let me know on which point you got issue.







Comments