On Mon, 17 Jun 2002 13:34:36 -0700, Andres Aguiar <[EMAIL PROTECTED]> wrote:
>The code runs perfect when we try it from a WinForm C# project, but it does >not work when we call it from inside the Visual Studio .NET AddIn (running >in the Visual Studio.NET default AppDomain). We get a casting exception >when we get the 'remote' instance in the following line: > >remoteLoader = (RemoteLoader) > appDomain.CreateInstanceFromAndUnwrap(assemblyName, remoteClassName); > >the debugger says that the returned instance's type is MarshalByRef when >running from the Visual Studio.NET Addin, and it says that the type >is 'RemoteLoader' (that is what we want) when we run it from another >application. Wow. Just ran into this problem today. I think we got around it by using reflection and MethodInfo.Invoke() to avoid the type cast but that is gross. I would also love to know how to make this work. -- Keith You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.