Hi All,
I have created an Windows Service where I am using App.Config for global variables. But, it is always returning null values (string xyz=ConfigurationSettings.AppSettings["abc"]) for all the variables I have declared in App.Config.
(But the same thing if I am doing as a Windows Application then it's returning the right values.)
Interestingly, this same Windows Service is working properly in another machine but not working in other three machines.
Can anyone please help me to resolve this issue.
Thanks a lot.
Regards,
Lita.

App.Config returning null values in Windows Services but returns right values in Windows Application.
MiFra
Hi Mubshir,
Thanks for your reply. Yes, my exe.Config file is there in the root dir of the Windows Service where .exe resides.
Regards,
Lita
TheBlackNoodle
Hi Mubshir,
We are using .NET Framework version 1.1 and I think Configuration Manager is part of Version 2.0. Do you have any other suggestion for me
Thanks for your quick answers.
Regards,
Lita.
JSheble
Hi,
I have created many Windows Services that uses the exe.Config files to get some input. But there has never been any problem.
Are you sure that exe.config file exists in the root dir of the Window servie where .exe reside!
MikG
Hi Mubshir,
I cought the error. Actually I had declared lot of variables in my App.config. In one place, instead of "value" I had written "valae" and because of this I was facing problem.
Thanks a lot.
Regards,
Lita.
Anonymo3qetwf
Chris Cornell
Hi Lita,
Try Configuration Manager...
System.Configuration.ConfigurationManager.AppSettings["key"].ToString();
Hope this works
bosstan1
Hi,
I could have asked for App.Config but i assumed that i will be ok as you said
_____________________________________________________________________________
(But the same thing if I am doing as a Windows Application then it's returning the right values.)
Interestingly, this same Windows Service is working properly in another machine but not working in other three machines.

______________________________________________________________________________
Any ways thats greate, finally you caught error, Cheers!
Epiana
Hi Mubshir,
We are using .NET Framework version 1.1 and I think Configuration Manager is part of Version 2.0. Do you have any other suggestion for me
Thanks for your quick replies.
Regards,
Lita.