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.
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”
Following are the options that I have tried
- Deployed assembly to GAC manually
- Build to Solution for so many times
- Googled about the same and but no luck
- Following certain steps like adding some keys in app.config
- Trying some tricks in Visual Studio 2010 itself.
- Trying to change the options in Visual Studio for debugging.
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 🙂
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
- Stop the debugger
- Close the Visual Studio
- Close the Application
- Shift + Del all the files in the obj and bin folders
- Restart the Visual Studio
- Rebuild the project
- Debug now, it will work 100%!
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 🙂