HttpModule over Global.asax when hosted in SharePoint

Topics: Web Client Software Factory, User Forum
Jul 21, 2008 at 1:29 PM
Hi All,


I was previously assigned a task to integrate WCSF on SharePoint, mainly the first step is to verify if it is possible for a WCSF web site can run under the site collections of SharePoint....My answer is YES and it is possible, but with a lot of exploring and experimenting due to scarce references and no step by step documentation on the said scenario.

Anyways, to cut the story short the said scenario entails a lot of challanges. One of the challenges is having ambiguity on using global.asax under SharePoint, which your app is hosted and the app itself having a global.asax to initialize your custom container upon Application_Start event, that is for my case. The intial goal of my app's global.asax is to initialize my custom container only once for the entire application lifetime, but instead it coincides with the global.asax of SharePoint whenever I tried to host my app under the site collections.
So with a lot of researching and asking around amongst colleagues, I had to make use of HttpModule as an alternative for my global.asax.

The problem is everytime a request is made on the page, my custom HttpModule is being called and executed does leading to perfomance issues.
Meaning my custom container will always be initialized even if I included a flag if it's initialized or not.

Is there anther way or much optimized approach in order to address the said performance concern?
Jul 21, 2008 at 6:10 PM
Edited Jul 21, 2008 at 6:11 PM

First, congrats on getting WCSF to work with SharePoint. 

Second, as an FYI, p&p is looking at providing guidance on how to build sharepoint applications, but this project is still in the very early, exploratory stage.

Finally, last week I blogged about a proof of concept  (Proof of Concept: a simple DI solution for ASP.NET WebForms) that Chris Tavares (Lead Dev on Enterprise Library and Unity) on an HttpModule that uses Unity and provides a container for your web application.  You may want to take a look, and use either the Unity container or the WCSF container from CWAB in your application.

Good Luck,
Michael Puleio -- patterns & practices
http://blogs.msdn.com/mpuleio