473,385 Members | 2,243 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

web.config custom config handler is not flushed

Hi,

I have created a custom Config handler for reading a custom config section
in my .config file(s)
It works very well!

I have placed a web.config in my root directory and then I use sub files in
sub diretories overriding various settings in the config file. Very nice
strategy which really makes it easy to customize generic applications.

One problem makes it all useless though. The settings is cached by ASP.NET
which makes switching app impossible.

So the obvious question is - where can I either flush the cache or disable
it...

thnx in advance /Mads B - Copenhagen Denmark
Nov 19 '05 #1
3 1700
what's being cached? A value from the web.config?
If you want it reset either restart that app pool, that site, or re-save the
web.config (forces a restart of app).

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Mads Brydegaard" <Mads Br********@discussions.microsoft.com> wrote in
message news:C9**********************************@microsof t.com...
Hi,

I have created a custom Config handler for reading a custom config section
in my .config file(s)
It works very well!

I have placed a web.config in my root directory and then I use sub files
in
sub diretories overriding various settings in the config file. Very nice
strategy which really makes it easy to customize generic applications.

One problem makes it all useless though. The settings is cached by ASP.NET
which makes switching app impossible.

So the obvious question is - where can I either flush the cache or disable
it...

thnx in advance /Mads B - Copenhagen Denmark

Nov 19 '05 #2
thnx but:

The setup is as follows:
I have a web app running with a web.config file

I have then made some sub directories (/app_root/app1 and /app_root/app2)
also containing each a web.config file.

Now if I place the same appSetting node in both the /app_root/web.config and
in /app_root/app1/web.config I only see the most derived - hence the last one
- when querying from the app1 directory. If I also place it in app2/web.config
and then switch from app1 to app2 I actually get the derived setting from
the app2 web.config file instead.

This is very usefull.

Now I have made my own config section reader which Implements
IConfigurationSectionHandler etc.

I still get the most derived when querying - but if I switch directory I get
a cached result - hence if I query app1 I get a correct derived value but if
I then switch to app2 I get the app1 value.

This is true at runtime.

So my conclusion is that the values are cached based on session but though I
have tried to reset everything I cannot free the cache. It must be done at
runtime!

when experimenting with appSettings - no cached problems occured so I know
there is a way!

Hope it makes sense.

regards Mads B

"Curt_C [MVP]" wrote:
what's being cached? A value from the web.config?
If you want it reset either restart that app pool, that site, or re-save the
web.config (forces a restart of app).

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Mads Brydegaard" <Mads Br********@discussions.microsoft.com> wrote in
message news:C9**********************************@microsof t.com...
Hi,

I have created a custom Config handler for reading a custom config section
in my .config file(s)
It works very well!

I have placed a web.config in my root directory and then I use sub files
in
sub diretories overriding various settings in the config file. Very nice
strategy which really makes it easy to customize generic applications.

One problem makes it all useless though. The settings is cached by ASP.NET
which makes switching app impossible.

So the obvious question is - where can I either flush the cache or disable
it...

thnx in advance /Mads B - Copenhagen Denmark


Nov 19 '05 #3
The solution is:
return string values from the Config Handler object and not object references.
references will be cached but not values.

/Mads B

"Mads Brydegaard" wrote:
thnx but:

The setup is as follows:
I have a web app running with a web.config file

I have then made some sub directories (/app_root/app1 and /app_root/app2)
also containing each a web.config file.

Now if I place the same appSetting node in both the /app_root/web.config and
in /app_root/app1/web.config I only see the most derived - hence the last one
- when querying from the app1 directory. If I also place it in app2/web.config
and then switch from app1 to app2 I actually get the derived setting from
the app2 web.config file instead.

This is very usefull.

Now I have made my own config section reader which Implements
IConfigurationSectionHandler etc.

I still get the most derived when querying - but if I switch directory I get
a cached result - hence if I query app1 I get a correct derived value but if
I then switch to app2 I get the app1 value.

This is true at runtime.

So my conclusion is that the values are cached based on session but though I
have tried to reset everything I cannot free the cache. It must be done at
runtime!

when experimenting with appSettings - no cached problems occured so I know
there is a way!

Hope it makes sense.

regards Mads B

"Curt_C [MVP]" wrote:
what's being cached? A value from the web.config?
If you want it reset either restart that app pool, that site, or re-save the
web.config (forces a restart of app).

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Mads Brydegaard" <Mads Br********@discussions.microsoft.com> wrote in
message news:C9**********************************@microsof t.com...
Hi,

I have created a custom Config handler for reading a custom config section
in my .config file(s)
It works very well!

I have placed a web.config in my root directory and then I use sub files
in
sub diretories overriding various settings in the config file. Very nice
strategy which really makes it easy to customize generic applications.

One problem makes it all useless though. The settings is cached by ASP.NET
which makes switching app impossible.

So the obvious question is - where can I either flush the cache or disable
it...

thnx in advance /Mads B - Copenhagen Denmark


Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: some guy with a computer | last post by:
I can not get a custom httpHandler to fire using machine.config and an assembly in the GAC. It will not work if I move the assembly to the GAC, even though I have it referenced correctly and add...
1
by: Shaun | last post by:
Hi, I created a custom Section handler using System.configuration for Web application to read from Web.Config File. If I want to use the same handler to read from app.config file: app.config is...
0
by: Søren Lund | last post by:
Hello, I have implemented a custom config section handler by implementing the IConfigurationSectionHandler interface. I have registered this handler in web.config and everything works fine ......
6
by: Tabi | last post by:
Hi, I want to create a custom section in my web.config that can hold my custom values. I created a section in web.config as written below. <configSections> <section name="myCustomSection"...
4
by: WB | last post by:
I'm just starting out with C# after many years with VB 6.0. I'm trying to fill a listbox with a list of computer names (almost 100) from app.config. First, is app.config the place to store and...
10
by: Ryan | last post by:
I've created a custom configuration section that inherits (naturally) from System.Configuration.ConfigurationSection. The configuration section is working 99% fine, however I keep coming across a...
1
by: Vlad | last post by:
Hello everybody, I have a problem with custom error page. I' using a redirection in a web.config file to a custom error page: <customErrors mode="RemoteOnly"...
3
by: =?Utf-8?B?Q2h1Y2sgUA==?= | last post by:
I replace a lot of web.config sections during compile. I am having trouble with a custom section is it possible to replace a custom section? Error 44 web.config(1): error WDP00002:...
3
by: Lowell Alleman | last post by:
Here is the situation: I wrote my own log handler class (derived from logging.Handler) and I want to be able to use it from a logging config file, that is, a config file loaded with the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.