【发布时间】:2016-05-19 16:51:50
【问题描述】:
我在 VS2015 中创建了一个新的“ASP.NET Core Web 应用程序(.NET Core)”项目。它构建没有任何问题,所以我想给它一个测试运行。但是,在启动时,它会因以下错误而窒息并崩溃:
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() 方法期间损坏的。它是框架的一部分,所以我无法更进一步。
请注意,通过dotnet run 命令运行时程序运行良好。只有 IISExpress 不起作用。
我应该如何调试这个问题?
project.json 文件如下。 (它是由 Visual Studio 生成的,我没有更改任何内容。)
{
"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 版本创建了一个新项目,这次成功了。
【问题讨论】:
-
您查看过文档中的common errors area 吗?
-
我有同样的问题...删除 project.lock.json 并不能解决我的问题...在 VS 中根本没有用于 asp.net core rc2 的调试...没有好的。
-
从头开始...我没有 host.UseIISIntegration()。将其与删除 project.lock.json 结合起来,它就开始工作了。
标签: asp.net-core asp.net-core-mvc