views:

360

answers:

2

Hi,

In the Setup Project I have 2 web.config files: web.config - used during the development and web_dist.config - the one that should be included into Setup Project.

I must be sure the the Setup project will NOT include the web.config and will always include web_dist.config.

In the File System -> Web Application Folder I have added the Content Files from the project.
Also included the web_dist.config and mapped it to the web.config.

But this gives the warning:

WARNING: Two or more objects have the same target location ('[targetdir]\web.config')

And the actual config file included is web.config and not web_dist.config.

What would be the best option to include the web_dist.config (and named as web.config in the setup)?

Thanks,
Dmitriy.

+1  A: 

http://msdn.microsoft.com/en-us/library/zhx4ah11(VS.80).aspx

Does following trick work in your case?

You can correct this by adding a Custom folder and setting its DefaultLocation property to the same value as the first folder, then moving the second copy of the file to the new folder.

Vishal Seth
This won't actually help as the `web.config` comes from the "Content Files" of the application and `web_dist.config` is manually added. With the workaround proposed it seems I will have the initial `web.config` in the installation which must not be done. Though, I got couple of ideas now. Will try to experiment.
Dmytrii Nagirniak
A: 

I was able workaround this by setting "Build Action" for the web.config to "None".
This way it doesn't get included into the setup package.

Then I just added another config file manually.

Works like a charm for this particular situation.

Dmytrii Nagirniak