CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Brendan Tompkins [MVP]

Blog First. Ask Questions Later.

Managing Multiple .config Files

We're getting a lot of re-use out of our .NET framework here at the port.  We've got our public web site, Web Services, Windows Services, and now we're creating SharePoint Portal web parts - all using the same underlying managed framework.  I've run into a problem re-using .config files across applications.

Here's the problem.  We have a class VIT.Common.Configuration with a bunch of static methods that encapsulate access to in .config files. This works great, but it's starting to get hard to manage, because I need copies of the <AppSettings> blocks in each .config file.  I'm having to keep at least 5 of these in sync, and it's only going to get worse.   I'm going to explore creating a WebService to make this stuff available from one source, but I've got some security concerns here.  Has anyone out there any thoughts about this direction?    Are there better ways to manage multiple configurations?

-Brendan



Comments

Brendan Tompkins said:

You know, it's been so long since I used machine.config, that I forgot about it... But I remember having difficulties with it in general. In short, it was hard to manage across multiple versions of the .NET Framework. This might have been just a bug with my server, but I remember having some problems with two machine.config files in different locations. I also want to be able to deploy my configuration with my installers, and I'm not entirely comfortable having an installer messing around with machine.config.
# December 3, 2003 5:35 AM

andy maurer said:

That is an interesting diagram.

Perhaps pull your duplicate settings out of the config file and put them in a central file/db and then in the config file just have a location pointer to those settings.
# December 3, 2003 5:36 AM

Brendan Tompkins said:

To anwser your other question, I created that diagram with Visio 2003 and Visio UML (to reverse engineer my framework). I originally created it to print out a big poster, but Visio's new web export is pretty cool. You can even search for method names, and it'll point out the containing class!
# December 3, 2003 5:38 AM

X59939 said:

