6

I am setting up a Jenkins server to build .NET projects. We our using the visual studio Web.config transformations to transform our config files for each environment (Dev1, Dev2, QA, and Release). I am using the following command line arguments in my MSBuild command, and it is working with the transformations:

/p:Configuration=Dev1;DeployOnBuild=true;DeployTarget=Package;_PackageTempDir=..\..\deploy\current\Dev1

The problem is that I have to rebuild the solution for each environment, and some of the solutions are quite large and take a some time to build. I would like to only build the solution once, and then trigger just the transformations for the other environments. Does anyone know of a way to do this through an MSBuild batch command, or another way to get this done in Jenkins?

2
  • Seems to me that you should figure out how to do this without using Jenkins (i.e. from the command-line) and once you have only then incorporate the solution into Jenkins. Commented Mar 21, 2012 at 23:15
  • Agreed. That's what I'm trying to do. Jenkins is basically just executing command line commands. Commented Mar 22, 2012 at 11:55

2 Answers 2

3

I ended up using this Config Transform Tool on CodePlex. It did the trick easily by allowing us to run web.config transforms from a command line script that is easily executed by a Jenkins build step.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. This does the job. Only thing is the end result isn't pretty :-). Not sure why this approach is not the default. Have been looking around the web for the last 30 minutes.
0

As you mentioned, Jenkins just run the command. Take a look at the Task 5 of this Exercise from Microsoft. There's another approach here.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.