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

后端 未结 12 2945
名媛妹妹
名媛妹妹 2021-02-19 13:06

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

相关标签:
12条回答
  • 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.

    0 讨论(0)
  • 2021-02-19 13:48

    Despite the fact that my current project configuration was set to Debug, it seemed that it has been compiling as a Release one.

    I removed (deleted) Web.Release.config from my project, recompiled solution, and then put Web.Release.config back.

    Now everything works just fine. What a bizarre behavior, eh. :)

    0 讨论(0)
  • 2021-02-19 13:50

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

    0 讨论(0)
  • 2021-02-19 13:55

    Incase someone is having the same issue, go to iis, then application pools on the left then select your application pool then on the right click on View Applications. Now under physical path you will be able to see the physical path to which your virtual path is mapped to, so make sure the physical path is pointing to the right folder and if incase it is not pointing to the right folder then remove your application from the app pool and add it again

    0 讨论(0)
  • 2021-02-19 13:55

    This happens to a debugging project when you try copying successfully built project from root(project's root) folder and saving the copy of same in "Project" folder of your respective Visual Studio.

    When you do the above step, Visual Studio debugging location sometimes keep referencing to the built DLLs in the copy/back-up folder.

    The same can be changed BY ONE OF THE METHODS written here.

    But if you are using Visual Studio's built-in IIS-EXPRESS, then you need to navigate to project properties "Properties|alt+enter" => "Web" => In Servers Section, select IIS Express => For current Project URL, click "Create Virtual Directory".

    This will warn you that the current Project Url is referred by some other Project Location(Your Copy|back-up Folder), Confirm your selection for the dialog box, and there you are, as HITTING your breakpoints again.

    0 讨论(0)
  • 2021-02-19 13:57

    I had the same trouble and decided it by deleting attribute [System.Diagnostics.DebuggerStepThroughAttribute()] on the class.

    0 讨论(0)
提交回复
热议问题