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
Access Form Component from Another Class
Why Re-Initiate the Dbcontext When Using the Entity Framework
Complex Models and Partial Views - Model Binding Issue in ASP.NET MVC 3
If My Interface Must Return Task How to Have a No-Operation Implementation
Find() VS. Where().Firstordefault()
Validating for Large Files Upon Upload
How to Add an Ampersand for a Value in a ASP.NET/C# App Config File Value
.Net (Dotnet) Wrappers for Opencv
Entity Framework - Invalid Column Name '*_Id"
What to Use: Var or Object Name Type
Visual Studio 2013 Doesn't Discover Unit Tests
How to Create an Expression Tree Calling Ienumerable<Tsource>.Any(...)
Memorycache Does Not Obey Memory Limits in Configuration
Read Appsettings JSON Values in .Net Core Test Project
How to Connect to a Usb Webcam in .Net
How to Convert a Datetime to the Number of Seconds Since 1970