简体   繁体   中英

Is it possible for end users to change an application's app.config after Clickonce Deployment?

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?

我将尽可能多的值放在数据库表中,然后给管理员一个前端来更改用户的设置。

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM