asp.net核心 – 无法在IISExpress中启动ASP.NET Core RC2 Web应用程序

前端之家收集整理的这篇文章主要介绍了asp.net核心 – 无法在IISExpress中启动ASP.NET Core RC2 Web应用程序前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我在VS2015中创建了一个新的“ASP.NET核心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).

我没有看到任何其他记录.我尝试调试它,我发现所有的是在程序类中的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发布了一个新项目,这一次它工作.

解决方法

我和你有同样的问题.对我来说,解决方法关闭VS2015,删除文件project.lock.json,然后重新启动VS. (project.lock.json将自动生成)

看起来调试器无法附加到应用程序.在我的情况下,我添加了一个新的异常(“…”);在公共Startup(IHostingEnvironment env)的功能的第一行,应用程序刚刚死机,并且不会按预期中断未处理的异常.

在project.lock.json重建之后,调试器再次工作正常.

原文链接:https://www.f2er.com/netcore/246438.html

猜你在找的.NET Core相关文章