请帮我解决这个错误:
无法将类型“object”隐式转换为“System.Reflection.Assembly”。存在显式转换(您是否缺少演员表?)
谢谢!!!
代码
var assemblyName = AssemblyName.GetAssemblyName(assemblyPath);
var ads = new AppDomainSetup
{
ApplicationBase = AppDomain.CurrentDomain.SetupInformation.ApplicationBase,
DisallowCodeDownload = true
};
AppDomain newDomainName = AppDomain.CreateDomain("newDomainName", null, ads);
Assembly testLibrary = newDomainName.CreateInstanceAndUnwrap(assemblyName.Name,
typeof(System.Windows.Controls.UserControl).Name); // Here the error occures