Re: convert console app to config file?

From: Sam Santiago (ssantiago_at_n0spam-SoftiTechture.com)
Date: 10/18/04


Date: Mon, 18 Oct 2004 09:51:41 -0700

You can create a VS 2003 Solution that has two projects within in it - your
client project and your server project. Add a Applicaton Configuration file
to each project - app.config. Place the remoting configuration parameters
within the app.config file. Start your server application (console app most
likely) by right clicking on it and choosing Debug, Start Instance. Start
your client application next by right clicking on it and choosing Debug,
Step Into. You can find an example on my site,
http://www.SoftiTechture.com/discussions, regarding the factory pattern with
remoting.

Thanks,

Sam

-- 
_______________________________
Sam Santiago
ssantiago@n0spam-SoftiTechture.com
http://www.SoftiTechture.com
_______________________________
"hazz" <hazz@sonic.net> wrote in message
news:ev%23$vBTtEHA.3572@tk2msftngp13.phx.gbl...
> Thank you Sam.
> Actually I have an operational hurdle.
> I created a working sample of a client and server in VS.NET using the code
I
> provided.
> If I create the configuration file as you very helpfully morphed for me,
how
> do I activate the server object?  In VS.NET I just had to click Start-F54
> and everything automagically happened. The console commands gave me
instant
> feedback the service was running.
> If I use a config file....well how do I kick start the remoted object in
> question.How do I know it's up and running and available for service?
Sorry
> for these I am sure painfully obvious questions.
> Thanks again. I am getting closer!
> hazz
> "Sam Santiago" <ssantiago@n0spam-SoftiTechture.com> wrote in message
> news:ubY30fStEHA.3200@TK2MSFTNGP14.phx.gbl...
> > Yes, how about:
> >
> > <system.runtime.remoting>
> >   <application name="MyRemoteServer">
> >    <service>
> >    <wellknown mode="SingleCall"
> >      type="Namespace.ServerClass, AssemblyName"
> >       objectUri="MyURI">
> >    </service>
> >   <channels>
> >    <channel ref="tcp"  port="8086">
> >     <serverProviders>
> >      <formatter ref="binary" typeFilterLevel="Full" />
> >     </serverProviders>
> >    </channel>
> >   </channels>
> >  </application>
> > </system.runtime.remoting>
> >
> > The client side configuration file is left as an exercise for the reader
> > ;-).
> >
> > Thanks,
> >
> > Sam
> >
> > -- 
> > _______________________________
> > Sam Santiago
> > ssantiago@n0spam-SoftiTechture.com
> > http://www.SoftiTechture.com
> > _______________________________
> > "hazz" <hazz@sonic.net> wrote in message
> > news:%233OkC5RtEHA.4044@TK2MSFTNGP09.phx.gbl...
> > > The following code successfully turns an existing assembly into a
server
> > > object to which my client app successfully connects and invokes a
method
> > > from the server object.
> > >
> > > TcpServerChannel channel = new TcpServerChannel(8086);
> > > ChannelServices.RegisterChannel(channel);
> > >
> >
>
RemotingConfiguration.RegisterWellKnownServiceType(typeof(ServerClass),"MyUr
> > > i",WellKnownObjectMode.SingleCall)
> > >
> > > System.Console.WriteLine("hit to exit");
> > > System.Console.ReadLine();
> > >
> > > Can I create a config file out of these few lines of code?
> > >
> > > thank you.  -hazz
> > >
> > >
> > >
> > >
> > >
> > >
> >
> >
>
>


Relevant Pages

  • Re: passing object ByRef not updating object references
    ... Thanks for a quick reply Sam, but I'm afraid nothing has changed as of yet. ... Public Sub ClientChangedImplements ... Now I'll keep the client connected and stop the server and in the process, ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: passing object ByRef not updating object references
    ... debugging the server and the client simultaneously within Visual Studio ... right click on the client project and select Debug, ... Sam Santiago ... Public Sub ClientChangedImplements ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: convert console app to config file?
    ... The client side configuration file is left as an exercise for the reader ... Sam Santiago ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: Binary of HTTP config issues
    ... I just cut and pasted your config settings into my server web config and ... It works great for me too Sam except when I inspect the ... payload of the traffic between client and server it is a soap envelope so I ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: Windows 2003 server has lost its system configuration
    ... "Sam" wrote: ... | No prob - I restarted the DHCP Client on the client computer. ... | Now, from System Explorer on the server, ...
    (microsoft.public.windows.server.general)