cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
hyagli
Level 2

asp.net web project setup

Hi there,


I am using Visual Studio 2012 with InstallShield LE 2013. I created a new setup project for my asp.net mvc web application. Everything works OK except that when I deploy the setup file to the server I get 3 config files. web.config; web.release.config; web.debug.config
I only want to have 1 web.config file which should be the one merged with web.release.config (just like when I use Publish command)

What do I do to get this file?
0 Kudos
(1) Reply
chiranjeevi
Level 7 Flexeran
Level 7 Flexeran

Hello,

It's the new Web.config transformation feature of Visual Studio 2010. More information is available at

http://blogs.msdn.com/b/webdev/archive/2009/05/04/web-deployment-web-config-transformation.aspx

http://blogs.msdn.com/b/webdev/archive/2010/10/26/asp-net-web-projects-web-debug-config-amp-web-release-config.aspx

It isn't limited to three files; you could (in theory) have as many files as you have environments. The "top level" Web.config provides a template of your web config. The files under it provide replacement values specific to that environment (like if you have different connection strings for local/stage/test/whatever).

You can perform web.config transforms using msbuild. You could put this in your project's After Build target to aid your debugging.

You need to look at the TransformXml msbuild target, passing in:Source=path_to_your/web.configTransform=path_to_your/web.$ (ConfigurationName).config andDestination=path_to_your/web.config

Hope this helps.

Regards,
Chiranjeevi
0 Kudos