[asp.net-mvc] ASP.NET MVC5/IIS Express unable to debug - Code Not Running

I start a VS2013 VB.Net MVC5 Web Application, set a breakpoint in HomeController About method and run "Start Debugging", navigate to About page and receive the message "Code not running - The current Thread is not currently running or the call stack could not be obtained" preventing any debugging.

If I set a breakpoint in Global.asax Application_Start, the breakpoint works fine. Changing the "Enable Edit & Continue" makes no difference.

Anyone have any ideas what is happening?

Update: My environment was Windows 8.0 Pro with VS2013 Ultimate.

I have since flushed my system and done a completely fresh install of Windows 8.1 Pro, VS2010 Ultimate, VS2012 Ultimate, & VS2013 Ultimate.

Same test done on all 3 versions of VS - File > New Project > MVC (Default). All 3 versions of VS are reporting "Process with an Id of xxx is not running."

VS2013 debug trace reports "The program '[7720] iisexpress.exe: Program Trace' has exited with code 0 (0x0). The program '[xxxx] iisexpress.exe' has exited with code -1073741816 (0xc0000008) 'An invalid handle was specified'."

I have run VS in and out of Administrator mode and receive the same results. I have uninstalled and reinstalled IIS Express 8.0.

The answer is


I had a similar problem while moving from Visual Studio 2013 to Visual Studio 2015 on a MVC project.

Deleting the whole .vs solution worked as a charm as Johan J v Rensburg pointed out.


Resolution fix: For me, the problem was related to active chrome sessions. I closed all of my chrome browser sessions and then tried building to chrome again. I am using Visual Studio Professional 2017 version 15.3.2. The VS application I was running into build errors with was a WebAPI project. When trying to click the green play button, I was getting dialog error stating "Unable to start the program 'http://localhost:18980/'. An operation is not legal in the current state. Hopefully this post helps someone.


The similar problem occurs in aspdotnet core with the same error The program '[xxxx] iisexpress.exe' has exited with code -1073741816 (0xc0000008).

Log file setup in web.config did not produce any info also:

<aspNetCore  stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" />

To find exact error the next step with log info in command prompt helped:

> dotnet restore
> dotnet run

In my case the problem was in dotnet core v 1.0.0 installed, while version 1.0.1 was required to be globally installed.


I made it work by doing the following:

  • Delete the ".vs" folder under the application folder
  • Delete the "IISExpress" folder from the Document
  • Enable the 64 bit version of IIS Express on visual studio by going to Tools -> Options -> Projects and Solutions -> Web Projects enter image description here
  • May need to delete everything from temp folder
  • May need to change the port by right click on project, go to properties, under web and change the project url port.

Well.. for me it was Telerik JustMock Q3 2013 (13.3.1015.0) that caused the problem. Uninstalled it from VS 2013 and the problem has gone..

see also ASP.NET-MVC4 Code Not Running and http://feedback.telerik.com/Project/105/Feedback/Details/63749-unable-to-debug-asp-net-projects-with-q3-2013

One lost day and many new white hairs... Curse on you Telerik guys! ;)


Another scenario may be that the port that IIS is using for your application is already being used by another running application. Try changing the port and see if it works for you.


In my case the issue was that Virtual directory was not created.

  1. Right click on web project file and go to properties
  2. Navigate to Web
  3. Scroll down to Project Url
  4. Click Create Virtual Directory button to create virtual directory

enter image description here


I started to get this problem with Asp.Net Core Web Applications in Visual Studio 2017. It didn't matter if it was the .Net Core Standard version with .Net 4.5.2 or the Core version with 1.1 in my case. IISExpress crashed when I started debug.

Tried everything, nothing worked until I went into add/remove programs in Windows 10 and I uninstalled .net core 1.0 runtime (I had both 1.0 installed AND 1.1). Once that was uninstalled, I started Visual Studio 2017 and my .Net Core Web applications (both kinds) and they both started working again!


For me the solution was a much simpler one. In my Solution Explorer in Visual Studio, I right click on the web project, chose properties and then navigated to the "web" tab. From there I changed the Project URL to another port number. For example, if it was http://localhost:1052 - I changed it to http://localhost:4356.

Process with an Id of xxx is not running.

Not sure if this helps anyone else, but it worked for me - hopefully it will work for you too!


None of the above answers worked for me but I finally found what my issue was. Hopefully this will help someone down the line.

First run IIS Express from command prompt to validate that the site can or cannot be run

https://docs.microsoft.com/en-us/iis/extensions/using-iis-express/running-iis-express-from-the-command-line

Im my case, i got an error saying that C:\Windows\Microsoft.NET\Framework64\v4.0.30319\CONFIG\web.config had malformed xml on line 14. Looking at that line in the file it just said null null null null null etc.

The fix for me was to replace the web.config file with one from my coworkers. IMPORTANT you must get the file from someone running the same version ie if you are VS2015 get a copy from someone running VS2015. If you get it from someone running a different version you will see an error saying it could not load an assembly from the manifest.

