Assembly loading

Helo!

I want to make a plugin system to Unity (for server build), but I always getting ‘Exception of type ‘System.Reflection.ReflectionTypeLoadException’ was thrown.’ exception when I trying to load an assembly.
Probably because the different .NET framework in unity and the plugin.

So I builded the plugin.dll with .NET Framework (currently 3.5).
I tried changing the api from 2.0 to 4.0 , but nothing happened.

Loading plugins: public void LoadPlugins(){ Plugins = new List<IPlugin>(); if (Director - Pastebin.com
(This is where exceptions thrown)

My question is what I should try?
Thanks for any help

It’s difficult to judge from what you’ve given. Make sure that everything that’s referenced by the plugin is available.

Also, your Assembly.LoadFile is doing nothing with the file it loaded.

See; Assembly.LoadFile Method (System.Reflection) | Microsoft Learn

In the first pastebin I loaded them into a List.
This is how I called the plugin’s method: https://pastebin.com/9yJ2tz8N

Afterall outside Unity its working perfectly with 3.5 NET Framework, but when I installed to unity its totally not working.
I think the issue could be some compatibility problem