I know these questions have been around for some time, but the solution for my specific problem is not on any answer I have found so far.
The problem is a well-known error, at compile time the namespace error or the could not load assembly an runtime on a web site.
My web site is a DotNetNuke installation (7.4.2), I had a dev environment with some working project (Proj A) and I needed to add another module (Proj B) to make some maintenance.
After adding the complementary projects and module of Proj B I start having these two errors.
Specific on a DNN page (Toggle) with javascript libraries at compile time and with sapncon at runtime.
The reference to the corresponding DLL was ok.
The Problem: My Proj B was using a previous version of DNN and I was using the DotNetNuke.dll in one of the complementary and it was an older version.
VS was replacing the bin/DotNetNuke.dll with the older version of my Proj B
Same problem with sapncon.dll
Solution:
Update on the complementary projects the DLL to the newest versions used by the DNN installation and adding the references to the website to reassign the correct dll's.
Hope this can help others.