views:

534

answers:

2

I have a code base that has been used as an ASP.Net web application. It's now branching out and being used as part of two WinForms applications.

The main difference is that the WinForms apps should store their settings "per user" and the web app only needs to store the settings at the "application" level. They are the same settings, but stored differently depending on type of application.

Clarification: The same code will be used as the foundation for a web site application as well as the code base for a desktop application. In the desktop application the settings should be stored in the appropriate user directory, but that's not workable when the same code is running the web app. Hence the dilemma. How to switch from a web.config-type situation for the web app to a user.config-type situation (stored in the proper directory) for the desktop app.

Does anyone know if the settings.settings file is workable for a web app?

Is there a better way to store the same settings in two different ways?

A: 

Without knowing more details about your app - perhaps storing the user data (or some other centralized repository) would be best. Then users could chose either platform and have access to their preferences and settings.

rifferte
+3  A: 

Yes, you can use Settings.Settings files for web application projects. Set it up just like in your WinForms projects. With a web project, you are limited to Application scope though - you cannot create user-scoped settings.

womp