On the client, if you're going to use 'Connect' to access your remote object
(as opposed to 'new MyRemotableObject'), then you can access it using an
interface (which you appear to want to do anyway). Instead of doing "typ =
Type.GetType(typeinfo)" on the client, you probably just want "typ =
typeof(IMyinterface)". I assume that RemotableObject implements
IMyinterface (since thats what you're casting the proxy to on the client),
right? By connecting using the interface type, you're requiring only the
interface assembly (not the implementation) to be present on your client.
I don't see how putting the assembly in the GAC or not would make a
difference. Are you talking about the GAC on the server or on the client?
Also, try looking at the fusion log (fuslogvw.exe) after the exception is
thrown for details of the problem.
Rick
----- Original Message -----
From: "ayse ayse" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 19, 2003 1:24 PM
Subject: Re: Remoting GAC
> I am having a bit of a trouble with remoting assemblies from GAC.
>
> 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
>