Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > App.Config File

Reply
Thread Tools

App.Config File

 
 
Stephen
Guest
Posts: n/a
 
      01-23-2006
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.Configuratio nException: Could not
create System.Configuration.NameValueFileSectionHandler,
System, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089
at System.Configuration.ConfigurationRecord.GetFactor y(String configKey)
at System.Configuration.ConfigurationRecord.Evaluate( String configKey)
at System.Configuration.ConfigurationRecord.ResolveCo nfig(String
configKey)
at System.Configuration.ConfigurationRecord.GetConfig (String configKey)
at
System.Configuration.DefaultConfigurationSystem.Sy stem.Configuration.IConfig
urationSystem.GetConfig(String configKey)
at System.Configuration.ConfigurationSettings.GetConf ig(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.NameValueFileSectionHan dler,
System, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"/>
<section name="stage"
type="System.Configuration.NameValueFileSectionHan dler,
System, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"/>
<section name="prod"
type="System.Configuration.NameValueFileSectionHan dler,
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


 
Reply With Quote
 
 
 
 
Stephen
Guest
Posts: n/a
 
      01-23-2006
Found the solution,
Thanks guys
Stephen

"Stephen" <> wrote in message
news:...
> 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.Configuratio nException: Could not
> create System.Configuration.NameValueFileSectionHandler,
> System, Version=1.0.5000.0, Culture=neutral,
> PublicKeyToken=b77a5c561934e089
> at System.Configuration.ConfigurationRecord.GetFactor y(String

configKey)
> at System.Configuration.ConfigurationRecord.Evaluate( String configKey)
> at System.Configuration.ConfigurationRecord.ResolveCo nfig(String
> configKey)
> at System.Configuration.ConfigurationRecord.GetConfig (String configKey)
> at
>

System.Configuration.DefaultConfigurationSystem.Sy stem.Configuration.IConfig
> urationSystem.GetConfig(String configKey)
> at System.Configuration.ConfigurationSettings.GetConf ig(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.NameValueFileSectionHan dler,
> System, Version=1.0.5000.0, Culture=neutral,
> PublicKeyToken=b77a5c561934e089"/>
> <section name="stage"
> type="System.Configuration.NameValueFileSectionHan dler,
> System, Version=1.0.5000.0, Culture=neutral,
> PublicKeyToken=b77a5c561934e089"/>
> <section name="prod"
> type="System.Configuration.NameValueFileSectionHan dler,
> 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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting JPG file ppt file [Powerpoint] file zxcvar Digital Photography 7 06-22-2009 07:54 PM
Reading of file by next of map file and by next of file descriptor. =?ISO-8859-2?Q?Miros=B3aw?= Makowiecki C++ 1 07-10-2007 02:46 AM
How to create MDF file (.mdf) file from XML file. Dave ASP .Net 1 06-07-2007 11:32 PM
In file parsing, taking the first few characters of a text file after a readfile or streamreader file read... .Net Sports ASP .Net 11 01-17-2006 12:44 AM
An Automated process of watching a network file folder, reading a file in it and deleting the file using ASP.NET ? Luis Esteban Valencia Muņoz ASP .Net 3 06-04-2005 10:56 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57