System.Configuration.ConfigurationManager problems, like it doesn'texist.

P

pantagruel

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 settings
panel.

When I try to do the following;

ConfigurationManager.AppSettings[name of the setting being used];

I get the error warning that Error 2 The name 'ConfigurationManager'
does not exist in the current context

If I try the
System.Configuration.ConfigurationManager.AppSettings it tells me that
ConfigurationManager is not part of System.Configuration.

If I try to use ConfigurationSettings of course it tells me that it is
obsolete, which is undoubtedly a bad thing but I really like the thing
that it works as opposed to the correct ConfigurationManager which
doesn't.
 
M

Mr. Arnold

pantagruel said:
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 settings
panel.

When I try to do the following;

ConfigurationManager.AppSettings[name of the setting being used];

I get the error warning that Error 2 The name 'ConfigurationManager'
does not exist in the current context

If I try the
System.Configuration.ConfigurationManager.AppSettings it tells me that
ConfigurationManager is not part of System.Configuration.

If I try to use ConfigurationSettings of course it tells me that it is
obsolete, which is undoubtedly a bad thing but I really like the thing
that it works as opposed to the correct ConfigurationManager which
doesn't.

Go to Reference for the project, the .Net tab, remove the reference for
System.Configuration, and then add the reference back. You can see if that
corrects your problem.
 
P

pantagruel

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 settings
panel.
When I try to do the following;
ConfigurationManager.AppSettings[name of the setting being used];
I get the error warning that Error 2 The name 'ConfigurationManager'
does not exist in the current context
If I try the
System.Configuration.ConfigurationManager.AppSettings it tells me that
ConfigurationManager is not part of System.Configuration.
If I try to use ConfigurationSettings of course it tells me that it is
obsolete, which is undoubtedly a bad thing but I really like the thing
that it works as opposed to the correct ConfigurationManager which
doesn't.

Go to Reference for the project, the .Net tab, remove the reference for
System.Configuration, and then add the reference back. You can see if that
corrects your problem.

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top