It might have to do with the fact that IIS will not deploy a config file unless you 
tell it it's ok to do so.  If I remember rightly, you have to put a line the 
Web.config file to tell it which config files should be allowed to be seen by 
outsiders.  Look in the old archives for this of spring time.

-----Original Message-----
From: Todd Hickerson [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 30, 2002 9:42 PM
To: [EMAIL PROTECTED]
Subject: [ADVANCED-DOTNET] App.config file not found when remoting
windows app deployed by IIS


The config file stores my remoting configuration, so I need to be able to
read it from the client app.  But when I make the call:
RemotingConfiguration.Configure("MyFormsApp.exe.config");
from a client windows forms app deployed by IIS, I get the following error
that the config file could not be found: (note: it does not fail if the
app is run apart from IIS.)

-----------------------------------------------------------

An unhandled exception of type
'System.Runtime.Remoting.RemotingException' occurred in mscorlib.dll

Additional information: .Config file MyFormsApp.exe.config can not be
ready successfully due to exception System.ApplicationException: Invalid
XML in file MyFormsApp.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.ParseConfigF
ile(String filename)
at
System.Runtime.Remoting.RemotingConfigHandler.LoadConfigurationFromXmlFile
(String filename).

-----------------------------------------------------------

Here is what has been done to get things to this point:

(1) The web.config for the web project that deploys the client app in IIS
has been modified to allow the config file to copy down to the client into
the Temporary Internet Files directory, which it does.
Here are the contents:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.web>
    <httpHandlers>
      <remove verb="*" path="*.config" />
    </httpHandlers>
  </system.web>
</configuration>

(2) The following syntax also fails to access the config file, even though
this is the correct path (it's probably protected since it's a special
folder):
System.Environment.GetFolderPath
(System.Environment.SpecialFolder.InternetCache)
+ "\\MyFormsApp.exe.config";

(3)  My "http://localhost/"; site (where my client deployment and remoting
server reside) has been added to the IE Trusted Sites list.  And
the "mscorcfg.msc" utility has been run to increase the Code Access
Security to "Full Trust" for Trusted Sites.

Any help would be appreciated.

Thank you,

Todd Hickerson

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced 
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced 
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to