如何从 UWP 中的路径加载程序集
How to load assembly from path in UWP
UWP
中的Assembly
class只有Load(AssemblyName assemblyName)
。
如果我只有物理位置(相对或绝对,无关紧要),如何加载程序集?
你不能。
您只能使用程序集名称从 appxpackage 加载程序集。
UWP/WinRT API.
从路径加载程序集不是 allowed/supported
var asName = new AssemblyName();
asName.Name = "assembly name";
var a = Assembly.Load(asName);
var type = a.GetType("name of the type to load");
return (T) Activator.CreateInstance(type);
UWP
中的Assembly
class只有Load(AssemblyName assemblyName)
。
如果我只有物理位置(相对或绝对,无关紧要),如何加载程序集?
你不能。 您只能使用程序集名称从 appxpackage 加载程序集。 UWP/WinRT API.
从路径加载程序集不是 allowed/supportedvar asName = new AssemblyName();
asName.Name = "assembly name";
var a = Assembly.Load(asName);
var type = a.GetType("name of the type to load");
return (T) Activator.CreateInstance(type);