Dibzmania
Dibzmania

Reputation: 1994

How to setup Jenkins job to handle ASP.Net Solution with multiple configurations (differing only in Web.config)

We have a ASP.Net solution which has multiple projects and 4 different build configurations (debug, Test, Preprod, prod). There is no build configuration check in the code and hence the only difference between the different configurations is basically the configuration (in web.config).

What would be an ideal Jenkins job setup, so that the job spews different folders for each configuration with same bin and repective configuration.

Upvotes: 4

Views: 936

Answers (2)

Ankit Das
Ankit Das

Reputation: 650

You can use web.config transform for the config transformation for various environments. Then you can try using Jenkins plugin for TFS and perform multi-server deployments easily using TFS CI and CD.

Upvotes: 0

yogesh keraliya
yogesh keraliya

Reputation: 156

We have done exactly same deployment for our asp.net webform solution for different configuration. To acheive that you will need to do follow few steps.

  1. Create seperate publish profile in your project for each configuration(DeveloperProfile,TestProfile,LivePublish), so while you setup job in jenkins you can refer each for respective job. for ex. Under Properties>Publish Profiles Multiple publish profile setup in website project for different configuration
  2. Now in jenkins when you setup job, refer respective publish profile and settings for each environment and you will be able to acheive your goal. For ex. i am giving you picture of our test environment job configuration in jenkins which does A). Pull source code from source control before publish B). Update nuget packages before publish C). Compile and Publish Website. Jenkins job config section 1- Source Control Polling

Jenkins job config section 2- Nuget Packages Restore and Solution Build Steps

Upvotes: 3

Related Questions