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
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