I created a new "ASP.NET Core Web Application (.NET Core)" project in VS2015. It built without any issues, so I thought to give it a test run. However, when starting up, it choked and crashed with the following error:
Exception thrown: 'System.AggregateException' in Microsoft.AspNetCore.Server.Kestrel.dll
The program '[11608] dotnet.exe' has exited with code -1073741819 (0xc0000005) 'Access violation'.
The program '[15048] iisexpress.exe' has exited with code 0 (0x0).
I don't see anything else logged. I tried debugging it, and all I found out was that it broke during the WebHostBuilder.Run()
method in Program
class. It is part of the framework, so I wasn't able to get much further.
Note that the program runs fine when running via dotnet run
command. Only IISExpress does not work.
How should I go about debugging this issue?
The project.json file is below. (It was generated by Visual Studio, I did not change anything.)
{
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0-rc2-3002702",
"type": "platform"
},
"Microsoft.AspNetCore.Diagnostics": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-preview1-final",
"type": "build"
},
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final",
"Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-final",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-final",
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-rc2-final"
},
"tools": {
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-preview1-final",
"imports": "portable-net45+win8+dnxcore50"
},
"Microsoft.AspNetCore.Server.IISIntegration.Tools": {
"version": "1.0.0-preview1-final",
"imports": "portable-net45+win8+dnxcore50"
}
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"dnxcore50",
"portable-net45+win8"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"gcServer": true
},
"publishOptions": {
"include": [
"wwwroot",
"Views",
"appsettings.json",
"web.config"
]
},
"scripts": {
"prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ],
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
Update: I created a new project for the Core RTM release, and this time it worked.
The other issue is that you might be running an old version of the framework. Try going to the root (project.json
) location of your runnable project and in a Command Prompt
type:
dotnet run
I had the same problem as you. For me the solution was to close VS2015, delete the file project.lock.json
and then restart VS again. (project.lock.json
will be generated automatically)
It looks like the debugger cannot attach to the application. In my case I added a throw new Exception("...");
in the first line of the function public Startup(IHostingEnvironment env)
and the application just dies and doesn't break on the unhandled exception as expected.
After project.lock.json
was rebuilt the debugger works fine again.
I updated to the RTM release of dotnet core and creating a new project using the new version worked. I guess it must be a bug.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With