Visual Studio 2017 v15.5 Aspnet Core 2.0.3 fails to debug on IISExpress

有些话、适合烂在心里 提交于 2019-12-10 15:18:47

问题


After I recently updated my visual studio 2017 installation from 15.4.5 to 15.5 I have lost the ability to hit breakpoints in my aspnet core 2.0 applications. The configuration is in debug any cpu.

While this works fine on kestrel (Debugging as a consoile app), on IISExpress it does not hit my breakpoints.

As a sidenote the weird thing here is it seems to have the debug symbols loaded on runtime (the breakpoint is correctly highlighted) and no warning.

Environment:

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.16299
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\2.1.2\

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.3
  Build    : a9190d4a75f4a982ae4b4fa8d1a24526566c69df

Microsoft Visual Studio Enterprise 2017

  Version  : 15.5.0

I have already tried to repair visual studio but the problem persists


回答1:


After careful inspection of my last commit after I updated to 15.5 I noticed that I had an unintentional change to my launchSettings.json file located under my project Properties folder. There was a new use64bit setting added and was set by vs to true.

I had to set it to false in order for visualstudio to work with debugging on iisexpress. Below is my current state of the IIS Express profile in launchSettings.json

{
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:20202",
      "sslPort": 0
    }
  },
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "use64Bit": false
    }
}


来源:https://stackoverflow.com/questions/47699101/visual-studio-2017-v15-5-aspnet-core-2-0-3-fails-to-debug-on-iisexpress

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!