473,508 Members | 2,140 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HttpModule Init method invoked on every request

I have a strange situation that I cannot seem to get a grasp on. I have an
HttpModule defined in my web.config and the Init (from IHttpModule) method is
being invoked by ASP.NET for every request.

Anyone got any suggestions ?

ASP.NET 2.0

Cheers...

Rob
Oct 2 '07 #1
7 2238
Hi Rob,

Is it possible that your application is being restarted each request? You
can debug or add log in Application_Start event of Global.asax and verify
this. Note if during the request processing, if any of your code creates a
new subdirectory or changes bin subdirectory, the web application will be
restarted.

Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Oct 3 '07 #2
On 3 , 01:03, Robert Slaney <Robert Sla...@nospam.nospamwrote:
the Init (from IHttpModule) method is
being invoked by ASP.NET for every request.
This is the normal behaviour of HTTP Module.
http://msdn.microsoft.com/msdnmag/issues/02/05/asp/

Perhaps, you confuse HTTP Module with HTTP Handler ?

Regards,
Mykola
http://marss.co.ua

Oct 3 '07 #3
On 3 , 07:44, marss <marss...@gmail.comwrote:
This is the normal behaviour of HTTP Module.
I am sorry, I was wrong.
Mykola

Oct 3 '07 #4
Hi Walter,

The Application_Start request is NOT being invoked every time. There is
also no directory creation. Interestingly enough if I swap from IIS6 to IIS5
mode, the issue disappears.

""Walter Wang [MSFT]"" wrote:
Hi Rob,

Is it possible that your application is being restarted each request? You
can debug or add log in Application_Start event of Global.asax and verify
this. Note if during the request processing, if any of your code creates a
new subdirectory or changes bin subdirectory, the web application will be
restarted.

Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Oct 4 '07 #5
Hi Rob,

Thanks for your updated information about the IIS isolation mode.

When you configure IIS 6.0 to run in IIS 5.0 isolation mode, ASP.NET runs
in its own process model, Aspnet_wp.exe, and uses its own configuration
settings. These settings are stored in the computer-wide Machine.config
configuration file.

When running on IIS 6.0 in worker process isolation mode, ASP.NET uses the
IIS 6.0 process model settings.

#Mapping ASP.NET Process Model Settings to IIS 6.0 Application Pool Settings
http://msdn2.microsoft.com/en-us/lib...66(VS.71).aspx
For the IHttpModule.Init issue, I've also found some updated information:

#INFO: Application Instances, Application Events, and Application State in
ASP.NET
http://support.microsoft.com/kb/312607
<quote>
The ASP.NET runtime creates as many instances of application classes as
needed to process requests simultaneously. For most applications, this
number is limited to the number of threads and remains in the range of 1
through 100, depending on the hardware, server load, configuration, and so
on. Many requests reuse application instances, and a free list of
application instances is kept during periods of reduced load. Application
instances are used in a thread-safe manner, that is, one request at a time.
</quote>
Sorry for not clarifying this fact in my last reply.

Based on these information, my guess is that your IIS 6.0 application pool
settings are causing each request using a new HttpApplication instance.


Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Oct 5 '07 #6
Hi Walter,

All the supplied information seems to relate to .NET 1.1.

We recently ported our web application from 1.1 to 2.0/3.0 and this problem
only seems to occur under .NET 2.0.

""Walter Wang [MSFT]"" wrote:
Hi Rob,

Thanks for your updated information about the IIS isolation mode.

When you configure IIS 6.0 to run in IIS 5.0 isolation mode, ASP.NET runs
in its own process model, Aspnet_wp.exe, and uses its own configuration
settings. These settings are stored in the computer-wide Machine.config
configuration file.

When running on IIS 6.0 in worker process isolation mode, ASP.NET uses the
IIS 6.0 process model settings.

#Mapping ASP.NET Process Model Settings to IIS 6.0 Application Pool Settings
http://msdn2.microsoft.com/en-us/lib...66(VS.71).aspx
For the IHttpModule.Init issue, I've also found some updated information:

#INFO: Application Instances, Application Events, and Application State in
ASP.NET
http://support.microsoft.com/kb/312607
<quote>
The ASP.NET runtime creates as many instances of application classes as
needed to process requests simultaneously. For most applications, this
number is limited to the number of threads and remains in the range of 1
through 100, depending on the hardware, server load, configuration, and so
on. Many requests reuse application instances, and a free list of
application instances is kept during periods of reduced load. Application
instances are used in a thread-safe manner, that is, one request at a time.
</quote>
Sorry for not clarifying this fact in my last reply.

Based on these information, my guess is that your IIS 6.0 application pool
settings are causing each request using a new HttpApplication instance.


Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Oct 7 '07 #7
Hi Rob,

The information should still apply to ASP.NET 2.0.

Could you please create a small but complete reproducible project so that I
can reproduce the issue on my side and find the root cause or explain the
behavior? I've done some searching in our internal database and didn't find
similar issues, therefore your information is quite important for us.
Thanks for your effort.
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Oct 9 '07 #8

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

Similar topics

3
2625
by: PJ | last post by:
Is it possible to capture a request as it hits the server and before the post data has been completely sent to the web server? Thanks~
2
1641
by: moid | last post by:
i need help so that i can initialize page thorugh http module or handler i know it is possible through handler using ProcessRequest but im aint configure the things out. i need some...
3
3738
by: Michael Iantosca | last post by:
I have a custom attribute that I attach to certain pages in my application and I want to inspect each page request as it is made to see if the custom attribute is attached to the underlying page...
2
4965
by: Holly Li | last post by:
Hi, I am following the example in .net's help doc--"Securing XML Web Services Created Using ASP.NET" I have copied all the code from the example but couldn't make it to work. The problem is that...
7
2569
by: nail | last post by:
Folks, I develop a HttpModule and it works correct, but one problem is occurs. After I register the httpmodule in the web.config, my pages (not testing http://localhost/site but...
4
6184
by: | last post by:
I have earlier used an HttpModule that did URL rewrites on the BeginRequest event. Now I am trying to use the same module in a different application on a new and upgraded machine (winxp sp2). ...
1
1324
by: Hardy Wang | last post by:
Hi all, I built a HttpModule for one of my ASP.NET application to handle some special file format (*.DEC1, *. DEC2). My code is like below public class MyClass : IHttpModule { public MyClass() {...
2
2601
by: walter | last post by:
Hi there , for sure httpmodule can be hooked up with HttpApplication event. But I'm wondering if it's poissible to trigger a httpModule in the page event ,like Page.Init(). Since request handler...
2
4568
by: walter | last post by:
Hi there, I know there is pool of HttpApplications, and for each request coming in, HttpRuntime will dedicate one from pool to serve the request. My questions are : 1. since HttpModule is plug...
0
7128
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7332
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
7393
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...
1
7058
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5635
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
426
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.