Hopefully this helps someone that has tried all the suggestions above. I think the cause of this for me was updating from trial mode and adding a product key within VS2017


The following steps fix the problem for VS 2015 and VS 2017:


Close VS.

Navigate to the folder of the solution and delete the hidden .vs folder.

open VS.

Hit F5 and IIS Express should load as normal, allowing you to debug.


Delete File C:\Users\congt\Documents\IISExpress


I have solved this issue for me. Try to change all Deny values to Allow in file %SYSTEM_DRIVE%\Program Files\IIS Express\AppServer\applicationhost.xml. Please, take into account what IIS Express Web Server you are using in Visual Studio Settings, 32 bit or 64 bit, that means I have to check the file in different folders. Then restart Visual Studio. I don't know about security issues for those config lines, so change them at your own risk, but it has solved my problem.

<section name="asp" overrideModeDefault="Allow" />
<section name="caching" overrideModeDefault="Allow" />
<section name="cgi" overrideModeDefault="Allow" />
<section name="defaultDocument" overrideModeDefault="Allow" />
<section name="directoryBrowse" overrideModeDefault="Allow" />
<section name="fastCgi" allowDefinition="AppHostOnly" overrideModeDefault="Allow" />
<section name="globalModules" allowDefinition="AppHostOnly" overrideModeDefault="Allow" />
<section name="handlers" overrideModeDefault="Allow" />
<section name="httpCompression" overrideModeDefault="Allow" />
<section name="httpErrors" overrideModeDefault="Allow" />
<section name="httpLogging" overrideModeDefault="Allow" />
<section name="httpProtocol" overrideModeDefault="Allow" />

etc.


If you are using 64 bit machine

Go to Visual Studio > Tools Menu > Options

Options window with Projects and Solutions > Web Projects selected and option Use the 64 bit version of IIS Express selected


I had the same problem and my solution was the following:

Instead of deleting the main applicationhost.config (in your "Documents/IIS Express" folder), check your solution folder for a hidden ".vs" folder with a "config" sub-folder. If that folder exists and it has it's own applicationhost.config file you need to either rename (or delete) that file or edit it and make sure the website(s) configured inside match the ASP.NET web app(s) in your solution that you are trying to debug. Hope this helps.


Go to project directory .vs/config/ and remove applicationhost.config . Then restart project.


Examples related to asp.net-mvc

Using Lato fonts in my css (@font-face) Better solution without exluding fields from Binding Vue.js get selected option on @change You must add a reference to assembly 'netstandard, Version=2.0.0.0 How to send json data in POST request using C# VS 2017 Metadata file '.dll could not be found The default XML namespace of the project must be the MSBuild XML namespace How to create roles in ASP.NET Core and assign them to users? The model item passed into the dictionary is of type .. but this dictionary requires a model item of type How to use npm with ASP.NET Core

Examples related to visual-studio-debugging

Visual Studio breakpoints not being hit ASP.NET MVC5/IIS Express unable to debug - Code Not Running SSL Connection / Connection Reset with IISExpress How do I start a program with arguments when debugging? Unable to start debugging on the web server. Could not start ASP.NET debugging VS 2010, II7, Win 7 x64

Examples related to iis-express

HTTP Error 500.30 - ANCM In-Process Start Failure localhost refused to connect Error in visual studio How to solve ERR_CONNECTION_REFUSED when trying to connect to localhost running IISExpress - Error 502 (Cannot debug from Visual Studio)? Process with an ID #### is not running in visual studio professional 2013 update 3 Unable to launch the IIS Express Web server, Failed to register URL, Access is denied Why and how to fix? IIS Express "The specified port is in use" How can I change IIS Express port for a site Authentication issue when debugging in VS2013 - iis express ASP.NET MVC5/IIS Express unable to debug - Code Not Running How to solve “Microsoft Visual Studio (VS)” error “Unable to connect to the configured development Web server”

Examples related to visual-studio-2013

Microsoft Advertising SDK doesn't deliverer ads Visual Studio 2013 error MS8020 Build tools v140 cannot be found Visual Studio 2013 Install Fails: Program Compatibility Mode is on (Windows 10) 'cannot find or open the pdb file' Visual Studio C++ 2013 Force uninstall of Visual Studio How to enable C# 6.0 feature in Visual Studio 2013? Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE] even if app appears to not be installed Process with an ID #### is not running in visual studio professional 2013 update 3 Error C1083: Cannot open include file: 'stdafx.h' The OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)"

Examples related to asp.net-mvc-5

'router-outlet' is not a known element The type or namespace name 'System' could not be found How to get 'System.Web.Http, Version=5.2.3.0? EntityType 'IdentityUserLogin' has no key defined. Define the key for this EntityType How to extend available properties of User.Identity How to implement oauth2 server in ASP.NET MVC 5 and WEB API 2 How to get JSON object from Razor Model object in javascript The model backing the 'ApplicationDbContext' context has changed since the database was created How can I implement a theme from bootswatch or wrapbootstrap in an MVC 5 project? MVC 5 Access Claims Identity User Data