1

I'm coding a Windows Service.

I added the dll and namespace as shown below .

using System.Configuration;

//This line cause error but why ?

var settings = System.Configuration.ConfigurationManager.AppSettings;

Error:The type or namespace name 'ConfigurationManager' does not exist in the namespace 'System.Configuration'

Project Target is v4.0 and I successfully install and start service

Thanks.

Davut Gürbüz
  • 5,526
  • 4
  • 47
  • 83
  • do you see the ConfigurationManager dll in installed location? also look here seems dup question http://stackoverflow.com/questions/1274852/the-name-configurationmanager-does-not-exist-in-the-current-context – indiPy Dec 13 '12 at 10:55
  • thank you I think there is AppSettings missing in my config. I added it now. – Davut Gürbüz Dec 13 '12 at 11:23

1 Answers1

1

appSettings is a readonly property so we need to define in App.config I think.

<?xml version="1.0"?>
<configuration>
 <appSettings>

 </appSettings>
 ....
 <system.webServer>
   <modules runAllMan....
Davut Gürbüz
  • 5,526
  • 4
  • 47
  • 83