In my case I had previously referenced a mylib
project in a sibling folder outside of the repo - let's call that v1.0
.
|-- myrepo
| |-- consoleApp
| |-- submodules
| |-- mylib (submoduled v2.0)
|-- mylib (stale v1.0)
Later I did it properly and used it via a git submodule - lets call that v2.0
.
One project consoleApp
however wasn't updated properly. It was still referencing the old v1.0
project outside of my git project.
Confusingly, even though the *.csproj
was plainly wrong and pointing to v1.0
, the Visual Studio IDE showed the path as the v2.0
project!
F12 to inspect the interface and class went to the v2.0
version too.
The assembly placed into the bin folder by the compiler was the v1.0
version, hence the headache.
That fact that the IDE was lying to me made it extra hard to realise the error.
Solution: Deleted project references from ConsoleApp
and readded them.
General Tip: Recompile all assemblies from scratch (where possible, can't for nuget packages of course) and check datetime stamps in bin\debug
folder. Any old dated assemblies are your problem.