加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

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

发布时间:2020-12-15 19:31:48 所属栏目:asp.Net 来源:网络整理
导读:我在VS2015中创建了一个新的“ASP.NET核心Web应用程序(.NET Core)”项目.它建立没有任何问题,所以我想给它一个测试运行.但是,当启动时,它会阻塞并崩溃,并显示以下错误: Exception thrown: 'System.AggregateException' in Microsoft.AspNetCore.Server.Kest
我在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重建之后,调试器再次工作正常.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读