Chuck Douglas
7/13/2004 4:10:00 PM
Ooops. Here is the error that I am getting.
Unhandled Exception: System.IO.FileNotFoundException: File or assembly name
Obje
ctModel, or one of its dependencies, was not found.
File name: "ObjectModel"
at Client1.Client1.Main(String[] args)
=== Pre-bind state information ===
LOG: DisplayName = ObjectModel, Version=1.0.1654.20166, Culture=neutral,
PublicK
eyToken=5fa67588008b079e
(Fully-specified)
LOG: Appbase = F:\downloadLOG: Initial PrivatePath = NULL
Calling assembly : Client1, Version=1.0.1654.20415, Culture=neutral,
PublicKeyTo
ken=null.
===
LOG: Publisher policy file is not found.
LOG: Host configuration file not found.
LOG: Using machine configuration file from
F:\WINDOWS\Microsoft.NET\Framework\v1
..1.4322\config\machine.config.
LOG: Post-policy reference: ObjectModel, Version=1.0.1654.20166,
Culture=neutral
, PublicKeyToken=5fa67588008b079e
LOG: Attempting download of new URL file:///F:/download/ObjectModel.DLL.
LOG: Attempting download of new URL
file:///F:/download/ObjectModel/ObjectModel.
DLL.
LOG: Attempting download of new URL file:///F:/download/ObjectModel.EXE.
LOG: Attempting download of new URL
file:///F:/download/ObjectModel/ObjectModel.
EXE.
"Chuck Douglas" <cdouglas@mapinfo.com> wrote in message
news:%23GwspNPaEHA.808@tk2msftngp13.phx.gbl...
> I am having a problem with using remoting and I am hoping someone might
> have run into this problem before.
>
> I have developed a Windows service, which has the following OnStart
method
> override.
>
> protected override void OnStart(string[] args)
> {
> TcpChannel channel = new TcpChannel(8085);
> ChannelServices.RegisterChannel(channel);
> RemotingConfiguration.RegisterWellKnownServiceType(
> Type.GetType("ObjectModel.Engine,ObjectModel"),
> "TestEngine", WellKnownObjectMode.Singleton);
> }
>
> As you can see from the code above, I have a server object called
> "ObjectModel.Engine". It is derived from MarshalByRefObject. This is
built
> into a DLL called ObjectModel.dll. It is one simple class which a very
> simple interface, which I want to call remotely.
>
> I also have a client application, which has the following code. It
uses
> Activator.GetObject to get the proxy and calls the interface of the
> ObjectModel.Engine object.
>
> [STAThread]
> static void Main(string[] args)
> {
> TcpChannel channel = new TcpChannel();
> ChannelServices.RegisterChannel(channel);
> ObjectModel.Engine obj = (ObjectModel.Engine) Activator.GetObject(
> typeof(ObjectModel.Engine),
> "tcp://chdougla:8085/TestEngine");
>
> string prefix = args[0];
> if (obj != null)
> {
> obj.Add(prefix + "fred");
> System.Console.WriteLine(obj.ToStr());
> }
> else
> {
> System.Console.WriteLine("Could not locate server - ");
> }
> }
>
> I can successfully run the client and server on the same machine. I
have
> debugged into the windows service process id to verify that I was really
> executing the remote code. However, when I try to put the client exe on
> another machine then I get the following error. It seems like a
> security/permissions problem, but I am not sure.
>
> Also, here are some followup questions. When I run the client exe, why
> is my ObjectModel.dll automatically downloaded from the server? Is this
> expected, as part of remoting? Is this a proxy dll or the real dll? When
I
> physically copy the ObjectModel.dll to the same directory as the client
exe,
> on another machine, things seem to work fine. I wouldn''t expect that I
> would have to copy the server dll on every client machine though?
>
> Any help anyone can provide would be very much appreciated.
>
> Thanks
>
>