Mvc: ASP.NET Core Web Application exits instantly upon debugging

Created on 7 Mar 2017  路  8Comments  路  Source: aspnet/Mvc

As of Visual Studio 2017, creating a new ASP.NET Core 1.1 Web Application and debugging it causes dotnet.exe to instantly terminate. This means that I'm unable to debug any and all ASP.NET Core web applications I'm developing locally, on two of my machines, with fresh installs of Visual Studio and with the most recent version of the tooling.

Visual Studio's output dialog shows the following:

'dotnet.exe' (CoreCLR: DefaultDomain): Loaded 'C:Program FilesdotnetsharedMicrosoft.NETCore.App1.1.1System.Private.CoreLib.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'dotnet.exe' (CoreCLR: clrhost):
Loaded 'Z:AspCrashReproWebAppWebAppbinDebugnetcoreapp1.1WebApp.dll'. Symbols loaded.
The program '[16268] dotnet.exe' has exited with code -532462766 (0xe0434352).
The program '[14484] chrome.exe: WebKit' has exited with code -1 (0xffffffff).
The program '[17392] iisexpress.exe' has exited with code 0 (0x0).

No user code is loaded, indicating to me that the AspNetCoreModule isn't even being loaded properly?

I've checked the Event Log, and it shows the following under the IIS Express AspNetCore Module:

Application 'MACHINE/WEBROOT/APPHOST/WEBAPP' with physical root 'Z:AspCrashReproWebAppWebApp' failed to start process with commandline '"C:Program Files (x86)Microsoft Visual Studio2017ProfessionalCommon7IDEExtensionsMicrosoftWeb ToolsProjectSystemVSIISExeLauncher.exe" -debug -p "C:Program Filesdotnetdotnet.exe" -a "exec "Z:AspCrashReproWebAppWebAppbinDebugnetcoreapp1.1WebApp.dll"" -pidFile "C:UsersVideaAppDataLocalTemptmp946.tmp" -wd "Z:AspCrashReproWebAppWebApp"', ErrorCode = '0x80004005 : 0.

The following code reproduces this crash on two of my systems: https://github.com/aevitas/AspCoreCrashRepro

Both are running Windows 10 x64. DxDiag:


System Information

  Time of this report: 3/7/2017, 22:06:19
         Machine name: ORION
           Machine Id: {CD391266-DDEE-4479-A97C-EF5ABF99E8B1}
     Operating System: Windows 10 Pro 64-bit (10.0, Build 14393) (14393.rs1_release.161220-1747)
             Language: English (Regional Setting: English)
  System Manufacturer: System manufacturer
         System Model: System Product Name
                 BIOS: BIOS Date: 03/26/12 16:09:56 Ver: 09.06
            Processor: Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz (8 CPUs), ~3.5GHz
               Memory: 16384MB RAM
  Available OS Memory: 16270MB RAM
            Page File: 6209MB used, 13261MB available
          Windows Dir: C:\WINDOWS
      DirectX Version: DirectX 12
  DX Setup Parameters: Not found
     User DPI Setting: Using System DPI
   System DPI Setting: 96 DPI (100 percent)
      DWM DPI Scaling: Disabled
             Miracast: Available, with HDCP

Using Docker as a temporary workaround doesn't work either for me, prompting a dialog indicating "Error while trying to enter break state.". Could be related, but I'm not completely sold on that yet.

I can provide more information upon request, though this renders the current release of Visual Studio and .NET Core web apps completely useless to me, I hope there is a workaround or a quick fix available for this problem.

Edit: This issue does not appear to be present when creating a new Web Application using Visual Studio 2015 and the legacy tooling, and upgrading it to the new format using VS17's upgrade wizard.

Thanks!

Most helpful comment

I'm also having this same issue. Cleaning the NuGet folder and rebuilding the project didn't solve

All 8 comments

I installed 2017, downloaded your repo and it compiled and debugged as expected. No errors while debugging and hit breakpoints as normal. I am on the same build of windows 10 and my system specs are almost identical.

@GarageWeb Interesting. I've had a coworker of mine run the code and it didn't crash on his machine either, but it does on both of mine.

I've narrowed it down to a FileLoadException on System.Runtime:

Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'System.Runtime, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

And further narrowed it down to the BrowserLink component, removing the call to app.UseBrowserLink(); in Startup.cs and the respective NuGet package does allow the application to run properly, be it without browser link.

This appears to be caused by an incorrect package in the NuGet cache. After deleting the folder C:\Users\%user%\AppData\Local\NuGet and re-building the project, it now runs fine.

Glad it worked out. I have had the cache issue in the past as well. Good luck with your project.

I'm also having this same issue. Cleaning the NuGet folder and rebuilding the project didn't solve

I am having this issue in my Visual Studio 2015

Just for future reference:

I had a similar / the same issue when going from Microsoft.AspNetCore.All V2.1.0 to V2.1.1 today. Going back to V2.1.0 makes it work again. Same issue when I go to V2.1.2.

I updated VS2017 to latest version which did not help.
But then updating to the latest NETCore SDK V2.1.302 (which includes the aspnetcore runtime 2.1.2 fixed the issue.
--> The root cause was that the Nuget Package I updated to was newer as the runtime that was installed via the sdk. And that resulted in that issue.
The only real problem is that we do not get any clear error message.

@turtletramp solved my issues ..thanks !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bugproof picture bugproof  路  3Comments

saf-itpro picture saf-itpro  路  3Comments

kspearrin picture kspearrin  路  4Comments

DamianEdwards picture DamianEdwards  路  3Comments

workmonitored picture workmonitored  路  3Comments