0

I have two separate class libraries: A and B.

Each class library references a third party library (Mapsui), but A references a different version than B. I have exported the third party library DLLs to two separate folders, one for each version. At runtime in my main WPF project, I attempt to load in each class library as a plugin.

B works as expected since it references the newer version of the third party library but attempting to load A crashes with a MethodNotFound exception. The newer version of the third party library no longer contains the method that I call in class library A, which is why I get this error.

I have attempted everything mentioned in a similar thread (Using multiple versions of the same DLL) and have been unable to avoid this exception.

I am wondering if there is anyway for my class library to essentially hide it's internal references from my main project that loads it so that I don't run into issues with DLLs and namespaces having the same names but different versions.

How could I go about solving this problem?

D M
  • 5,769
  • 4
  • 12
  • 27
jp3434
  • 49
  • 7
  • 1
    If the [AppDomain](https://stackoverflow.com/a/5916866/14956277) and [project structure](https://stackoverflow.com/a/50262213/14956277) based answers did not work for you, please provide more information about your project and its structure. Some good examples would be your linked assemblies, build configuration, file structure, etc... – D M Jul 08 '21 at 18:50
  • Here's another helpful HowTo concerning this problem: https://www.learningsomethingnew.com/how-to-use-two-versions-of-the-same-dll-in-the-same-project – lidqy Jul 08 '21 at 20:17
  • https://stackoverflow.com/questions/37315589/is-it-possible-to-reference-different-version-of-the-same-assembly-into-a-single – mm8 Jul 09 '21 at 08:15

0 Answers0