Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

http modules in machine.config?

Status
Not open for further replies.

Trebor100

Programmer
Mar 14, 2006
90
GB
Morning all,

I'm just getting my head round http modules and have successfully got one working a-okay with an application using the web.config as follows:

<httpModules>
<add name="MyModule" type="MyModule.SyncModule, MyModule" />
</httpModules>

Now - i'm trying to get it so that my standard header is on all my apps without having to reference them all individually via the web.config. Everything i've read says that i just need to put an <add ... command in the httpmodules section of the machine.config. On inspecting this file i've got the following entry for httphandlers:

<section name="httpHandlers" type="System.Web.Configuration.HttpHandlersSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=..............." />

Can anyone advise as to what i need to do to change this section and add my custom reference? As you might have guessed I'm v new to working on machine.config files and have had no joy with google on this matter.

Thanks for any help you can give.

Rob

 
I would not add this to the machine.config. in doing so you are saying that every application that runs on this box must use the module. yes, you can then explicitly remove it if you don't want it. but I find it's better to explicitly include for each project rather than explicitly exclude.

if you do decide to include it here is what you need.
1. an assembly project (not console, winform, webform) with the httpmodule. This can be as simple as a project with 1 class.
2. compile project
3. copy assembly along side machine.config
4. add the module
Code:
<system.web>
   <httpmodules>
      <add name="MyModule" type="assemblyname.namespace.classname, assemblyname" />
   </httpmodules>
</system.web>

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top