4

I have an application that will be deployed onto quite a few servers and virtual machines here. This application heavily relies on certain file locations and URLs (which can be different depending on what part of the corporate network it's on, if it needs a domain name, if it uses a mapped drive, etc...). Some of these deployments are not guaranteed to be setup by me, some will be set up by other end users.

My solution was to put these into values in the app.config file, so that after deployment, whoever is setting the application up on a server has to just change the app.config settings for what works for that server.

I then found out about ClickOnce deployments which can help simplify the deployment and updating of the application, which will make things much simpler.

The problem is I cannot find a reliable way to allow users to change the values in app.config, and preferably keep those values post-updating. From what I have found on the web, if you modify a system file it will think the file is old and download the latest version of that file, thus undoing any modifications to app.config. It also seems like new versions are deployed into a totally different folder than previous versions, so upgrading the application will completely wipe out previous modifications.

I have searched the web and am coming up empty handed. Does anyone here have any suggestions on how to handle this?

2 Answers 2

2

I'd put as many of those values as you can in a database table, then give administrators a front-end to change their user's settings.

4
  • Except then I have to find a database that is visible to all servers equally, and then have the extra hassle of creating a table structure to store app settings on a per-server basis. Isn't this the whole reason app.config exists in the first place? It works just fine without clickonce.
    – KallDrexx
    Jan 20, 2011 at 18:22
  • I take it your application doesn't use a db already. In that case, introducing a settings table isn't worth the overhead. The table shouldn't be per-server, just one for your application.
    – Beth
    Jan 20, 2011 at 20:02
  • No this application doesn't talk to a DB currently, only a web server. Regardless the settings i need to change are different depending on what machine the application is setup on, and the configuration of that machine. Thus application wide settings for every instance is not applicable.
    – KallDrexx
    Jan 21, 2011 at 16:08
  • No, of course not. They should vary per user, or machineID, or whatever, but if you don't have a db already, then it doesn't matter.
    – Beth
    Jan 21, 2011 at 19:52
1

I have solved this by using user scoped application settings, as described here. While it isn't the best method (since it's user specific not application specific), since my app is only run by one user this is fine.

When the user changes their settings, the changes persist across updates.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.