visual-studio-2015 - .NET Core Web App 不会因异常而中断,并且异常中没有详细信息

标签 visual-studio-2015 asp.net-core

我有一个新的 .NET Core 1.0 项目,由于某种未知原因,它在调试时已停止(或从未停止,我不记得)中断。

我在这里添加了 StackTrace 包:How can I get the line number and file name from an exception in net Core?

但没有成功。

我正在使用 VS2015 社区和那里的标准工具。

我的 project.json 中可能相关的片段文件:

  "buildOptions": {
    "emitEntryPoint": true,
    "preserveCompilationContext": true,
    "define": [ "DEBUG", "TRACE" ]
  },
  "runtimes": {
    "win10-x64": {}
  },
  "runtimeOptions": {
    "configProperties": {
      "System.GC.Server": true
    }
  },

更新

好的,如果您从一个新的核心 Web 应用程序开始,一切都会按预期进行。

如果您随后更新所有软件包,则在您添加以下内容之前,它将无法构建:
"runtimes": {
    "win10-x64": {},
    "win81-x64": {},
    "win8-x64": {},
    "win7-x64": {},
    "win10-x86": {},
    "win81-x86": {},
    "win8-x86": {},
    "win7-x86": {}
  },

project.json让它构建和启动。

通过这样做,我现在可以获得行号但仍然没有中断。我的新测试项目按预期工作。我将不得不经历并看到差异。

最佳答案

似乎以某种方式未检查异常详细信息。

我重置了所有 project.json依赖,这意味着我在错误页面上收到了详细的异常,但是 VS 仍然没有中断。

通过检查以下内容:

Exception details window

它现在工作正常。我不知道这是否有点矫枉过正,如果它是特定于 CORE 的,或者是每个项目的,还是 VS 中的某些内容(假设一个新的 CORE 项目确实中断了,它让我认为它是每个项目的)。

关于visual-studio-2015 - .NET Core Web App 不会因异常而中断,并且异常中没有详细信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40551485/

相关文章:

visual-studio-2015 - 使用工具预览 1 Visual Studio 2015 for ESlint

asp.net-core - 在 ASP.NET Core 中使用 Entity Framework 6

.NET Core 3.1 中使用 Fetch API 的 Ajax 调用

c - Visual Studio 2015 WDK 不工作

c# - "Visual Studio requires a newer version of Windows to display this content."

c++ - 我可以将 Visual Studio 2015 C++ Redistributable DLL 与我的应用程序捆绑在一起吗?

c# - 生成资源任务失败错误

asp.net - 可以通过VS2015在IIS中调试/运行ASPNET5应用程序

c# - 如何在 ASP.NET Core 中的 API 调用中接收 json 值

asp.net-core - 无法解析类型 'Microsoft.EntityFrameworkCore.DbContextOptionsBuilder` 的服务