Question

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 ?

Was it helpful?

Solution

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.

OTHER TIPS

This did the trick for me:

In IIS > under .NET compilation

Note: Default Website is selected only for screenshot purposes.

enter image description here

Changing the Debug option to True

enter image description here

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.

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.

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.

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

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

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.

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.

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.

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.

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.

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"

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top