Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to setup web.config for build to multi-environments without code changes?

I recently worked on an app in a very interesting environment. There was 6 or 7 parallel levels for this application and only the 1st 2 levels were able to be touched by developers. As part of the company policy all builds were done as Tivoli packages, and very complex to setup.

The final kicker was that no code changes are allowed past the 1st level or "Dev" servers so web.config contained multiple encrypted sections of environment variables. The application is built to sense what environment its on by path and variables set in IIS.

This is a beast to maintain so what is a simple or better architecture for this type of problem?

like image 764
Tj Kellie Avatar asked Mar 08 '26 01:03

Tj Kellie


2 Answers

Hmm, (disclaimer: I'll talk about something I've written)

Your subject seems slightly different from the post, but I think I have an idea of what you mean. The tool I'm writing, dashy, lets you handle a single codebase, and lets you configure it for various enviroments. It doesn't, however, place security restrictions on these enviroments over the other. But, depending on your source control, and general system, it may be of interest. You should get a reasonable idea of the way it works from the picture on the homepage. Perhaps it's of interest, perhaps not, but it's what we use to manage deployment to different environments. It's a work in progress ("beta") at the moment, but the current version is suitable for testing.

like image 189
Noon Silk Avatar answered Mar 09 '26 16:03

Noon Silk


The latest version of ASP.NET now supports web config transformations, allowing you to change specific settings within your project for deployment, testing or staging. Here's a great intro by Tom Hundley.

like image 25
Daniel Bradley Avatar answered Mar 09 '26 16:03

Daniel Bradley



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!