GATCATGATTACGGCCCGCGCTCAAGCGTTTTCGTCCCGTTGTTTGCCGTTGAGCAGGCTGCGACCACGA
CCGGAACCTGGATGCTGGCACGGATGTCCGGCGCATGTCTGGTGCCCTTCGTTCCACGCCGTAAGCCAGA
TGGCAAAGGGTATCAATTGATTATGCTGCCGCCAGAGTGTTCTCCGCCACTGGATGATGCCGAAACTACC
GCCGCGTGGATGAACAAAGTGGTCGAAAAATGCATCATGATGGCACCAGAGCAGTATATGTGGTTACACC
GTCGCTTTAAAACACGCCCGGAAGGCGTTCCTTCACGCTATTAAATCTCCCATGCCGGATGCTTCAGAAT
GGCATCCGGCATTACCACAGCAAATCCCCCTGATTTAGCGATAAAAGCTCTCTGGATTGCGCCCCCTGGA
AGTCGGGCGCATAATTAGTGTGCTTATCTTTTCTTCTTATGTTCACCGCGCCTGGCGCACCAACAGCGGA
TTGCTATGTCACCCTGTGAAAATGACACCCCTATAAACTGGAAACGAAACCTGATCGTCGCCTGGCTAGG
CTGTTTTCTTACCGGTGCCGCCTTCAGTCTGGTAATGCCCTTCTTACCCCTCTACGTTGAGCAGCTTGGC
GTTACCGGTCACTCCGCCCTGAATATGTGGTCCGGTATTGTCTTCAGCATTACATTTTTATTTTCGGCCA
TCGCCTCACCGTTTTGGGGTGGACTCGCCGACCGTAAAGGCCGAAAACTCATGCTATTACGCTCTGCCCT
CGGCATGGGCATCGTGATGGTGTTGATGGGGCTGGCACAAAATATCTGGCAGTTTTTGATCCTGCGGGCG
CTTCTTGGGTTACTTGGCGGATTTGTCCCCAACGCTAATGCTCTTATCGCCACACAAGTACCGCGTAATA
AAAGCGGCTGGGCGCTGGGTACGCTCTCCACAGGCGGCGTTAGTGGTGCGTTGCTCGGCCCAATGGCTGG
CGGCCTGCTCGCCGATAGCTACGGCTTACGTCCGGTATTCTTTATTACCGCCAGTGTGCTCATACTCTGC
TTTTTCGTCACCCTGTTTTGCATCAGAGAAAAATTCCAGCCGGTCAGCAAAAAAGAGATGCTGCACATGC
GGGAAGTGGTGACATCACTTAAAAACCCGAAACTGGTACTCAGCCTGTTTGTCACTACGTTAATCATCCA
GGTGGCGACGGGCTCAATTGCCCCCATTCTGACGCTGTATGTCCGCGAACTGGCGGGTAACGTCAGTAAC
GTCGCCTTTATCAGTGGCATGATCGCCTCGGTGCCAGGCGTGGCGGCTCTGCTAAGTGCACCACGACTCG
GCAAACTTGGCGATCGAATCGGACCCGAAAAGATCCTGATTACAGCGCTGATCTTTTCTGTACTGCTGTT
GATCCCAATGTCTTACGTTCAGACGCCATTGCAACTTGGGATTTTACGTTTTTTGCTCGGTGCCGCCGAT
GGTGCACTACTCCCCGCCGTACAGACACTGTTGGTTTACAACTCGAGCAACCAGATCGCCGGGCGTATCT
TCAGCTATAACCAATCGTTTCGTGATATTGGCAACGTTACCGGACCATTGATGGGAGCAGCGATTTCAGC
GAACTACGGTTTCAGAGCGGTATTTCTCGTCACCGCTGGCGTAGTGTTATTCAACGCAGTCTATTCATGG
AACAGTCTACGTCGTCGTCGAATACCCCAGGTATCGAACTGATTTTTCGCCTTTCATACTTGCAAAAGCG
GAGAATCAGCTATCCTTTTCCCTGAAACCTCATCAACTCAAAGGGAGAATCGTGATGACCATGTACGCAA
CGCTTGAAGAAGCCATTGACGCTGCACGCGAAGAATTTCTTGCAGACAACCCCGGCATCGACGCCGAAGA
TGCGAATGTGCAACAGTTCAATGCCCAAAAATACGTTTTGCAGGACGGCGACATCATGTGGCAAGTTGAG
TTTTTTGCCGACGAAGGGGAAGAAGGTGAATGTTTACCTATGCTTAGCGGTGAAGCCGCGCAAAGTGTTT
TTGATGGCGACTATGATGAGATAGAGATACGCCAGGAGTGGCAGGAAGAGAATACATTACATGAATGGGA
CGAGGGGGAATTTCAGCTTGAGCCACCGCTGGATACCGAGGAAGGACGCGCAGCAGCTGATGAGTGGGAT
GAACGTTAATCACTCATACGGGCCATGATGAATGTCGATCGGCAGCAGTAAAGTATCAAAAACCAGAGAG
AATGGCAGATCAAGGATCGTGACATAACGCCAGGCGGAGTCACGCACATCCCATTGCACACCGGGATAAT
ATTGGTTGCCATGCCCCTGCCCCGGTATAGTGCGACTAATAATGCTGCCACAGCCACTCAGCAAGGTCAC
CATGATGCTCACCACAATTAAACGCATTTGATACCTCTTTCGTAAAAAAATACCGGCATAACGCCGGTAT
TTTTATTGGCTCGTTGTTTTTGCCGGATGCGGCGTGAACGCCTTATCCGACCCACAAAGTCTTGCAAAAT
CAATAAATTGCAGGAACGATGTAGGCCTGATAAGCGTAGCGCATCAGGCAACTACGTTTTTATTGCGAAG
CCGCATCCGGTTTACGCAATGCCAGTGGATTGAGCTTTATCCCTTCGTAATAACTCACCCATGAAGAATA
TCTCTCCGGGGAATTC
# September 27, 2005 6:32 AM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add

About Brendan Tompkins

Brendan has been programming with .NET since the first public beta and is owner and operator of Port Technology Services, a consultancy company providing .NET application development services to the Maritime industry. In July, 2007, he was awarded the Microsoft MVP award for ASP.NET. He's also a proud co-founder of failed .COM startup Intrinsigo, and has had a hand in the failure of numerous other businesses. He currently runs CodeBetter.Com and Devlicio.us, and lives in Norfolk, Virgina with his wife Tiara and son Ian.

View Brendan's profile on LinkedIn

Check out Devlicio.us!

Our Sponsors