473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

ConfigurationManager in Beta2

Hi, I try to read a value from app.config file using this code:

string
s=System.Configuration.ConfigurationManager.AppSet tings["server"].ToString();

I got the compiler error:

Error 1 The type or namespace name 'ConfigurationManager' does not exist in
the namespace 'System.Configuration' (are you missing an assembly
reference?) .

A reference to System.Configuration.dll is added to the project.

My System.Configuration.dll has Version 2.0.50215.44. I there a newer
version ?

Thanks
Michael
Nov 17 '05 #1
4 7395
I think it should be
string s=System.Configuration.Configuration.AppSettings["server"];
--
Alex Feinman
---
Visit http://www.opennetcf.org
"Michael Debus" <md****@orcasoft.de> wrote in message
news:da*************@news.t-online.com...
Hi, I try to read a value from app.config file using this code:

string
s=System.Configuration.ConfigurationManager.AppSet tings["server"].ToString();

I got the compiler error:

Error 1 The type or namespace name 'ConfigurationManager' does not exist
in the namespace 'System.Configuration' (are you missing an assembly
reference?) .

A reference to System.Configuration.dll is added to the project.

My System.Configuration.dll has Version 2.0.50215.44. I there a newer
version ?

Thanks
Michael


Nov 17 '05 #2
Hello,
System.Configuration.ConfigurationSettings.AppSett ings["server"];
works.

but i'v got a warning:
Warning 2 'System.Configuration.ConfigurationSettings.AppSet tings' is
obsolete: 'This method is obsolete, it has been replaced by
ConfigurationManager.AppSettings'

i tryed to follow Microsofts suggestion to use ConfigurationManager.

Michael
"Alex Feinman [MVP]" <pu*********@alexfeinman.com> schrieb im Newsbeitrag
news:uR**************@TK2MSFTNGP10.phx.gbl...
I think it should be
string s=System.Configuration.Configuration.AppSettings["server"];
--
Alex Feinman
---
Visit http://www.opennetcf.org
"Michael Debus" <md****@orcasoft.de> wrote in message
news:da*************@news.t-online.com...
Hi, I try to read a value from app.config file using this code:

string
s=System.Configuration.ConfigurationManager.AppSet tings["server"].ToString();

I got the compiler error:

Error 1 The type or namespace name 'ConfigurationManager' does not exist
in the namespace 'System.Configuration' (are you missing an assembly
reference?) .

A reference to System.Configuration.dll is added to the project.

My System.Configuration.dll has Version 2.0.50215.44. I there a newer
version ?

Thanks
Michael

Nov 17 '05 #3
Should work in 50215 are you sure you did add areference to
System.Configuration.dll!.
Note that you might get better answers when posting to
http://forums.microsoft.com

Willy.

"Michael Debus" <md****@orcasoft.de> wrote in message
news:da*************@news.t-online.com...
Hello,
System.Configuration.ConfigurationSettings.AppSett ings["server"];
works.

but i'v got a warning:
Warning 2 'System.Configuration.ConfigurationSettings.AppSet tings' is
obsolete: 'This method is obsolete, it has been replaced by
ConfigurationManager.AppSettings'

i tryed to follow Microsofts suggestion to use ConfigurationManager.

Michael
"Alex Feinman [MVP]" <pu*********@alexfeinman.com> schrieb im Newsbeitrag
news:uR**************@TK2MSFTNGP10.phx.gbl...
I think it should be
string s=System.Configuration.Configuration.AppSettings["server"];
--
Alex Feinman
---
Visit http://www.opennetcf.org
"Michael Debus" <md****@orcasoft.de> wrote in message
news:da*************@news.t-online.com...
Hi, I try to read a value from app.config file using this code:

string
s=System.Configuration.ConfigurationManager.AppSet tings["server"].ToString();

I got the compiler error:

Error 1 The type or namespace name 'ConfigurationManager' does not exist
in the namespace 'System.Configuration' (are you missing an assembly
reference?) .

A reference to System.Configuration.dll is added to the project.

My System.Configuration.dll has Version 2.0.50215.44. I there a newer
version ?

Thanks
Michael


Nov 17 '05 #4
Perhaps my suggestion is stupid, but why don't you use the
Properties.Settings class ? It directly maps values in the app.config and
you can read/write using this kind of code :

string s = Properties.Settings.Default.Server;

"Michael Debus" <md****@orcasoft.de> a écrit dans le message de news:
da*************@news.t-online.com...
Hi, I try to read a value from app.config file using this code:

string
s=System.Configuration.ConfigurationManager.AppSet tings["server"].ToString();

I got the compiler error:

Error 1 The type or namespace name 'ConfigurationManager' does not exist
in the namespace 'System.Configuration' (are you missing an assembly
reference?) .

A reference to System.Configuration.dll is added to the project.

My System.Configuration.dll has Version 2.0.50215.44. I there a newer
version ?

Thanks
Michael

Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Myo Zaw | last post by:
hi, can i use configurationmanager in .net 2.0 windows form. cause i have an app.config file and i couldn't extract the data from there by using configurationmanager nor 1.1 feature. do u have any...
2
by: robertino | last post by:
Hi All, (VS 2005 Pro, Win XP Pro) I'm trying to read some app settings from my app.config file (normal Win app), have included the System.Configuration namespace in my app, but when I try to...
3
by: natasha | last post by:
Hello everybody, you can use ConfigurationManager.AppSettings.Set method (ConfigurationManager is in System.Web.Configuration namespace) to store a modified value from web.config. To be...
1
by: shapper | last post by:
Hello, I create a few VB classes under app_code of a web site. Now I am trying to create a library project. Something strange is going on. I have the following line: Dim connectionString As...
3
by: Mark | last post by:
I am trying to read the appsettings section of a configuration file using the ConfigurationManager object (ASP.NET application) with the following three lines but for some reason the...
4
by: Jim in Arizona | last post by:
I've been using VB 2005 for a few years now. My entire coding history is VB related. This weekend I decided to start learning C#. I'm at work now and decided to do some coding in C# that I would...
2
by: remya1000 | last post by:
i'm using VB.NET 2003. Last time while i did a program in Vb.Net 2005, i use "Configuration". and i could read and write to that XML configuration file like the example below. CODES:...
2
by: pantagruel | last post by:
Hi, I have a Visual studio 2005 project that runs as a Windows Service. In it I have declared that I am using System.Configuration. I have set one application setting for the service using the...
3
by: Jeff | last post by:
I have a solution with two projects. Project A is the startup project, while Project B serves as the project with the data logic. At run time, the first thing I need to do is write to Project...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.