2

As the title says, is there any MEF equivalent for .NET Framework 3.5?

I'm doing something that requires code to be in .NET Framework 3.5, and I'd like to have a plugin framework that loads DLLs that were made using later versions of .NET or even made in other programming languages. Is there a way to make a .NET 3.5 program/library load DLLs from a specific folder and instantiate them and interact with them?

EDIT: Just an FYI. The .NET 3.5 thing I am working with uses a special mscorlib dll that has some features removed, such as System.IO, and I can't replace said dll or else the thing will break.

  • 2
    Hi! Not a fully formed answer, but dynamic assembly loading is possible in .NET 3.5 as well ([Assembly.Load](https://docs.microsoft.com/en-us/dotnet/api/system.reflection.assembly.load?view=netframework-3.5) and [Assembly.LoadFrom](https://docs.microsoft.com/en-us/dotnet/api/system.reflection.assembly.loadfrom?view=netframework-3.5)), and there were approaches to creating plugins there as well. I don't remember if there were any popular frameworks or libraries though, it's been forever since I worked on 3.5. But yeah, Definitely possible to dynamically load assemblies from a plugins folder. – Michael Stum Jul 20 '21 at 14:47
  • 1
    `System.AddIn` is available in .NET 3.5: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2008/bb384241(v=vs.90)?redirectedfrom=MSDN (though I've never used it and don't know if it's actually good) - your question might already be answered [in this question](https://stackoverflow.com/questions/14278/how-to-load-plugins-in-net). – Michael Stum Jul 20 '21 at 14:52
  • Please read the edit I forgot to make (sorry). The thing I am working with uses a special version of mscorlib that doesn't have System.IO.GetFiles, which is what System.AddIn relies on, unfortunately. Hence why I made this question as this is a difficult thing to figure out. – ChrisNonyminus Jul 20 '21 at 15:09

0 Answers0