I need to support remoting regardless if my remotable object is in the GAC. All the code below works fine if I don't use GAC!
I have a generic Remoting Server Host application which registers my remotable object with the code below.
IChannel chnl = new TcpServerChannel("MyRemoteServer", 8228);
string typeinfo = "MyRemotableObject.FooObj, MyRemotableObject, Version=3.0.1.0, Culture=neutral, PublicKeyToken=034567812341234a"
Type typ = Type.GetType(typeinfo); RemotingConfiguration.RegisterWellKnownServiceType(typ, "MyRemoteServer", WellKnownObjectMode.SingleCall); Above seems to work fine, no exception even when my remotable assembly is in the GAC. My client can successfully connect if my remotable object is not in GAC.
My client:
string uri = "tcp://MyRemotemachine:8228/MyRemoteServer"; string typeinfo = "MyRemotableObject.FooObj, MyRemotableObject, Version=3.0.1.0, Culture=neutral, PublicKeyToken=034567812341234a"
IChannel chnl = new TcpClientChannel(); Type typ = Type.GetType(typeinfo);
IMyinterface rem_o = (IMyinterface)RemotingServices.Connect(typ, uri);
This creates the proxy and works fine if RemotableObject is not in GAC. But if in GAC throws "System.IO.FileNotFound" with "either the assemebly... or one of it's dependencies not found" exception as soon as I call a method even rem_o.ToString().
MyRemotableObject: public class RemotableObject:MarshalByRefObject { public RemotableObject() ....
}
Any quick catches or suggestions? I don't want to use App.config and activate programmaticaly allowing my clients to create a remote or local instance as they choose. Thanks.
_________________________________________________________________ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963