The Source File Is Different from When the Module Was Built

Getting 'The source file is different from when the module was built.' when I just built it

Are you using iis or the integrated web dev server? Just guessing here, but your web server might Be still using an old copy of your dll, so try restarting it after you rebuild your projects.

I dont have access to VS at the moment, but if I recall correctly, when you hit the run button in vs the output window contains the path to all loaded dlls. Check there to see if you are indeed loading the correct module.

Hope this helps

Edit: also, remember to copy the pdb file! Since you are referencing a dll, it is very likely that the pdb file for that dll in the bin folder is out of sync with the version you just built.

How can I prevent the source file is different from when the module was built when using Resharper

Goto:

Tools -> Options -> Text Editor -> C# -> General -> Uncheck Apply Cut or Copy commands to blank lines when there is no selection

Source file is different to th one that was built - looking in a completely separate directory?

I realised that the way the project was built, was because it was actually a plugin, not actually directly part of the original program.

So while the project was being built correctly, the Main project was actually referring to a .dll of the reference project, that was much older (2016), and that was what was being referred to.

So after replacing the appropriate files (.dll and .pdb) of the reference project, the program recognised the relevant file(s), which solved the problem.

How to explain Visual Studio that my source code is in another directory?

In the meantime I've found the answer: in Tools, Options, Debugging, General, there's a setting "Require source files to exactly match the original version". By accident, this has been unchecked. Checking it back again solves my issue: now Visual Studio is showing the openfile dialogbox again. For reference purposes, I'll put here the text of the openfile dialogbox:

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

Would you like the debugger to use it anyway?



Related Topics



Leave a reply



Submit