Click here to Skip to main content
13,349,032 members (69,212 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


5 bookmarked
Posted 23 Jan 2013

ASP.NET Web Config Transform Console Utility Released on Nuget

, 23 Jan 2013
Rate this:
Please Sign up or sign in to vote.
ASP.NET Web Config Transform Console Utility released on Nuget


ASP.NET Web.config transformations are a great way to manage configuration differences between environments. You can easily change a database connection string or change the compilation model for ASP.NET. Here is a link to the syntax documentation on MSDN. The problem with web.config transformations is that it has been historically really hard to run the transforms. The tooling to do this was buried into Visual Studio. The ASP.NET team just released a library to run the transformations as a nuget library.


Using that library, I created a very simple command line tool to transform config files WebConfigTransformRunner is the package containing this utility.

install-package WebConfigTransformRunner


WebConfigTransformationRunner.exe WebConfigFilename TransformFilename OutputFilename


I see this package being used in two ways.

First, using this in an automated build as part of a packaging process to pre transform configuration files for different environments. This was the main reason I created this library. I am using it in a build in TeamCity to transform my web.config file for an ASP.NET MVC application as part of an automated CI build and deploy.

The second scenario that seems very useful would be to access this package from the install script (install.ps1) from a nuget package. The current configuration transformations that nuget supports is very limited. It works best when you have static configuration nodes that will never change. If you have a node that has an attribute that a user / developer may change, then using a configuration transformation would be more reliable. Since this tool is delivered as a nuget package, the command is available in the path of the nuget console, so a package that needs to run a transformation would just need to take a dependency on this package, then it could run the EXE command from the install script, on the files it wants to transform. I could see running the main web.config with a transformation that is located in the packages content folder, for example.

Want to Help?

The project is open source and available on github. Please submit issues, ideas or pull requests!


This article, along with any associated source code and files, is licensed under The Apache License, Version 2.0


About the Author

eric hexter
Chief Technology Officer
United States United States
I am an Architect for on the Engineering Excellence team. I (co)Founded MvcContrib, Should, Solution Factory, and Pstrami open source projects. I have co-authored MVC 2 in Action, MVC3 in Action, and MVC 4 in Action. I am a Microsoft MVP.

I have founded some online conferences like aspConf, mvcConf, Community For MVC

You may also be interested in...


Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.180111.1 | Last Updated 23 Jan 2013
Article Copyright 2013 by eric hexter
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid