Remoting problem

lmwinbur

Member
Joined
Jan 6, 2004
Messages
7
I have a singleton object that I am remoting and this works great using winforms, but when I try to change the client to a windows service I get the following error...

.Config file Client.exe.config can not be read successfully due to exception System.ApplicationException: Invalid XML in file Client.exe.config near element . ---> System.IO.FileNotFoundException: The system cannot find the file specified.
at System.IConfigHelper.Run(IConfigHandler factory, String fileName)
at System.ConfigTreeParser.Parse(String fileName, String configPath)
--- End of inner exception stack trace ---
at System.ConfigTreeParser.Parse(String fileName, String configPath)
at System.Runtime.Remoting.Activation.RemotingXmlConfigFileParser.ParseConfigFile(String filename)
at System.Runtime.Remoting.RemotingConfigHandler.LoadConfigurationFromXmlFile(String filename).


I am configuring the client from a config file...

<?xml version="1.0" encoding="utf-8" ?>
<configuration>

<appSettings>
<add key="RemoteObject" value="tcp://localhost:8001/Checkout/RemoteObject" />
<add key="ExemptProfiles" value="administrator,checkout,localservice,networkservice,all users,default user,lmwinbur,landon," />
</appSettings>

<system.runtime.remoting>
<application name="SimpleClient">
<channels>
<channel ref="tcp client"/>
</channels>
</application>
</system.runtime.remoting>
</configuration>

The client uses a interface which the server implements called IRemoteObject. When I try to configure the client I get the error. I am using the following code to configure the client.

Dim RemObj as IRemoteObject.IRemoteObject
RemotingConfiguration.Configure("Client.exe.config")
Dim RemoteObj As Object
RemoteObj = Activator.GetObject( _
GetType(IRemoteObject.IRemoteObject), _
ConfigurationSettings.AppSettings("RemoteObject"))

Access the remote object to the interface.
RemObj = CType(RemoteObj, IRemoteObject.IRemoteObject)

I have tried using multiple accounts on this service as well. If anyone has any ideas why a service would be getting this error please let me know.

Thanks,
Landon.
 
Back
Top