App.Config File

S

Stephen

Hi,

I did mange to create custom app.config file for a windows based
application.
I am trying to use the same process to use the app.config file for a console
based application but i get this error message: when i pass parameter
"stage" from the app.config file


ExceptionMessage:System.Configuration.ConfigurationException: Could not
create System.Configuration.NameValueFileSectionHandler,
System, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089
at System.Configuration.ConfigurationRecord.GetFactory(String configKey)
at System.Configuration.ConfigurationRecord.Evaluate(String configKey)
at System.Configuration.ConfigurationRecord.ResolveConfig(String
configKey)
at System.Configuration.ConfigurationRecord.GetConfig(String configKey)
at
System.Configuration.DefaultConfigurationSystem.System.Configuration.IConfig
urationSystem.GetConfig(String configKey)
at System.Configuration.ConfigurationSettings.GetConfig(String
sectionName)
at TestConsoleApp.TestConsoleApp.getFilePaths() in
C:\......\TestConsoleApp\TestConsoleApp.vb:line 41

I am using this app.config file:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="dev"
type="System.Configuration.NameValueFileSectionHandler,
System, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"/>
<section name="stage"
type="System.Configuration.NameValueFileSectionHandler,
System, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"/>
<section name="prod"
type="System.Configuration.NameValueFileSectionHandler,
System, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"/>

</configSections>

<dev>
<add key="AppRootDir" value="/Authoring/"/>
</dev>

<stage>
<add key="AppRootDir" value="/S-Authoring/"/>
</stage>

<prod>
<add key="AppRootDir" value="/P-Authoring/"/>
</prod>

</configuration>

Thanks,
Stephen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top