Config file is found and loaded fine but no remote object. -
04-12-2007
, 11:28 AM
I'm running a windows service as a server. Installing the service
succeeds the service is up and running. The client gets the old
"target machine actively refused it error". I through in some tracing
code and no exceptions are being thrown. It finds and loads the
config file. I ran netstat -a and did not see the my port on the list
however. It makes me wonder if a syntax error is found on a config
file when does it get thrown or doesn't it? Anyway, here is the
code.
// Service OnStart Method
protected override void OnStart(string[] args)
{
cServiceLog.LogEvent("Service start", "RemoteServer.OnStart");
new Thread(delegate()
{
try
{
RemotingConfiguration.Configure(Globals.ConfigFile ,
false);
}
catch (Exception ex)
{
// Log to file
}
}).Start();
}
// Config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application>
<service>
<wellknown
mode="SingleCall"
type="MAXIS.DocumentControl.Remoting.RemoteDocumen tControl,
MAXIS.DocumentControl.Remoting"
objectUri="RDC"
/>
</service>
<channel>
<channel
ref="tcp"
port="3333"
/>
</channel>
</application>
</system.runtime.remoting>
<appSettings>
<!-- Additional Application Settings -->
</appSettings>
</configuration>
I've taken out some of the white space to make things easier to read.
Hope this helps. Any info people have would be much appreciated.
Thanks,
~Justin |