Groups | Blog | Home
all groups > dotnet component services > october 2003 >

dotnet component services : remote component deployment : strange behaviour



enrico sabbadin
10/14/2003 1:12:34 PM
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



enrico sabbadin
10/14/2003 2:08:10 PM
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 ?

[quoted text, click to view]

enrico sabbadin
10/22/2003 2:07:36 PM
strange .. the difference is between new and createinstance, but the error I
get when the class is newed is thrown not when I new the class, but when I
call the method on the class,

anyone out there concerned with deployment issues as me ?

[quoted text, click to view]

AddThis Social Bookmark Button