Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"The breakpoint will not currently be hit. A copy of file was found in dll file, but the current source code is different"

I keep getting this error saying there's a copy of the .cs file hence the break point will not get hit.

I have tried cleaning solution, rebuilding , deleting the .pdb files in the obj and bin folders, closing VS and restarting it, restarting the whole machine (It's Windows! Sometimes the most complicated, unexplained problems get fixed like this :\ )

Any idea what else I can try? it's a .net project on VS2015

Breakpoint error

like image 497
Varda Elentári Avatar asked Jun 14 '16 20:06

Varda Elentári


People also ask

How do you fix the breakpoint will not currently be hit a copy of?

For this, simply open your "Solution Explorer", select your "Solution" and right click on it, Select "Clean Solution", once solution is cleaned, which will delete all the compiled and temporary files associated with a solution, select "Build" solution and then check if issue exists.

How do I Debug DLL files?

Debug from the DLL project Set breakpoints in the DLL project. Right-click the DLL project and choose Set as Startup Project. Make sure the Solutions Configuration field is set to Debug. Press F5, click the green Start arrow, or select Debug > Start Debugging.


4 Answers

I found the issue, it turns out IIS was configured to use a different copy of the project I had in my backup folder. It sounds pretty silly but I'll keep this question open if someone had something similar.

like image 119
Varda Elentári Avatar answered Oct 27 '22 02:10

Varda Elentári


Here are some things to look at:

  1. If you've recently changed namespacing or class names, an old version of the dll may be hanging around in the asp.net cache. Often deleting the files here and rebuilding will solve the issue.

c:\Users\yourname\AppData\Local\Temp\Temporary ASP.NET Files\

  1. Check your views to make sure your referencing the right class names.
like image 34
Dave Avatar answered Oct 27 '22 03:10

Dave


Check the physical directory the CS file is stored in, there may be two seperate files, and if not open the .csproj in a text editor (not VS). See if the file is referenced twice. If so, just delete one of the lines. If that doesn't work, you could always do what it says and set the breakpoint location :)

like image 36
TechnicalTophat Avatar answered Oct 27 '22 02:10

TechnicalTophat


IIS problem in my case, someone or some migration component changed the Physical Path of my web application (basic settings). Was not pointing to my solution on disk, but to another location with an older version of the app. Restoring the proper path, fixed it.

like image 42
gharel Avatar answered Oct 27 '22 03:10

gharel