Big Web.Config

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello All,

I have a ASP.net 2.0 web application where the Web.Config has gone really
huge.

This creates a lots of maintanence and deployment problems.

Is there any way to break the web.config file into multiple file or
something like that?

Thanks...
 
Curiously, what is "really huge" as far as size?

Also, what's making it a large file? If you have a large amount of AppSettings,
you can benefit from moving those values (especially if they change frequently)
to a database table. Remember, modifying your web.config will restart your
web application--a much more noticable update than simply updating a database
table of application settings.
 
In 2.0 you can have additional configuration files linked to the config
file. I do not have an example readily available, however. If I get a bit
more downtime, I will find a link.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside of the box!
*************************************************
 
Hmm, cool. I've never seen this before.

Google finds:

http://odetocode.com/Articles/345.aspx, a blog post by K. Scott Allen.

From Scott's example:

1 <?xml version="1.0" encoding="utf-8" ?>
2 <configuration>
3 <system.web>
4 <compilation defaultLanguage="c#" debug="true" />
5 </system.web>
6
7 <appSettings file="testlabsettings.config"/>
8
9 </configuration>

One note he mentions:

"One caveat to this approach is that the ASP.NET runtime does not detect
when the external file changes. You’ll need to make changes to web.config
itself for ASP.NET to launch a new version of the application with all changes
in effect."

Thanks for the tip, Gregory!

-dl
 
Back
Top