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

16,511

Solution 1

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.

Solution 2

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.

Solution 3

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.

Solution 4

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 :)

Share:
16,511

Related videos on Youtube

Varda Elentári
Author by

Varda Elentári

Updated on September 16, 2022

Comments

  • Varda Elentári
    Varda Elentári over 1 year

    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

  • Arek
    Arek about 6 years
    Had a very similar issue. Restarting VS helped.
  • Javier Sanchez
    Javier Sanchez over 5 years
    if you are running a web project, go to the project settings / web / Under Servers, click the button Create Virtual Directory, this will remap the folder and get the proper source files...
  • Grengas
    Grengas over 5 years
    In my case these files were here: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files