views:

91

answers:

1

I have a windows service that hosts a WCF end-point that is a front-end for a SQL Server CE database.

At the moment I have it at:

Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)

Question: what is most appropriate location for this file (database.sdf)?

A: 

Environment.SpecialFolder.ApplicationData is user-specific. If you have an installer for your service, I'd create a traditional C:\Program Files\MyWCFService folder and store it there.

Dave Swersky
Good point. Though, doesn't writing in c:\ProgramFiles requires elevated privileges? Or would Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) make better choice, since it is not user specific?