Re: Windows Service using remoting

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Sunny (sunny_at_newsgroups.nospam)
Date: 07/13/04


Date: Tue, 13 Jul 2004 13:28:45 -0500

Both the server and the client have to have access to the assembly in
which the object is declared. As it is not good to have your object code
distributed with the client, you can use:

1. soapsuds.exe utility to extract the meta-data info, and distribute
only this metadata. There are some problems with the this utility, and
some limitation.

thats why I usually recommend:
2. Interfaces or abstract class libraries. Allen Andersons article about
abstract class approach is very good. You can use the same with
interfaces as well:

http://www.glacialcomponents.com/ArticleDetail.aspx?
articleID=RemoteObject

Sunny

In article <uYgrWPPaEHA.2296@TK2MSFTNGP10.phx.gbl>, cdouglas@mapinfo.com
says...
> 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:\download\
> LOG: 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
> >
> >
>
>
>



Relevant Pages

  • Re: screen scrape / remote manipulation
    ... Functionally a dll is no different from an .exe in terms of spying ... The other option is to install software capable of monitoring TCP/IP port ... connection is established between the dll (on the client) and the server, ...
    (microsoft.public.windowsxp.general)
  • RE: how to share a static variable between 2 different process
    ... dll into Component Services in Windows as a COM+ server. ... my dll has been exposed as a COM object thanks ... course one client could pay only seats who reserved itself. ... disk) of the reservations and the related process who made the reservations. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: What doesnt lend itself to OO?
    ... >> proxy and instructs the server to constuct the real object. ... rather than client code. ... If 'clock' is instantiated in the server, ... > for the server interface at the OOA level. ...
    (comp.object)
  • This is going straight to the pool room
    ... or not the client has privilege to do what they're trying to do, ... The server environment is this: ... 3GL User action Routines that Tier3 will execute on your behalf during the ... Routine Name: USER_INIT ...
    (comp.os.vms)
  • [Full-Disclosure] R: Full-Disclosure Digest, Vol 3, Issue 42
    ... Full-Disclosure Digest, Vol 3, Issue 42 ... SD Server 4.0.70 Directory Traversal Bug ... Arkeia Network Backup Client Remote Access ...
    (Full-Disclosure)