问题描述
我在VS2015中创建了一个新的"ASP.NET Core Web应用程序(.NET Core)"项目.它的构建没有任何问题,因此我想对其进行测试.但是,在启动时,它因以下错误而cho死并崩溃:
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).
我没有看到其他记录.我尝试对其进行调试,结果发现它在Program
类的WebHostBuilder.Run()
方法期间损坏了.它是框架的一部分,所以我无法进一步了解.
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.
请注意,通过dotnet run
命令运行时,程序运行良好.仅IISExpress不起作用.
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?
project.json文件在下面. (它是由Visual Studio生成的,我没有进行任何更改.)
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%" ]
}
}
更新:我为Core RTM版本创建了一个新项目,这次可以正常工作.
Update: I created a new project for the Core RTM release, and this time it worked.
推荐答案
我已更新到dotnet core的RTM版本,并使用新版本创建了一个新项目.我想这一定是个错误.
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.
这篇关于无法在IISExpress中启动ASP.NET Core RC2 Web应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!