0

In my asp .Net application, how can I replace 3 config files with 3 new corresponding config files(from different directory) in web deployment package? For example

Replace A1.config, A2.config,A3.config with B1.config,B2.config,B3.config?

Champ
  • 53
  • 1
  • 8

1 Answers1

1

If you are looking to have a single configuration for each environment, like QA, UAT, DEV you probably need a Configuration Transform plugin for visual studio.It will automatically transform app.config during build process. Once the transformation is set, it will run on other build machines without the extension. Here is the link to download it and simple tutorial to get you started

Yuri
  • 2,820
  • 4
  • 28
  • 40
  • Thanks for the reply. I have a solution which has multiple deployment packages (1 package for each server). In our solution , we are using a third party dll which has 3 config files with its own connection strings. When we try to publish the connection string for each of these config files needs to be replaced. Hence, I want to add in deployment package file to replace each config file with new config files or chage connection string. – Champ Dec 09 '15 at 21:45
  • I was able to do the transforms. Thank you for sharing. DO you know how to encrypt each web config file? – Champ Dec 04 '17 at 19:09
  • Please look at this Stackoverflow article on encryption config files. It has a few very useful links https://stackoverflow.com/questions/21965/programmatically-encrypting-a-config-file-in-net – Yuri Dec 04 '17 at 19:14
  • All the links for .Net Framework 2.0. I am looking out for an example for .Net 4.6/ VS 2015 which has publish profiles. – Champ Dec 04 '17 at 19:47