Remoting Configuration File.
Messages   Related Types
This message was discovered on ASPFriends.com 'ngfx-remoting' list.


Decell, Gary
I am having some problems with using remoting configuration in one of my
applications, and was wondering if anyone else has seen this. Here is the
code, config file and error message

Configuration File

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application name="CatalogDisplay">
<service>
<wellknown mode="Singleton"
type="StaplesCatalog.BrowseMgr, StaplesCatalog" objectUri="CatalogDisplay"
/>
</service>
<channels>
<channel port="8085"
type="System.Runtime.Remoting.Channels.Tcp.TcpChannel,
System.Runtime.Remoting" />
</channels>
</application>
</system.runtime.remoting>
</configuration>

Code that loads the Configuration file

Dim config As String = "CatalogService.exe.config"

RemotingConfiguration.Configure(config)

EventLog Error Message.

Service cannot be started. System.Runtime.Remoting.RemotingException:
.Config file CatalogService.exe.config can not be read successfully due to
exception System.ApplicationException: Invalid XML in file
CatalogService.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.ParseConfigFi
le(String filename)
at
System.Runtime.Remoting.RemotingConfigHandler.LoadConfigurationFromXmlFile(S
tring filename).
at
System.Runtime.Remoting.RemotingConfigHandler.LoadConfigurationFromXmlFile(S
tring filename)
at System.Runtime.Remoting.RemotingConfiguration.Configure(String
filename)
at CatalogService.StaplesService.OnStart(String[] args) in D:\Work in
Progress\STAPLES\projects\StaplesService\CatalogService.vb:line 56
at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object
state)

This application is running as a Windows service and the above error is what
is received upon starting the service.

| [aspngheaven] member Click here to reveal e-mail address = YOUR ID |
http://www.asplists.com/asplists/aspngheaven.asp = JOIN/QUIT
Reply to this message...
 
    
SHEATHER,Kristoffer
The method threw a FileNotFound exception.. make sure the file is in the
directory where the service executable is.. try this instead:

Dim configPath As String Path.Combine(AppDomain.CurrentDomain.BaseDirectory,
"RemotingService.exe.config")
EventLog.WriteEntry("Remoting Service Starting..")
If File.Exists(configPath) Then
RemotingConfiguration.Configure(configPath)
EventLog.WriteEntry("Remoting service configured successfully..")
Else
EventLog.WriteEntry("Could not find configuration file.. service
shutting down now..")
End
End If

Take notice of this line especially:- Dim configPath As String Path.Combine(AppDomain.CurrentDomain.BaseDirectory,
"RemotingService.exe.config")
I am guessing that the current directory isnt set to the location of
your configuration file.. let me know how you go.

Thanks,
Kris.

-----Original Message-----
From: Decell, Gary [mailto:Click here to reveal e-mail address]
Sent: Friday, 14 December 2001 1:45
To: ngfx-remoting
Subject: [ngfx-remoting] Remoting Configuration File.

I am having some problems with using remoting configuration in one of my
applications, and was wondering if anyone else has seen this. Here is
the code, config file and error message

Configuration File

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application name="CatalogDisplay">
<service>
<wellknown
mode="Singleton" type="StaplesCatalog.BrowseMgr, StaplesCatalog"
objectUri="CatalogDisplay" />
</service>
<channels>
<channel port="8085"
type="System.Runtime.Remoting.Channels.Tcp.TcpChannel,
System.Runtime.Remoting" />
</channels>
</application>
</system.runtime.remoting>
</configuration>

Code that loads the Configuration file

Dim config As String = "CatalogService.exe.config"

RemotingConfiguration.Configure(config)

EventLog Error Message.

Service cannot be started. System.Runtime.Remoting.RemotingException:
.Config file CatalogService.exe.config can not be read successfully due
to exception System.ApplicationException: Invalid XML in file
CatalogService.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.ParseConf
igFile(String filename)
at
System.Runtime.Remoting.RemotingConfigHandler.LoadConfigurationFromXmlFi
le(String filename).
at
System.Runtime.Remoting.RemotingConfigHandler.LoadConfigurationFromXmlFi
le(String filename)
at System.Runtime.Remoting.RemotingConfiguration.Configure(String
filename)
at CatalogService.StaplesService.OnStart(String[] args) in D:\Work in
Progress\STAPLES\projects\StaplesService\CatalogService.vb:line 56
at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object
state)

This application is running as a Windows service and the above error is
what is received upon starting the service.

