Where to save application data in a .NET application

My application is similar to Contact Manager. Let's say a user can enter contacts with their addresses. I have the code and technology to save my contacts to a file. But where can I save this file?

Given that this is a .NET application running on Windows. Should my file get into the AppData folder from the user folder? Should I use isolated storage (as mentioned here )? Something other? What is the recommended practice?

+6
persistence isolatedstorage
source share
2 answers

I decided to use the solution suggested by Patrick:

Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) 
+6
source share

You have several options; as you say, one of them is isolated storage. You can also use the "Custom Settings" function and save the data as a drop of data or XML.

You can also take a look at SqlCompact for a very easy database in progress. Then you can save all user contacts in one database, which could live, for example. in the same directory as the application; you can easily use something like EF4 for your DAL.

It may be a little more effort, although it looks like you are 99% of how this happens with your current architecture.

+1
source share

All Articles