strange .. the difference is between new and createinstance, but the error I
"enrico sabbadin" <sabbadin@infinito.it> wrote in message
news:#vWYWvkkDHA.976@tk2msftngp13.phx.gbl...
> even more weird .. I don't need an interface .. I just need to avoid new ,
> that is ..
>
> lib1.Class1r f = new lib1.Class1r(); // doesn'st work
>
> lib1.Class1r f = (lib1.Class1r)(Activator.CreateInstance
> ("lib1","lib1.Class1r").Unwrap()); // IT works ?!
>
> it looks like that , using new , calls somethng like
> assembly.getreferencedassemblies ..
>
>
>
> any idea ?
>
> "enrico sabbadin" <sabbadin@infinito.it> wrote in message
> news:u0oqRQkkDHA.2772@TK2MSFTNGP12.phx.gbl...
> > Hi,
> > Suppose that a client calls a CAO remote component named C1which in
turns
> > calls into another component C2
> > the method signature is just a simple one such as
> >
> > string GetProcessID()
> >
> > a consle application host the remote component ..
> > both the client and the server configure remoting using confgiuration
> files
> >
> > now come the strange part:
> > 1) if a new C1 when I get an error on the client side stating that C"
> can't
> > be loaded (note , on the client side) ..
> > 2) if I have C1 implment an interface and Icreate C1 using
> >
> > Type mytype = Type.GetType ("lib1.Class1r, lib1",true,true);
> >
> > lib1.Irem f = (lib1.Irem)(Activator.CreateInstance (mytype));
> >
> > OR
> >
> > lib1.Irem f = (lib1.Irem)(Activator.CreateInstance
> > ("lib1","lib1.Class1r").Unwrap());
> >
> >
> > everything is fine .. ,that is , the client doesn't require C2 ..
> >
> > btw ..
> >
> > 1) I know that using SAO and getobject i do not even require C1 on the
> clint
> > side, but this is another point ..
> > 2) if C1 is a servicedcomponent hosted in a server application,
> > unfortunately using Activator.CreateInstance doesn't solve the problem
> ..C2
> > must be on the client side .. this is "known issue" I had already
> observed.
> >
> > How is that ? .. where is the difference between new and
> > Activator.CreateInstance ??
> >
> > thank for your reply
> > --
> > sabbadin@sabbasoft.com
> > MTS - COM+ - VBCOM - Enterprise Services - Security FAQ
> > .NET & COM+ books selected list
> >
http://www.sabbasoft.com > > "Moving fast is not the same as going somewhere." -Robert Anthony
> >
> >
> >
> >
>
>