| [aspngheaven] member Click here to reveal e-mail address = YOUR ID |
http://www.asplists.com/asplists/aspngheaven.asp = JOIN/QUIT
| [ngfx-remoting] member Click here to reveal e-mail address = YOUR ID |
http://www.aspfriends.com/aspfriends/ngfx-remoting.asp = JOIN/QUIT

Notice:
The information contained in this e-mail message and any attached files may
be confidential information, and may also be the subject of legal
professional privilege. If you are not the intended recipient any use,
disclosure or copying of this e-mail is unauthorised. If you have received
this e-mail in error, please notify the sender immediately by reply e-mail
and delete all copies of this transmission together with any attachments.
Reply to this message...
 
    
Decell, Gary
Thanks that did it.

-----Original Message-----
From: SHEATHER,Kristoffer [mailto:Click here to reveal e-mail address]
Sent: Thursday, December 13, 2001 5:47 PM
To: ngfx-remoting
Subject: [ngfx-remoting] RE: Remoting Configuration File.

The method threw a FileNotFound exception.. make sure the file is in the
directory where the service executable is.. try this instead:

Dim configPath As String Path.Combine(AppDomain.CurrentDomain.BaseDirectory,
"RemotingService.exe.config")
EventLog.WriteEntry("Remoting Service Starting..")
If File.Exists(configPath) Then
RemotingConfiguration.Configure(configPath)
EventLog.WriteEntry("Remoting service configured successfully..")
Else
EventLog.WriteEntry("Could not find configuration file.. service
shutting down now..")
End
End If

Take notice of this line especially:- Dim configPath As String Path.Combine(AppDomain.CurrentDomain.BaseDirectory,
"RemotingService.exe.config")
I am guessing that the current directory isnt set to the location of your
configuration file.. let me know how you go.

Thanks,
Kris.

-----Original Message-----
From: Decell, Gary [mailto:Click here to reveal e-mail address]
Sent: Friday, 14 December 2001 1:45
To: ngfx-remoting
Subject: [ngfx-remoting] Remoting Configuration File.
I am having some problems with using remoting configuration in one of my
applications, and was wondering if anyone else has seen this. Here is the
code, config file and error message

Configuration File

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application name="CatalogDisplay">
<service>
<wellknown mode="Singleton"
type="StaplesCatalog.BrowseMgr, StaplesCatalog" objectUri="CatalogDisplay"
/>
</service>
<channels>
<channel port="8085"
type="System.Runtime.Remoting.Channels.Tcp.TcpChannel,
System.Runtime.Remoting" />
</channels>
</application>
</system.runtime.remoting>
</configuration>

Code that loads the Configuration file

Dim config As String = "CatalogService.exe.config"

RemotingConfiguration.Configure(config)

EventLog Error Message.

Service cannot be started. System.Runtime.Remoting.RemotingException:
.Config file CatalogService.exe.config can not be read successfully due to
exception System.ApplicationException: Invalid XML in file
CatalogService.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.ParseConfigFi
le(String filename)
at
System.Runtime.Remoting.RemotingConfigHandler.LoadConfigurationFromXmlFile(S
tring filename).
at
System.Runtime.Remoting.RemotingConfigHandler.LoadConfigurationFromXmlFile(S
tring filename)
at System.Runtime.Remoting.RemotingConfiguration.Configure(String
filename)
at CatalogService.StaplesService.OnStart(String[] args) in D:\Work in
Progress\STAPLES\projects\StaplesService\CatalogService.vb:line 56
at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object
state)

This application is running as a Windows service and the above error is what
is received upon starting the service.

| [aspngheaven] member Click here to reveal e-mail address = YOUR ID |
http://www.asplists.com/asplists/aspngheaven.asp = JOIN/QUIT
| [ngfx-remoting] member Click here to reveal e-mail address = YOUR ID |
http://www.aspfriends.com/aspfriends/ngfx-remoting.asp = JOIN/QUIT |
[ngfx-remoting] member Click here to reveal e-mail address = YOUR ID |
http://www.aspfriends.com/aspfriends/ngfx-remoting.asp = JOIN/QUIT
Reply to this message...
 
 
System.AppDomain
System.ApplicationException
System.Diagnostics.EventLog
System.IO.File
System.IO.FileNotFoundException
System.IO.Path
System.Runtime.Remoting.Channels.Tcp.TcpChannel
System.Runtime.Remoting.RemotingConfiguration
System.Runtime.Remoting.RemotingException
System.Runtime.Remoting.Services.RemotingService
System.ServiceProcess.ServiceBase




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com