C# – Getting “The source file is different from when the module was built.”

asp.netccompiler-constructionnet

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?

Best Answer

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.