Tuesday, August 9, 2011

The breakpoint will not currently be hit. The source code is different from the original version.

This was an old error which I was receiving when building an application. At that time I had not started this blog and therefore I hadn't took screen shot of the error. But I had posted this error on forums to get help from others. Here is more detail about the error and solution which worked for me.

I was getting this error in Visual Studio 2005 when starting the debugging (running) a project:


The breakpoint will not currently be hit. The source code is different from the original version.

Because of this error I wasn't able to edit the source code while the application was running in debugging mode.

Solution
I tried almost everything suggested at :
http://social.msdn.microsoft.com/Forums/en/vsdebug/thread/2fd70297-f079-493f-847c-f89198e4eb58
And also looked and tried other threads on the above site and other forums, but at last solved it by manually removing the files in debug directory and then also removing the solution's .SUO file.

I have windows 7 64-bit with Visual Studio 2005, and my project was containing Crystal Reports. I had to set the target CPU type to x86 from solution property and from project property for Crystal Reports to work.

The problem could have been occurred because of target CPU type and/or opening (just opening, not edited) the .SUO file in Notepad to solve the Crystal Reports problem. I had to set the CPU type to x86 because my OS is x64 and Visual Studio will, I think, create an x64 exe, but the Crystal Reports installed on my computer is not for x64 and thus while compiling/running the project, a runtime error regarding Crystal Reports was generated