Search code examples
asp.netdebuggingiis-expressvisual-studio-debugging

No symbols when attaching debugger to manually launched IISExpress instance


I've got a scenario where I want to launch a locally hosted service via IISExpress through the command line, and then debug it with Visual Studio. The problem comes when I attach a debugger to the IISExpress process, however, as it doesn't appear to be loading the symbols from my service's components.

The service is operational. I added some traces to verify that my local components are being run by the service. I just can't hit a break point.

Some information about my situation:

  • This is with Visual Studio 2015.
  • I'm using the /path option from IISExpress.exe, launching with minimum configuration possible.
  • This is an ASP.NET Web Api application.
  • Sometimes when the debugger attaches it shows the underlying dependencies (my assemblies), but I'm unable to load symbols from them as VS doesn't recognize the .pdb's I have on disc for them.
  • I found the application.config files for both my service and a service that was set up by Visual Studio. The files are configured differently, but they don't appear to be meaningfully different.
  • Most of the service's components are release builds and are deployed without symbols. One assembly is a debug build and does contain symbols.
  • The compilation tag's debug attribute seemed to have no effect on my ability to debug.

The idea here is to be able to pull a build from our build pipeline with a testing tool and load components from a local development project.


Solution

  • I discovered the problem after taking a closer look at the Debug -> Processes panel. It turns out that when IISExpress was initially being launched it was selecting the Native debugger by default instead of the Managed (4.6, 4.5, 4.0) debugger.

    I installed and used EnvDTE80 to elect for which debugging engine I would like to attach with and everything worked like a charm!