80

I want to run my application from IIS on my local machine. I created the virtual directory and added the application to it and in the properties folder of the application I checked the radio button 'Use Local IIS Webserver'. I then started running my application but I'm getting the following error:

Unable to start debugging on the webserver.see help for common configuration errors.Running the webpage outside of the debugger may provide further information.

Make sure the server in operating correctly.Verify there 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.

How do I get rid of this error?

I'm using Visual Studio 2010 on Windows 7 and IIS 7.5.

2
  • I have added the below setting in the web.config <requestLimits maxAllowedContentLength="2147483648" /> <verbs allowUnlisted="false"> <!--Allowed Verbs--> <add verb="GET" allowed="true" /> <add verb="POST" allowed="true" /> </verbs> </requestFiltering> After this setting I am getting the above error, If I remove this then it's work fine? Does someone have any Idea why this is happening? or I need to allow any specific verbs to allow debugging? Commented Apr 9, 2018 at 5:53

46 Answers 46

50

There may be many reasons for the above problem.

You need to check this:- Unable to Start Debugging on the Web Server

On a side note:- Go to IIS and check that the App Pool you are using is started.

Try this from your command line:-

cd %windir%\Microsoft.NET\Framework\v4.0.30319
aspnet_regiis.exe -i
10
  • @sebastian:- There can be many reasons for the issue which you reported. I have added the link. Do check that!!! Commented Sep 8, 2013 at 6:20
  • @sebastian:- Updated my answer. Check if that helps!! Check if “Anonymous Authentication” is enabled. Commented Sep 8, 2013 at 6:28
  • should i type the whole thing in my commandprompt? vs cmd or system cmd?
    – sebastian
    Commented Sep 8, 2013 at 6:30
  • Microsoft.NET\Framework\v4.0.30319 is not recognised as an internal or external command is the error im receiving
    – sebastian
    Commented Sep 8, 2013 at 6:34
  • 5
    I'm adding this note for my own benefit and hope it helps others: every few months the service account for our dev platform application pool (don't ask why it's done that way) password changes, and the app pool shuts down. Just update the password for the app pool and it'll work.
    – Bill B
    Commented Dec 8, 2017 at 17:06
39

There are multiple solution of this problem, in my case I changed my machine's password but forget to change it in the process model identity of Advance setting of that Application pool.

Later IISRESET did the trick for me.

0
22

Just an update as I hit this issue and all of the settings in both Visual Studio and IIS seemed to be correct.

What actually worked for me was simply running Visual Studio as an administrator - I'm guessing that there is a permission that needs to be set somewhere, but I have no idea what or where.

Also a point to note is that I configured all my websites to use the DefaultAppPool in IIS which at the time was ASP.NET V2, then installed .NET 4 and the DefaultAppPool was converted to .NET4 so none of the sites would compile (that caused me a small amount of swearing)

Hope that helps someone

1
  • 1
    Was getting the same error. After running as administrator it worked. Commented Jul 6, 2017 at 7:30
21

I've seen alot of different solutions for this. iisreset did the trick for me.

Just open an elevated command prompt and type:

iisreset

