Error : “Unable to start debugging on the web serv

2019-03-08 18:57发布

问题:

I am getting an error when I want to create a web site on IIS server. I am using Windows 7 and Visual Studio 2010.

Do I have to register or configure asp.net 4.0 for the IIS ?

回答1:

There aren't many details here, but I was getting that same error while trying to Start Debugging on a web application project in Visual Studio 2010 that I'd just changed from 3.5 to 4.0.

This solved the problem for me from the command line:

cd %windir%\Microsoft.NET\Framework\v4.0.30319
aspnet_regiis.exe -i

Just make sure to go into IIS Manager afterwards and double-check your application pools and such, since it's likely that this will reset some of your configuration.



回答2:

This did the trick for me:

In IIS > under .NET compilation

Note: Default Website is selected only for screenshot purposes.

Changing the Debug option to True



回答3:

In Visual Studio 2010 this usually means there is a problem with Web.Config file that cannot be displayed in Debug mode. So, simply start the app using Ctrl F5 to run in normal mode will tell you which line in Web.Config is faulty.



回答4:

This error can appear if the password for the account used by the application pool changes. If you start getting this error after changing your network password you may need to update it for the application pool used by your local web sites as well.



回答5:

Check that the path of your site in IIS points to the path of your web project in VS.

I ran across this before and it was an issue of mismatched paths. If you've configured Visual Studio to use IIS and later on changed paths, IIS isn't updated automatically. You need to manually go into IIS and update the path.



回答6:

Make sure your site is setup to debug (debug="true") under web.config file

<compilation targetFramework="4.0" debug="true">


回答7:

I've had this several times - in my case it's always that I've not updated my hosts file so VS is trying to locate an external DNS instead of my local one.



回答8:

I spent a few hours fighting with this issue. In the end it seems to be that some changes made outside VisualStudio had confused it. I don't know what the issue actually was but things started to work again when I opened a different version from the same solution so that VisualStudio (or IIS) did some magic on the IIS configuration. Then I changed back to the original solution, the configuration was again modified - and now debugging works again.



回答9:

For me this was related to this solution: http://www.codeproject.com/Questions/83338/Does-not-have-write-access-to

 cd %windir%\Microsoft.NET\Framework64\v4.0.30319
 aspnet_regiis -i
 aspnet_regiis -ga "IIS APPPOOL\DefaultAppPool"

Note this didnt work after I did it on Framework folder and then worked after I did it on Framework64 folder. I guess do both to be sure.



回答10:

Another reason would be if you have SSL Certificate installed on IIS. You will have to disable the SSL from IIS manager for the application that you are debugging. Because Visual Studio tries to launch it as http instead of https.



回答11:

Tried running vs2010 as administrator?

Also try 1. Open IIS. Click “Default Web Sites”.

  1. Check if “Anonymous Authentication” is enabled.

  2. Enable “Windows Authentication” as well.



回答12:

I get this same error every time I set my project file as a share. I resolved it by going into the security tab of the file and re-adding "IIS AppPool\DefaultAppPool"



回答13:

In my case, i have to change the certificates bindings in IIS>Default Web Site > Binding. IIS Binding