Search code examples
visual-studio-2012iis-7.5breakpointsiis-express

VS 2012 Breakpoint Issues


I have run into an issue with VS 2012 not hitting breakpoints during the seeding process of my DB. I am on Svr 2008 R2 using EF 5. This is similar to this breakpoint issue, but not quite the same. Once I get past the seeding process my breakpoints work fine in the controllers (and I assume everywhere else).

I can get the breakpoints to work with IIS Express, but not IIS 7. Since the breakpoints that I would like to hit are in the Application_Start and the Seed process I do not have time to Ctrl-Alt-P to attach a process and attempt debugging that way. I did check windows authentication and registration of iis, those did not affect the breakpoints.

I can verify that the seeding is run with logging and how the DB is created. I would prefer not to revert to the dark ages of debugging with logs though. I would also prefer not to be required to switch back and forth between IIS Express and IIS 7.

To recreate this I started a new VS 2012 proj selected MVC4 and Internet Application. I manually changed the web.config to point to SQLEXPRESS. Then I changed the project properties > web to not use IIS Express. I created a breakpoint in the Application_Start and and a breakpoint in the homecontroller/index and ran the project. The only breakpoint that was hit was the index breakpoint. Rechecking the IIS Express allows both breakpoints to be hit.

Please let me know if you have seen this issue and have a workaround. Thanks, TJ


Solution

  • I seem to be running into lots of these types of issues lately. I clear ways to replicate them, and I leave them alone for a few days and they disappear. I am unable to recreate this anymore. I even used the same project that I was only changing the checkbox to use IIS Express.

    So, when in doubt, don't pull out your hair, work on something else and be patient. Who knows, perhaps turning it off and on again worked (even though I did try that, thanks Roy).