2
  • That was the solution for me, before that happen I had a stackoverflow exception from few mistakes in my code running on the server, I think that`s what caused this error... Commented Mar 5, 2019 at 9:18
  • It didn't work with CMD as Admin, but it worked with PowerShell as Admin Commented Apr 14, 2020 at 23:30
14

Just to add, I had this issue, and fixed by disabling the Load User Profile option (unsure of any side effects). This is found through Advanced Settings for the Application Pool.

enter image description here

This then made it work for me.

14

In my case it was the lack of debug="true" in web.config (system.web -> compilation).

example:

<system.web>
   <compilation debug="true" targetFramework="4.5.2" />
   ....
</system.web>
0
13

I didn't see this answer on this thread or the (possible duplicated) question here.

I fixed the issue by:

  • Opening the Task Manager (ctrl+alt+del)
  • Under the Processes tab, End the task of IIS Worker Process (This may now be listed as Microsoft.IIS.Worker.Process or something similar) (You may have to click More details at the bottom if you don't see all of the processes)
  • Then going to the Services tab, Stop the IISADMIN service and the start it up again.

Run the program and that should hopefully fix it! Happy Coding and Debugging! :)

10

I'm running Windows 10 Professional with Visual Studio 2017 and none of the options above worked for me.

What fixed it for me was adding 'Windows Process Activation Service'.

Start > Type turn windows Features On or Off > Make sure "Windows Process Activation Service" is checked.

Hope it helps someone.

Screenshot

0
7

Just one of the 10 sites configured on my Local IIS was giving this error, so I had a feeling that it wasn't anything from the other answers that were machine-wide things, like Turning Windows Features On or Off, or running VS2015 as admin (the other 9 sites worked ok, in the same VS).

The specific error for me was:

Unable to start debugging on the webserver. Operation not supported. Unknown error:0x80004005

The problem turned out to be the web config having a URL Rewrite rule to rewrite HTTP -> HTTPS. Commenting this out resolved the problem

TL;DR - try disabling all your web.config URL rewrite rules, if you have them (then add them back in gradually, if it helps)

1
  • Thanks for this hint. Identical error was also only happening on one out of many projects, so I went through the web.config until I found what triggered it. For me it was the custom errors section! Commented Mar 18, 2022 at 14:57
6

Just had the same issue after VS crashed and Rahul's comment regarding the application pool pointed me in the right direction. In my case recycling the app pool did the trick (IIS Manager => App Pools => right click on ap in question and recycle).

0
6

in my case, the DefaultAppPool was stopped, I edited the Advanced Settings and set the value of Identity as LocalSystem, after that I start the DefaultAppPool.

0
5

go to Search > type services.msc and make sure that ASP.Net State Service is running.

4

The best answer online is at here. I tried the fifth method.

  1. Right click on your project in VS2005 or VS2008 or VS2010
  2. Click on Properties
  3. Click on Web tab
  4. Under Servers, click on the radio button Use Visual Studio Development Server
  5. Check Auto Assign Port radio button
  6. Uncheck NTLM Authentication and Enable Edit and Continue

Now run your application it will work for you.

2
  • thanks. It works with Local IIS option too. If you click "Create Virtual Directory". Even if it is already setup, clicking that button has fixed my issue
    – adeel41
    Commented Jan 30, 2017 at 14:59
  • That went well. Thanks. This should be a good solution if anybody using different versions of VS instances in one workstation.
    – Anoj
    Commented Sep 23, 2021 at 18:56
4

Check the Physical Path.

In my case, I had changed it by mistake.

In IIS, click on your website, then go to Basic Settings...

Check the path, and check the credentials. Enter the new credentials if needed.

enter image description here

To change the path, you can go to Visual Studio, Project - Properties, and recreate the Virtual Directory:

enter image description here

If asked to remap, click Yes.

3

reset your iis in 'Developer Command Prompt for (your visual studio version)'

type iisreset in that command prompt & hit enter. it'll reset iis automatically

2
  • add details as to how to reset iis
    – sinhayash
    Commented Jul 17, 2015 at 11:10
  • type iisreset in that command prompt & hit enter. it ll reset iss automatically.
    – gowtham ks
    Commented Jul 20, 2015 at 9:14
3

Project Properties > Web > Servers Change Local ISS > ISS Express

Change ISS

2

I resolved this issue. In my case my application pool was stopped. After little bit of Googling i found out that application pool was running under some user identity and password was changed for that user. After updating password it starts working fine.

2

If you are using HTTPS on localhost, odds are you created a self signed certificate. These have a tendency to expiry on the same day they are created, so you could have to recreate a certificate and add it to the binding of your locally hosted site.

2

Just ran into this problem myself and it turned out to be that my site in IIS was set up to use anonymous authentication with a specific network account. I had been forced to reset the password on that account, and so IIS was failing because it was using the old one. Once I updated the site with the new password (or even better, changed it to use Network Service instead), all worked again.

2

In my case this problem happened after my windows 10 updated to the latest version

-I have tried most of above solutions but not helped me

-I also checked event viewer to see what error happened.

this is the error related to iis was happened but not found any solution on internet about it after a lot of search

The Module DLL 'C:\WINDOWS\System32\inetsrv\cgi.dll' could not be loaded due to a configuration problem. The current configuration only supports loading images built for a AMD64 processor architecture. The data field contains the error number. To learn more about this issue, including how to troubleshooting this kind of processor architecture mismatch error, see http://go.microsoft.com/fwlink/?LinkId=29349.

enter image description here

The way i solve this problem is changing Enable 32-Bit Applications value to True

by right clicking on DefaultAppPool in IIS Manager and select Advanced Settings

enter image description here

2
  • 1
    While this did work for me, I would HIGHLY suggest you do not edit your DefaultAppPool settings - as a Best Practice. Instead, create a new App-Pool and name it with "32-Bit" in the name (or the name of your Web Application - if it will only be used by that 1 App). Otherwise, you risk mucking up the works with existing Applications that are already using the DefaultAppPool - or future Applications that will.
    – MikeTeeVee
    Commented Jul 7, 2020 at 20:57
  • @MikeTeeVee i didn't have enough information about this risk, thanks for pointing this out. Commented Jul 8, 2020 at 12:07
2

For who has same issue on VS Professional 2019. I Installed Xamarin bundle and after that this IIS error starts. I have tried all solutions above without any luck. What I did to fix it is :

  • From Visual Studio Installer check Development time IIS support from web & Cloud - ASP.NET and web development. enter image description here

  • Restart IIS

  • Open solution - Issue fixed.
0
1

Do you use or have IIS Rewrite installed on your machine? I have a similar problem on my machine but to get round it, I have web.config open as the current page in VS and press f5. I then have to navigate to the page to debug. It seems to work for me.

2
  • 1
    I think if you have a rule to rewrite http to https maybe this could be a problem Commented Jun 3, 2017 at 4:23
  • So long ago now Simon, I swapped to using MVC, I can't remember but probably it. Commented Jun 3, 2017 at 9:13
1

I edited the solution file and changed localhost to my ip address. Before that I had added IIS_IUSRS with full control in the project directory. I can now debug.

1

Follow my steps :

  1. Open your web config file .
  2. See your 'staticContent' tag
  3. Delete or commend unwanted setting tag ex: -> < mimeMap fileExtension=".woff" mimeType="application/x-font-woff"/>
1

In my case this folder was missing:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files

Adding that folder and the necessary permissions solved it for me.

1
  • In my case it was within C:\Windows\Microsoft.NET\Framework64\v4.0.30319\
    – PaulBinder
    Commented Jan 3, 2018 at 16:22
1

If you are using active directory login u need to check password and username.

1

Make sure that you etc file in C:\Windows\System32\drivers does not has any other applications with the same name as the one you are getting an error on.

I had a Hadoop sandbox configured with the name 'localhost' which was the same as my Visual Studio project which was getting the 'Cannot start debugging on web server' error.

Remove those lines and your project should start debugging.

1

In my case it looks like Chrome locking some resources, preventing from debugger to attach. After I closing Chrome, I able to attach again.

1

If you can check your logs you should be able to get an error status and substatus.

Logs are usually located at %SystemDrive%\inetpub\logs\LogFiles

I just had to face a similar problem, looking at the log i've found:

2018-11-12 10:09:22 ::1 DEBUG /PPD/debugattach.aspx - 80 - ::1 - - 403 4 5 0

Here the status is 403 and substatus is 4, this table https://support.microsoft.com/en-ca/help/943891/the-http-status-code-in-iis-7-0-iis-7-5-and-iis-8-0 provided the knowledge to fix the problem! 403.4 is in fact SSL Required, once i've changed the project URL in Visual Studio from http to https (Project properties -> Web -> Server -> Project URL) the problem disappeared.

I've described my fix only to clarify the steps involved in fixing the issue, read all the answer and not just from "once i've changed the project URL..." and follow your logs!

Good luck!

0

I've faced this problem, then I found out that i gotta run Visual Studio as admin in order to debug the project.

Hope it helps!

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