0

I need some help on how to handle web.config file using a single deployment project for multiple environment.

I am currently working on automating the build and deploy of an ASP.NET Web Application developed using VB.Net in Visual Studio. The solution have a deployment project (.vdproj) which creates MSI. Currently there are deployment projects setup for each environment (e.g.: Setup.DEV, Setup.UAT, Setup.PROD). Each setup have its own web.config file embedded to the MSI after build.

Our automation pipeline uses jenkins for build and urbancode deploy for deployment. I can now build the solution and projects, create the msi thru jenkins. I need to configure urbancode to use the msi and deploy to the desired environment.

However, I think having multiple deployment projects to create MSI for each environment is not ideal.

I want to use a single deployment project and use it for the deployment but I am not sure how should I handle the web.config files which are specific to the environment being deployed to.

Ganuelito
  • 83
  • 6
  • You'd have to make the MSI do the config transform. So it would need to contain all the .config files, and some custom step to execute the transformation. – ADyson May 21 '19 at 02:20
  • But I'm not sure you need / can have one MSI to rule them all. Not all builds are created equal...e.g. your live build will not have debug flags set, may use minified versions of JavaScript files etc. So maybe the MSI would carry separate copies of each possible build and simply lets you choose which build to install. That would also solve the config problem of course. But it might be a big installer. I'm not really sure what advantage this gives you though...you should be able to pick the correct MSI for any given installed without difficulty? – ADyson May 21 '19 at 02:24

0 Answers0