无法在IISExpress中启动ASP.NET Core RC2 Web应用程序

pai*_*yff 10 asp.net-core-mvc asp.net-core

我在VS2015中创建了一个新的"ASP.NET核心Web应用程序(.NET核心)"项目.它没有任何问题,所以我想给它一个测试运行.但是,启动时,它会因以下错误而被阻塞并崩溃:

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).
Run Code Online (Sandbox Code Playgroud)

我没有看到任何其他记录.我试过调试它,而我发现的是它WebHostBuilder.Run()Program课堂上的方法中崩溃了.它是框架的一部分,所以我无法进一步发展.

请注意,通过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%" ]
  }
}
Run Code Online (Sandbox Code Playgroud)

更新:我为Core RTM版本创建了一个新项目,这次它起作用了.

Ser*_*gan 8

另一个问题是您可能正在运行旧版本的框架.尝试转到project.jsonrunnable项目的root()位置并在Command Prompt类型中:

dotnet run
Run Code Online (Sandbox Code Playgroud)

  • 我有这个并改变了人们遇到问题的所有文件(我找到了很多参考文献).最后,就像这样愚蠢,当我将所有引用升级为使用1.1.0时,我没有在我的开发机器上安装实际的运行时1.1.0.谢谢! (3认同)

MDu*_*mmy 7

我遇到了和你一样的问题.对我来说解决方案是关闭VS2015,删除文件project.lock.json ,然后再次重启VS. (project.lock.json将自动生成)

看起来调试器无法附加到应用程序.在我的情况下,我throw new Exception("...");在函数的第一行添加了一个,public Startup(IHostingEnvironment env)并且应用程序刚刚死亡,并且没有按预期在未处理的异常上中断.

project.lock.json重建调试器再次工作正常.


pai*_*yff 4

我更新到了 dotnet core 的 RTM 版本,并使用新版本创建了一个新项目。我想这一定是一个错误。