는 DLL에 다음 코드를 고려 반사를 통해로드 :동적으로 해결하는 유형
public class ReceivingClass
{
private Assembly myAssembly;
private Type typeOfClass;
public ReceivingClass()
{
myAssembly = Assembly.LoadFile(@"E:\VSProjects\TestDynamicLinking\MyLib\bin\Debug\MyLib.dll");
//Can I use this type somehow to resolve the type in the below method?
typeOfClass = myAssembly.GetType("ExportedClass");
}
public bool ReceiveMethod(ExportedClass classobj)
{
return true;
}
}
그래서, 문제는 위의 ReceiveMethod
에, ExportedClass
어셈블리에 정의 된 클래스가 있다는 것이다을하는 I 생성자에 동적으로로드됩니다. 그래서, 어떻게 든 ExportedClass
의 유형을 해결할 수 있습니까? dynamic
을 사용할 필요가 없습니까? 당신이