Scott Cate Weblog 

scott.cate@myKB.com
http://scottcate.myKB.com



Scott Cate KB > Microsoft.com/PDC Oct 2003 > ASP.NET 2.0 [Whidbey] Start Over
Search the Knowledge Base
 
Start Search in the Following Category
Date Modified
Monday, June 13, 2005
Looking for the new ConfigurationManager?

I was just spinning up a little console application, as a utility, and I'm pulling an encrypted connection string from the app.config file. Using 1.1 code that I'm used to, I used....

System.Configuration.ConfigurationSettings.AppSettings["connstr"].ToString();

And the compiler gave me the following error.

Warning 1 'System.Configuration.ConfigurationSettings.AppSettings' is obsolete: 'This method is obsolete, it has been replaced by ConfigurationManager.AppSettings'

So I try and change my Code to the following ...

System.Configuration.ConfigurationManager.AppSettings["connstr"].ToString();

and I get a compiler error, saying the compiler can't find ConfigurationManager.

Well here's the confusion.... The Original System.Configuration.ConfigurationSettings class is found in the System.dll assembly. There is a new assembly with all the new ConfigurationManager classes as System.Configuration.dll. Before using the ConfigurationManager class, you must first set a reference to the new System.Configuration.dll.

-=- Hope this helps someone ....


All rights reserved. All details are the personal opinion of Scott Cate.
All trademarks referenced are the property of their respective owners.
Scott Cate is a lead programmer for www.myKB.com and
owner of The Arizona .NET User Group and an all around nice guy ;)


Knowledge Base Software - myKB.com

 

Cameron Cate Pictures
Cameron Cate Pix

Site Navigation

Home
Knowledge Base
Wiki Discussions
Photo Album

Sites I Own & Run


Easy Search ASP.NET
mykb.com knowledge base software logo
myKB.com
Knowledgebase Software

KBAlertz.com
Arizona .NET user Group
Group Leader

Affiliations


ASP.NET MVP
2004
2005
2006
2007
2008
2009


Blog Sites I Read

Brady Gaster
Rob Howard
G. Andrew  Duthie
Robert McLaws
Alex Lowe

World of Scott.Net

Scott Guthrie
  -  Father of ASP.NET

Scott Watermasyk
  - .Text (Weblog)

Scott Sargent
Scott Mitchell
ScottG.net
Scott Bellware
Scott Forsyth
Scott Hanselman
Scott Cate

Favorite Books


ASP.NET Cookbook


First Looks @ ASP.NET 2.0