Instead of using the remoting config on the client side (which apart from setting up channel/formatter combinations other than the defaults is only really used for redirecting new for a type - this doesn't work for interfaces) why not use the appSettings section
<configuratio n>
<appSettings>
<add key="URL" value="tcp://localhost:9988/RemotingExample Service"/>
</appSettings>
</configuration>
Then your code can look like this
string url = ConfigurationSe ttings.AppSetti ngs["URL"];
IRemotingExampl eService resService =(IRemotingExam pleService)Acti vator.GetObject ( typeof(IRemotin gExampleService ), url);
Console.WriteLi ne("RESUME:\n" + resService.GetF ormattedResume( ));
Regards
Richard Blewett - DevelopMentor
http://staff.develop.com/richardb/weblog
nntp://news.microsoft. com/microsoft.publi c.dotnet.langua ges.csharp/<41************ ***********@new s.optusnet.com. au>
I have a question.. I am using remoting but on my client side I chose to use
an interface. As a result I was wondering if its still possible to place the
configuration details into a xml config file ?
I have not seen any examples of this does anyone know how I can do this ?
All I've seen are example such as below where an interface calling the
server as such. but I would like to not use this and instead call the config
file as its easily changed without the need to recompile
IRemotingExampl eService resService
=(IRemotingExam pleService)Acti vator.GetObject (
typeof(IRemotin gExampleService ),
"tcp://localhost:9988/RemotingExample Service");
Console.WriteLi ne("RESUME:\n" + resService.GetF ormattedResume( ));
Thanks
Tom
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (
http://www.grisoft.com).
Version: 6.0.770 / Virus Database: 517 - Release Date: 27/09/2004
[microsoft.publi c.dotnet.langua ges.csharp]