[asp.net] IIS error, Unable to start debugging on the webserver

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.

This question is related to asp.net visual-studio-2010 iis iis-7.5

The answer is


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.


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.


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!


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"/>

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


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>

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.


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.


This could be a case of wrong windows user credentials.

This issue happens quite often after importing existing IIS projects that require a Windows username and password configured.

To solve this, make sure both the Application pool app, the website, and the website app are configured to work with your machine's credentials.

  1. On the IIS server node, select the pool-application/app/website and choose Advanced Settings.
  2. Check if the value of Physical Path Credentials is correct. fix it if not.

enter image description here

  1. On the IIS server node, select the pool-application/app/website and choose Basic Settings.
  2. Click on "Test Settings" and validate that the credentials are correct.

enter image description here


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

Change ISS


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!


It always happens to me after my network password changes.
Open IIS >> choose the Application pool >> Advanced settings >> Application Pool Identity >> Set Credentials >> set username and the new password.

also:

  1. make sure the status of the application pool is "Started".
  2. Restart IIS, via IIS manager or open cmd as administrator and run the command iisreset.

enter image description here


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


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

Just open an elevated command prompt and type:

iisreset


Thanks for all the answers but none of them worked for me. Although some of them gave me some ideas on what services and stuff that needs to be running to be able "turn on" the debugging of my web app again:

  1. Ensure that ASP.Net registered properly with IIS and running. To register it follow @Rahul Tripathi instructions then go to Search > type services.msc and make sure that ASP.Net State Service is running.
  2. As @Morvael suggested, always run your VS in admin mode.
  3. Check if the app pool where your web app resides is started.
  4. Ensure that the IIS server itself is running (this what solved the problem for me)

I still haven't figured out what is the reason why my IIS stopped. It was working fine yesterday then today it's not. Anyways, I hope this mini checklist helps somebody else. Cheers!


I had the same issue. The problem was I haven't Framework 4 installed while I had already Framework 4.5 So MIME type ASPX could not be realized without ISAPI 4.0.

To sort it, I could either uninstalled 4.5 first and add 4.0 then which made trouble or adding specific files to ISAPI restriction and ISAPI filter in the IIS root manually. I needed to grab aspnet_filter.dll and aspnet_isapi.dll located in both C:\Windows\Microsoft.NET\Framework\ and C:\Windows\Microsoft.NET\Framework64\

Having added those files, all would be good.


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


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.


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


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.


Just to add in my 2 cents.

Recently I installed docker for another project and this was causing a project running on IIS Express to generate the error “The specified port is in use”. To solve this I did a few things, but namely I executed this command:

netsh http add iplisten ipaddress=::

This commands breaks down sites running on IIS Local, so if you executed this command you can make your IIS Local sites working again by executing the following which undoes the previous command:

netsh http delete iplisten ipaddress=::

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.

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

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.


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


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.


Use Microsoft Web Platform Installer to install IIS ASP.NET 4.5

enter image description here

Found the solution here:


I went through every answer here and nothing worked. My situation was IIS and had a self signed certificate created a week ago. Worked fine for a week and all of a sudden I started getting the 403's. Finally I closed Visual Studio, went into IIS and deleted the virtual directory, went back in visual studio and created a virtual directory from the project web settings and everything started working again.

The self cert had a year expiration date so I'm not sure why it just stopped working but this got me back up.


Check your web config, if there are problems, you may get this error. I had a HTTP to HTTPS redirect in the web config but the application was set to launch as http.

To fix (Local IIS):

  1. Configure a https binding for your application in IIS.
  2. Right click the web project then Properties > Web. Under Servers, set the URL to your https URL.

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


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! :)


Building on the answer from @MiscellaneousUser, in my case it was the enabling of HSTS that I had done to force the website to use HTTPS instead of HTTP.

To solve the problem I had to disabled HSTS in the applicationHost.config file, which is usally found here: C:\Windows\System32\inetsrv\Config\applicationHost.config

The relevant line of the file is this - I just changed enabled from true to false:

<hsts enabled="false" max-age="31536000" includeSubDomains="true" redirectHttpToHttps="true" />

Obvious you need to consider the security impact of disabling HSTS. In my case this is my development PC so I only had HSTS turned on to simulate what production does.


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.


I tried everything on here and finally discovered that it was the setup in my web.config. I removed that section and it worked fine; I will go back and troubleshoot later as to why it was busted.

*Edit: I removed the statusCode="503" because of an issue with the App_Offline.htm file and the way in which the errors were configured. I've removed the line below (it isn't needed locally), and everything is working perfectly.

<remove statusCode="503"/>


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.


None of the other solutions worked for me. I resolved this issue by using the commands below.

For 32 bit machine:

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis –i

For 64 bit machine:

C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis –i

The issue is because the web.config file is not installed correctly.


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)


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.


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).


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.


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


Examples related to asp.net

RegisterStartupScript from code behind not working when Update Panel is used You must add a reference to assembly 'netstandard, Version=2.0.0.0 No authenticationScheme was specified, and there was no DefaultChallengeScheme found with default authentification and custom authorization How to use log4net in Asp.net core 2.0 Visual Studio 2017 error: Unable to start program, An operation is not legal in the current state How to create roles in ASP.NET Core and assign them to users? How to handle Uncaught (in promise) DOMException: The play() request was interrupted by a call to pause() ASP.NET Core Web API Authentication Could not load file or assembly 'CrystalDecisions.ReportAppServer.CommLayer, Version=13.0.2000.0 WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for jquery

Examples related to visual-studio-2010

variable is not declared it may be inaccessible due to its protection level SSIS Excel Connection Manager failed to Connect to the Source This project references NuGet package(s) that are missing on this computer Gridview get Checkbox.Checked value error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in CppFile1.obj What is the difference between Visual Studio Express 2013 for Windows and Visual Studio Express 2013 for Windows Desktop? Attach (open) mdf file database with SQL Server Management Studio What is and how to fix System.TypeInitializationException error? Could not load file or assembly "Oracle.DataAccess" or one of its dependencies IIS error, Unable to start debugging on the webserver

Examples related to iis

ASP.NET Core 1.0 on IIS error 502.5 CS1617: Invalid option ‘6’ for /langversion; must be ISO-1, ISO-2, 3, 4, 5 or Default Publish to IIS, setting Environment Variable IIS Manager in Windows 10 The page cannot be displayed because an internal server error has occurred on server The service cannot accept control messages at this time NuGet: 'X' already has a dependency defined for 'Y' Changing project port number in Visual Studio 2013 System.Data.SqlClient.SqlException: Login failed for user "This operation requires IIS integrated pipeline mode."

Examples related to iis-7.5

The client and server cannot communicate, because they do not possess a common algorithm - ASP.NET C# IIS TLS 1.0 / 1.1 / 1.2 - Win32Exception Register .NET Framework 4.5 in IIS 7.5 HTTP Error 401.2 - Unauthorized You are not authorized to view this page due to invalid authentication headers IIS error, Unable to start debugging on the webserver How do I get to IIS Manager? How prevent CPU usage 100% because of worker process in iis How do I give ASP.NET permission to write to a folder in Windows 7? ASP.NET 4.5 has not been registered on the Web server Fixing slow initial load for IIS "Cannot verify access to path (C:\inetpub\wwwroot)", when adding a virtual directory