views:

424

answers:

3

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 only config file forcefully during installation.

Thanks for your help!

+1  A: 

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?

marc_s
Thanks marc_s you have helped me before I really appreciate. You are right from config file I mean MyProject.exe.config. It is included in my project output and it properly removed on uninstall and properly install on new installation. On new installation (after removing old setup) there is no probelm. It does not update when I install my setup without unistalling the ole one.
Muhammad Kashif Nadeem
A: 

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.

Doc Brown
+1  A: 

I'm having the same problem.

Here's your answer : http://stackoverflow.com/questions/621265/net-2-0-application-settings-user-config-file-location

Run CMD

related questions