我想开发AppDomain项目,所以我想加载DLL,但下面的代码给我一个错误:
无法从程序集'ClassLibrary1加载'test'类型, Version = 1.0.0.0,Culture = neutral,PublicKeyToken = null'。
如何解决?
class Program
{
static void Main(string[] args)
{
AppDomain yenidomain = AppDomain.CreateDomain("PluginDomain", null, null);
ObjectHandle oh = Activator.CreateInstanceFrom(
yenidomain, @"S:\Source\Yusuf.Karatoprak\plugins\ClassLibrary1.dll","test", false,
BindingFlags.Instance | BindingFlags.Public | BindingFlags.CreateInstance,
null, new object[] { },
null, null, null);
}
}
答案 0 :(得分:1)
test
是您的类型的全名吗?添加完整的命名空间!