Where should i put my custom HTTP Module that Implement “IHttpModule” interface to SharePoint 2010 and make it functional?

sharepoint.stackexchange https://sharepoint.stackexchange.com/questions/16291

  •  16-10-2019
  •  | 
  •  

Pergunta

I create my httpmodule base on this article Global Exception Handling in SharePoint but he didn't said how can i use this in sharepoint 2010 and where should i put this and make it functional.
as far as i know, i must put the "add" tag in "module" or "httpmodule" section into web.config file and add the dll file into GAC or "bin" folder to make it work, am i right?

Foi útil?

Solução

Indeed, that should be all you need to do to get the module to work.

I would wrap this up though in a solution that deploys the DLL to the GAC, and a Farm-scoped Feature with Receiver Code that injects the required lines into web.config using SPWebConfigModification.

You could do it manually, but if you have multiple web front ends, this method will ensure the are all synchronised and have the exact same changes made to all of them.

Plus, uninstallation is easier (you just need deactivation code to remove the lines from webconfig, again using SPWebConfigModification). And when you retract the solution, it'll remove the DLL from the GAC for you. Again, all of this is synchronised across all your web front ends.

Outras dicas

You may want to consider an alternative to the blog poist your referenced that does not require a custom HTTP module. SharePoint 2010 allows you to register your own custom error page without the need for a custom HTTP module.

http://todd-carter.com/post/2010/04/07/An-Expected-Error-Has-Occurred.aspx

Licenciado em: CC-BY-SA com atribuição
Não afiliado a sharepoint.stackexchange
scroll top