"The breakpoint will not currently be hit" "The source code is different then the original version"

Today, I was debugging an ASP.NET website. I was at a breakpoint when a co-worker called me over to their desk to help with a defect they were trying to reproduce.

I needed to use remote desktop to look at something on my own machine, so I did so. While I was accessing it via remote desktop, my Visual Studio decided to crash.

Aftwerward I started seeing the following on breakpoints I was trying to hit:
"The breakpoint will not currently be hit. The source code is different then the original version"

I thought that a reboot would help, but to no avail.

After talking to another co-worker that had seen it in the past, he informed me that he fixed it by deleting all of the Temporary ASP.NET Files.

Sure enough, it worked like a champ. However, I had to shut down anything that had handles on those files (like the ASP.NET development server, Visual Studio, etc.) before I could complete the delete.

So to fix the problem:
  1. Close out Visual Studio and make sure any instances of ASP.NET development server are closed as well.
  2. Delete everything from "C:\Windows\Microsoft.NET\Framework\v.2.0.50727\Temporary ASP.NET Files" (where v.2.0.50727 is the version of the .NET Framework your site is running on.)

Hope this helps someone else... it sure helped me.


Jamison White said...

Thanks I needed this. Jamie

Jason said...

Where was this fix hours ago when I needed it? Thanks for the info, it fixed my issue with Visual Studio 2010, .net 4.0.

That One Guy said...

Awesome! I assume you had to change the delete path to the 4.0 framework folder instead of the 2.x?

Glad it helped you both...

Anonymous said...

That is a great help. Thanks a lot!

Alex Chetcuti said...

I know this is an old thread.. But would you have any more ideas how to get rid of this error.. i tried what you have suggested and also restarting the machine and deleting all pdb files.. but nothing seems to work

That One Guy said...

@Alex: Will you go into more detail on which version of Visual Studio and which version of the .NET Framework you are compiling against?

Anonymous said...

I started getting this error all of a sudden, new changes are not getting picked up. Using VS 2008 and 2.0 framework. Can only delete temporary files after rebooting. Cannot do that everytime.