Search code examples
visual-studiodebuggingbreakpoints

Strange! VS 2005 -Break Point is not being hit


I am using Visual Studio 2005.I am running my code in Debug mode only.But my break point is not being hit.

I followed :


  1. Cleared my solution and created the one again
  2. Closed the VS and Opened it again
  3. Restarted my PC and tested the break point

But i am unable to figure out the problem.

My Question is:


  1. Is it due to any virus ?
  2. Add-on feature in my IE 8.0 prevents this
  3. My VS is Corrupted ?
  4. I am having botn VS 2008 and VS 2005 installed in my machine so any version conflicts?

Suggestion is needed.


Solution

  • It sounds like the problem you are having may be due to the source code and the .pdb files being out of sync with each other.

    Try these steps:

    1. Perform a "Clean" build in Visual Studio.
    2. Shut down Visual Studio.
    3. Delete any "bin" and "obj" folders in all of your project folders.
    4. Delete the solution .suo file

    Sometimes the solution .suo file can become corrupt (doesn't cause Visual Studio to indicate any errors, but usually leads to strange behavior). Nine out of ten times, deleting the .suo file clears any strange behavior in Visual Studio.

    The trick about deleting the "obj" folders forces Visual Studio to truely do a clean build the next time it compiles. Doing a "clean" build in Visual Studio only deletes the compiled binary results, it doesn't remove any intermediate object files that may have been created that Visual Studio might be linking against. By manually deleting the "obj" folders, you delete those cached object files and force a true rebuild.