Visual Studio 2012 won't let me debug

44,163

Solution 1

I've encountered this before. Not sure what causes it, but generally it is one of a couple of things to fix it.

  1. make sure you are building in debug and not release
  2. close VS, go to the project's dir and delete the obj and bin directories. Reopen in VS and rebuild.
  3. there is an option under tools - options - build (iirc) that allows for checking if source is same as code file. However, you should see a message in output window if this is the case.
  4. on the project properties in the build (iirc) you can throttle the pdb file from full debug symbols to no pdb at all. If you are not the only person on the project check this setting still has full pdb enabled (low probability this got changed though)
  5. make sure you're on the right platform that you are building to (x64 vs x32)

...lots more, but a starting place...

Addendum as per comment...

So, those messages are good. It is saying there are no problems (but it sounds like you already know that :) ). I would start with the general debug options you mention. Do this on a hello world app. That way you can troubleshoot the lowest common first. Here are my settings. Try to match them and see if that works. For example, I know "ask before deleting breakpoint" is irrelevant, but "break all processes when one process breaks" is important. So, I just added them all to make it easier to troubleshoot.

Tools > Options > Debugging

Tools > Options > Debugging

ALso, make sure you are getting a red dot here like so in your code in visual studio (I've seen instances where VS won't let you put this here):

Debug Hello World

Solution 2

  1. Right click on the project
  2. Click on the properties.
  3. go to web.
  4. Check the Box for Enable Edit and Continue .

Hope that helps :)

Share:
44,163
will
Author by

will

Updated on July 23, 2022

Comments

  • will
    will almost 2 years

    I can't seem to be able to debug. When I try to, I don't get any build errors, and the layout changes to debug mode, but the windows never pops up. I have an orange bar at the bottom of VS, which I think is standard, but nothing happens after that. It's not just in the project I'm working on. I have started a new WFA and tried to debug without adding any code and the same thing happens. Anybody have similar issues?

  • Sam
    Sam about 11 years
    Likewise, deleting obj and bin is what fixes it for me.
  • will
    will about 11 years
    OK. Here is what the output window says: The thread 'vshost.LoadReference' (0x1e58) has exited with code 0 (0x0). 'CrochetAuLait2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Users\Admin\documents\visual studio 2012\Projects\CrochetAuLait2\CrochetAuLait2\bin\Debug\Croche‌​tAuLait2.exe', Symbols loaded. I tried deleting the obj and bin directories, but the same issue arose. I am in debug, and on the same x32 laptop that I wrote it on. Also, this morning I wrote a hello world console app, and it had the same problem. That's why I think it must be some universal setting in VS.
  • Hernaldo Gonzalez
    Hernaldo Gonzalez almost 10 years
    Master! Delete bin and obj folders works for me! Thanks
  • Wai Ha Lee
    Wai Ha Lee over 8 years
    Can you elaborate on your answer?