37

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 ?

15 Answers 15

28

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.

1
  • -i Install this version of ASP.NET and update IIS configuration at the root level to use this version of ASP.Net. Commented Jan 5, 2017 at 15:43
24

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

3
  • 4
    Yes! don't forget to hit Apply.
    – GGGforce
    Commented Aug 27, 2013 at 15:38
  • how do you go to .net compilation screen? Commented Mar 11, 2016 at 1:00
  • @avi It's an item located in your IIS manager in the root node. Commented Mar 17, 2016 at 20:40
7

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.

0
6

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.

2

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.

0
2

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

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

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.

1

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.

6
  • they are both enabled. The error I am getting is this : "Unable to start debugging on the server. See help for common configuration errors. Running the web page outside of the debugger may provide further information. Make sure the server is operating correctly. Verify these are no syntax errors in web.config by doing a Debug.Start.Without Debugging. You may also want to refer to the ASP.NET and ATL Server debugging topic in the online documentation."
    – Kubi
    Commented Nov 30, 2009 at 18:04
  • Could be something in the web.config that's a bit messed up? Bad xml will cause that error if I'm not mistaken. Di yo utry running the webapp outside of VS2010?
    – MattC
    Commented Dec 1, 2009 at 9:02
  • Hey, I've installed vs2008 and tried to run the same application on it and it didn't debug either but I've created a new web app on iis in vs2008 and there were no problem with the server. Still have no idea about it. checked every properties of IIS Manager
    – Kubi
    Commented Dec 1, 2009 at 20:39
  • 2
    So it wont wont in VS2008 either. Post up the web.config and let's have a look see.
    – MattC
    Commented Dec 2, 2009 at 8:03
  • i'm getting the same error too. i can successfully nav to the web service via svc url so i don't think it's a config thing. can't figure it out.
    – topwik
    Commented Aug 23, 2010 at 15:49
1

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.

1

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.

0
1

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.

0
1

In my case, I was receiving a 0x80004005 error message box in VS2019. That was caused by HSTS being enabled in the "Advanced properties" on the website.

Screenshot of advance site settings in IIS

Found this post which seems useful if someone wants to do debugging with HSTS being enabled: https://scatteredcode.net/debugging-on-localhost-with-hsts/

0

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"

0

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

0

If you are using Visual Studio, you need to check what server you are trying to run your application on.

Right click on the project

-> Web

-> Servers

-> In the first dropdown choose "IIS Express" (To debug with VS).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.