Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I'm writing an application that will run on a Windows Server that will keep track for things and wake up every so often passing and running a program or two that will send information across the network.

My question is where do I store the values of the setup configuration? If I use the registry, I will need a higher privilege to store the information there. If I use app.config is the information available to the application even if nobody signs on to the server? I currently do not have a Windows Server to test this on.

Thank you,
Glenn
Posted
Comments
Ron Beyer 5-Dec-13 13:29pm    
Why would you need a windows server to test it? Any windows machine can run a windows service. I would go with the app.config or create your own settings file and store it in the ApplicationData directory.

1 solution

Ron is right - app.config or a file is the best solution. Don't use the registry for anything unless you really have to - it was badly abused in the "old days" and access is now restricted, and likely to get more restricted as time goes on.

Personally, I'd use my own file in a "open" folder - this might help: Where should I store my data?[^]
 
Share this answer
 
Comments
gmhanna 5-Dec-13 14:32pm    
If nobody logs on though and the service is running, will it have access to the data in app.config? I'm confused by it calling it "User Data", is that associated to a UserID?
Dave Kreskowiak 5-Dec-13 16:27pm    
Services do not care if anyone logs on or not. They run under a completely different desktop from the console.

You do have to specify which account your service is going to run under. The most popular being LocalSystem, but it's a better idea to create an account specifically for your service. Yes, services have to login to Windows, no different from other users.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900