私のコードでは、私はインターフェイスを持っています - InterfaceName
とその実装はInterfaceImpl
と呼ばれると言うことができます。今私は、動的に次のコードを使用してInterfaceImpl
を取得しようとすると:私は間違っているかもしれないものにキャストすることができませんSystem.Runtime.Remoting.ObjectHandle
Unable to cast object of type 'System.Runtime.Remoting.ObjectHandle' to type 'ProjectName.Folder.InterfaceName'.
任意の提案、次のエラーを取得
object obj = Activator.CreateInstance("ProjectName","ProjectName.Folder.InterfaceImpl");
InterfaceName in = (InterfaceName)obj; //Error pops up here
を?
Unwrap()メソッドを使用します。 –