I am creating setup of my project using Visula Studio 2008. I am facing problem in setup installation.
If I uninstall old setup (application) and install the new one then config file (App.config) updates the attributes (surely it is new file) of config file but if I install new setup without uninstalling the old one then config file does not update.
from config file I mean MyProject.exe.config
Why is this behavior of config file. Should it not be updated on installation of the new setup
Is this possible to delete and copy the config file of new setup?
Is there a way to update o开发者_如何转开发nly config file forcefully during installation.
Thanks for your help!
The "app.config" per se in your project directory won't be and shouldn't be deployed!
When you compile your project, you should get a YourProject.exe.config
in your bin\debug
or bin\release
folder. That file should be updated with each compile (if needed), and if you add your "project output" to the setup project, it should be included in that setup.
Does your YourProject.exe.config
get installed on a new install? Does it get properly removed on uninstall?
MyProject.exe.config won't be updated since this file typically contains data or information depending on decisions the admin or user has taken during the first installation process (or afterwards by manually changing this file). This information would get lost if the file is overwritten during an update.
However, when you have to add some new configuration options to MyProject.exe.config in your newest version of MyProject , you can build a custom action to your installer and add those new options to the existing file without overwriting the content.
精彩评论