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

后端 未结 12 2949
名媛妹妹
名媛妹妹 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条回答
  •  离开以前
    2021-02-19 13:41

    This is for those who have attempted all of the above approaches and still in search for the solution. I had similar problem, not matter what ever I do, I couldn't hit the break point. Finally, what I realized is the dll I am referring to is not the same one which IIS (root web.config) is using. The dll is installed in the GAC(Global Assembly cache) and that's the reason the debugger never hits and we see this kind of warnings. Follow these steps to resolve it:

    1. Find out the reference in GAC, at "C:\Windows\Microsoft.NET\assembly\GAC_MSIL\YOUR DLL" and delete it. And install the newly modified dll, the command for installing is "gacutil -i YOURDLLWITHCOMPLETEPATH"
    2. Make sure you add the same dll in IIS root web.config location. (I was using customhttpmodule). In my case it was "C:\inetpub\wwwroot\WEBSITENAME\bin"
    3. Delete the temporary folder located at "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files"
    4. IISRESET

    It worked for me, hope it works for you as well.

提交回复
热议问题