I\'m trying to compile my excel addin using C# 4.0, and started to get this problem when building my project in Visual Studio. It\'s important to tell you that I haven\'t had th
Adding my solution for this issue for anyone it might help.
I had a ClickOnce solution throwing this error. The app referenced a common "Libs" folder and contained a project reference to a Foo.dll
. While none of the projects in the solution referenced the static copy of the Foo.dll
in the "Libs" folder, some of the references in that folder did (ie: my solution had refs to Libs\Bar.dll
which referenced Foo.dll
.) Since the CO app pulled all the dependencies from Libs
as well as their dependencies, both copies were going into the project. This was generating the error above.
I fixed the problem by moving my Libs\Foo.dll
static version into a subfolder, Libs\Fix\Foo.dll
. This change made the ClickOnce app use only the project version of the DLL and the error disappeared.