HighTechTalks DotNet Forums  

ConfigurationSettings.AppSettings always returns null

Dotnet Framework microsoft.public.dotnet.framework


Discuss ConfigurationSettings.AppSettings always returns null in the Dotnet Framework forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Andrew Hayes
 
Posts: n/a

Default ConfigurationSettings.AppSettings always returns null - 12-27-2007 , 12:46 AM






I'm not using One Touch or OpenNetCF, so none of the workarounds offered by
those search results work.

What I do have is a .NET 1.1 EXE which runs as a service on a machine
without IIS, and it used to work fine until I had to install .NET 2.0 because
of another application being installed. Now the call to
ConfigurationSettings.AppSettings always returns NULL.

I've tried adding the AppSettings section to the .NET 2.0. machine.config
and web.config files but with no change in the result. I've also tried
creating the appname.exe.config file in the same folder as the EXE, but that
doesn't help either.

Yes, I know ConfigurationSettings.AppSettings is obsolete so I should really
change the code and recompile it but I don't have VS 2005 (what's the point
of upgrading now when VS 2008 is just around the corner?)

So can anyone tell me where ConfigurationSettings.AppSettings is looking
when both .NET 1.1 and .NET 2.0 are installed? Or any other workaround that
would actually work?

Reply With Quote
  #2  
Old   
Alan Samet
 
Posts: n/a

Default Re: ConfigurationSettings.AppSettings always returns null - 12-27-2007 , 11:22 PM






On Dec 27, 1:46*am, Andrew Hayes
<AndrewHa... (AT) discussions (DOT) microsoft.com> wrote:
Quote:
I'm not using One Touch or OpenNetCF, so none of the workarounds offered by
those search results work.

What I do have is a .NET 1.1 EXE which runs as a service on a machine
without IIS, and it used to work fine until I had to install .NET 2.0 because
of another application being installed. Now the call to
ConfigurationSettings.AppSettings always returns NULL.

I've tried adding the AppSettings section to the .NET 2.0. machine.config
and web.config files but with no change in the result. I've also tried
creating the appname.exe.config file in the same folder as the EXE, but that
doesn't help either.

Yes, I know ConfigurationSettings.AppSettings is obsolete so I should really
change the code and recompile it but I don't have VS 2005 (what's the point
of upgrading now when VS 2008 is just around the corner?)

So can anyone tell me where ConfigurationSettings.AppSettings is looking
when both .NET 1.1 and .NET 2.0 are installed? Or any other workaround that
would actually work?
AppDomain.CurrentDomain.SetupInformation.Configura tionFile


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.