17

Breakpoints are not being hit when debugging our DNX projects referenced in a ASP.NET 5 API project hosted with Kestrel (all in the same solution and in the src folder). Debugging with IIS Express works fine.

What troubleshooting steps can be taken to solve this problem?

No binaries or PDBs are created with DNX projects when debugging, so I am very unsure as to where to start.

project.json commands:

"commands": {
  "web": "Microsoft.AspNet.Server.Kestrel"
},

Project properties:

Project properties

Note: Using the RC1 1.0.0-rc1-final libraries in all projects.

EDIT:

  • Breakpoints in the Startup.cs project are hit just fine, but not in other projects.
  • I have double checked and reinstalled the 1.0.0-rc1-update1 DNX runtime. I have uninstalled all other runtimes.
  • I have confirmed that PATH reflects the DNX runtime correctly.
  • I have deleted all project.lock.json files and DNU restored.
  • The actual breakpoint pin is red and doesn't indicate that there should be any problem.
  • global.json is using the correct runtime:

    {
      "projects": [ "src", "test", "." ],
      "sdk": {
          "version": "1.0.0-rc1-update1",
          "runtime": "clr",
          "architecture": "x86"
      }
    }
    

EDIT 2:

In the Modules window, I can see that the projects' symbols aren't loading:

Modules

How can I fix this?

EDIT 3:

I found that this problem only occurs when running multiple startup projects at the same time. When running a single project, debugging works just fine in all projects within the solution.

enter image description here

I have no idea how to fix this and why it is happening.

Dave New
  • 38,496
  • 59
  • 215
  • 394
  • Have you tried running your application via console command (dnx web)? Try to start your app in that way and then attach to process called dnx – Marcin Zablocki Jan 04 '16 at 13:30
  • @MarcinZablocki: Yes, the breakpoint isn't hit either. – Dave New Jan 05 '16 at 12:36
  • But is the breakpoint colored red (indicates that it will be hit) ? – Marcin Zablocki Jan 05 '16 at 12:48
  • @MarcinZablocki: Yes, it is red. I have updated the question with other things I have checked/done. – Dave New Jan 05 '16 at 14:06
  • See the modules and check if symbols are loaded. PDBs and DLLs are not created since the code is compiled on the fly and assemblies along with PDBs are loaded from streams from memory instead of files. As a last resort publish your app using Debug configuration which I think would create dlls and pdbs then you can run it using `dnx --debug web` which will allow you to attach to the process... – Pawel Jan 06 '16 at 05:25
  • @Pawel: The symbol state for these projects is "Cannot find or open the PDB file." See my second EDIT in the question. – Dave New Jan 06 '16 at 09:39
  • What code you want to debug? You hid the names of dlls but as you can see they are marked as not user code and they are not built dynamically. Are you trying to debug Kestrel itself and the rest of aspnet? If this is the case you may want to add a project to your global.json file – Pawel Jan 06 '16 at 17:03
  • These are dnx projects in the solution; class libraries used by the web project essentially. They are user code. – Dave New Jan 06 '16 at 19:48
  • 1
    * Check if there is a `artifacts` directory somewhere in the directory structure and remove it. * try to start from scratch and create two new projects with one referencing the other and check if you can debug correctly - this way you can verify if there is something wrong with your projects or the whole environment. – qbik Jan 08 '16 at 09:29
  • 1
    Have the exact same issue using Visual Studio 2015 - Update 1. Tried everything that has been suggested here to no avail. – Kyle Jan 12 '16 at 12:39
  • 2
    This problem only occurs when running multiple startup projects. See my edit. – Dave New Jan 12 '16 at 12:59
  • Removing "artifacts" directory and restarting helped (Visual Studio 2015 Update 2) – Andrei Drynov Apr 28 '16 at 15:36

2 Answers2

1

I filed this issue on the aspnet/Tooling GitHub repository. Consensus is that this is a bug and will only be fixed with the Visual Studio 2015 Update 2 release.

An interim solution is to use a separate instance of VS for each process.

See issue here.

Dave New
  • 38,496
  • 59
  • 215
  • 394
0

I have exactly same issue spend whole day and still no avail. I re-created project however it is strange enough that debug hit controller class for MVC Core in first debug after project created but not after that only main class i.e. startup.cs is hit breaking point everytime

K.Z
  • 5,201
  • 25
  • 104
  • 240