web.config, HTTP Module, and the GAC

W

Wayne Sepega

I have a web.config in the root of my website, in the web.config I have
defined an HTTPModule that is to be loaded into any application under the
website. Also defined in the web config is a custom configuration section,
and the custom section points to a file, the file is in the same directory
as the web.config. The HTTPModule references an assembly that knows how to
read this custom configuration section. The HTTPModule and referenced
assemblies are in the GAC.

The problem:
When my application loads the HTTPModule tries to read the custom section
and is unable to find it and as such throws an error.

What I have tried:
1) Adding the custom config to the application directory
2) Adding the custom config to the app dir and declaring the custom
section in the app's web config
3) C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG <-- modified the
web.config to define the custom section, copied the custom file to that dir.
Performed IISReset.
4) Adding the custom config to the app dir, declare the custom section in
the app's web config, and adding a reference to the HTTPModule and other
assemblies.

1, 2 and 3 did not solve my issue and 4 did work. However, 3 is not an
option as it makes no sense to reference an assembly that I wish to be able
to dynamically load.


I'd rather not place the files at the machine level to fix this, incase
there is something I may have missed in my testing, as the custom file needs
to be able to be different for each app.

Any ideas someone may have would be greatly appreciated.

Thanks
Wayne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top