Visual Studio is not debugging

Background

It was a very normal day of development for me. As we know that luck does not favors us always, so for me as well. I was doing some coding on my project and wanted to debug the code for one of the windows form. And suddenly Visual Studio stopped debugging when I wanted to step through the code.

Why with me?

This was my first reaction when you believe that you are doing everything right.

Problem

Next step was to identify the problem or issue which was causing this. No matter how many times I will build the solution, the problem was still persisted. And I was getting following error all day long.

“The breakpoint will not currently be hit. No symbols have been loaded for this document”

Error-While-Debugging

Error-While-Debugging

Following are the options that I have tried

  1. Deployed assembly to GAC manually
  2. Build to Solution for so many times
  3. Googled about the same and but no luck
  4. Following certain steps like adding some keys in app.config
  5. Trying some tricks in Visual Studio 2010 itself.

    Configuration-Manager

    Configuration-Manager

  6. Trying to change the options in Visual Studio for debugging.

    Debug-Options

    Debug-Options

But nothing helped at all.

So, finally I have decided to solve this on own. Worst thing that I thought of trying is creating an empty solution and adding all the projects and files manually. But then I didn’t panic that much 🙂

Solution

If all the options are not solving the problem then what exactly is the solution. You guys won’t believe it that the solution was so simple. Here it goes

    1. Stop the debugger
    2. Close the Visual Studio
    3. Close the Application
    4. Shift + Del all the files in the obj and bin folders
    5. Restart the Visual Studio
    6. Rebuild the project
    7. Debug now, it will work 100%!

      Conclusion

      By this way Visual Studio will create all the files which were present in the debug directory. This will create the necessary .pdb files again and your breakpoint(s) will surely hit 🙂

      Happy coding!!!

      Tagged with: ,