Getting "The source file is different from when the module was built."

18,612

Solution 1

Just delete Obj file from application root and rebuild

Solution 2

If you are attaching to asp.net worker process, then kill the process, start up the website and reattach the debugger.

If you are using the built in web server, then make sure you stop the project and the WebDev.WebServer.Exe associated with it.

If all else fails, right click on the breakpoint and choose locations. Then enable the "allow code to be different..." check box at the bottom.

Solution 3

Delete the folder root under (4ex): C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root

And then in VS2005: Tools->Options->Debugging-> General and uncheck Require source file to exactly match the original version

This was the solution for me.

Share:
18,612
Admin
Author by

Admin

Updated on June 26, 2022

Comments

  • Admin
    Admin almost 2 years

    I'm trying to debug an ASP.Net web project that I received. I modified a class in the "Apps_LocalResources" folder.

    When I debug and the code tries to step into that class, I get

    "The source file is different from when the module was built.".

    I rebuilt the solution and didn't get any change. I even published it to a different location and the pdb and dll in the bin folder didn't change so I didn't copy them over.

    Ideas?

  • M463
    M463 almost 9 years
    By doing so, you only get rid of the warning, not the fact that your debugger will skip added lines, as the code file just doesn't match the assembly to debug.