VS2005 NT Service AppSettings Null Reference

G

Guest

I am attempting to use AppSettings within an NT Service built with VS2005 and
C#. This idea worked ok in v1.1, but seems to fail in v2.0. I've done some
searching and have seen similar situations but no real resolution.

The AppSettings collection is NULL, although there are two strings in the
config file. I even used the tool to create these files, so I don't believe
that it is a spelling error or something similar.

Is there something special that I need to do in order to make these settings
available to the service ? I have this working just fine in a VB app, it
appears to be an issue with the service. Thanks for the help.

I'm stuck at the moment and I don't wish to hardcode the settings.

Rick
 
N

Norman Yuan

By any chance, are the settings configured as user setting, not application
setting? You surely know Win Services are to run without user logged in.
 
G

Guest

Good thought. When I first set this up, it was set as a User setting by
mistake, which I noticed when I looked at the .config file. It is set as an
Application setting. Also, I ran this outside of the debugger, just to make
sure that it wasn't a case of not finding the config file properly.

The interesting thing to me is that this worked in a 1.1 service. What is
different in 2.0 with this ?

Thanks for the reply
 

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