Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ConfigurationSettings error
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
ConfigurationSettings error
Versions des environnements
Environment:
C# 2.0
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01184405
Message ID:
01184405
Vues:
66
I have a program that creates a text file and uploads it to a client's server using a java program provided by the client. I set up variables in the app.config file as follows:
<appSettings>
...

    <add key = "javaExecString" value = "C:\PROGRA~1\Java\jre1.6.0\bin\java.exe"/>
    <add key = "javaParamString" value = "-classpath .;C:\deve\ESKDataPro\JavaWebRequest;C:\deve\ESKDataPro\JavaWebRequest\log4j-1.2.7.jar Trigger "/>
    <add key = "javaServerString" value = "test"/>


Here's the code that retrieves those variables:
 string executableString = ConfigurationSettings.AppSettings.Get("javaExecString"); //"C:\\PROGRA~1\\Java\\jre1.6.0\\bin\\java.exe";
string parametersString = ConfigurationSettings.AppSettings.Get("javaParamString"); //"-classpath .;C:\\deve\\ESKDataPro\\JavaWebRequest;C:\\deve\\ESKDataPro\\JavaWebRequest\\log4j-1.2.7.jar Trigger ";
string serverString = ConfigurationSettings.AppSettings.Get("javaServerString"); //"test";
When I compile, I get the error: Warning 1 'System.Configuration.ConfigurationSettings.AppSettings' is obsolete: 'This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings'


When I try to change the code to use the Configuration.ConfigurationManager.AppSettings option, ConfigurationManager does not show up in the list of available methods. It's just an error but I'd like to know how to do this the "recommended" way.

Has anyone run across this?

Thanks.

Linda
Linda Harmes
HiBit Technologies, Inc.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform