Search code examples
c#.netdesign-patternsconfigurationconfiguration-files

Where to put files used by a .Net application


Here is a question not about code but about patterns. I'm developing a .Net application that needs to use three files in order to work properly.

  • File 1: Has the app settings created by a configuration form
  • File 2: Binary file that contains a set of serialized objects used as a playbook that the application follows in order to realize sequential tasks.
  • File 3: A sqlite database used as a record cache that the application updates on every start

Now my question is about file location, where to put this files? On Program Files or AppData inside the users's Documents And Settings.

Thanks in advance.


Solution

  • AppData should always be preferred, since it requires less permissions (you might need Administrator permissions to create / updated files in Program Files).

    Also it depends whether data should be personalized or global for all users. Take a look at this post