Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

multiple httpmodule instances

I have an asp.net website that uses a web application and they are both in the same application pool (with 1 worker process). The website has a httpmodule loaded in it's web.config file and curiously both the main website and the application will be served by seperate instances of the httpmodule. Why is this? Since they are in the same process it seems like they should use one instance.

Also, if I try to use static variables in the application they will point to different objects than in the asp.net website. Same question as before since they are in the same process shouldn't they be the same object or does .net imposs some sort of boundary inside of the process?

like image 618
mach77 Avatar asked Aug 23 '26 22:08

mach77


1 Answers

IIS creates a seperate AppDomain for each applicatiopn. These AppDomains live inside the same operating system process, but can be treated like separate processes from the viewpoint of your managed code. I.e. they don't share loaded assemblies, memory, etc.

http://www.odetocode.com/articles/305.aspx http://weblogs.asp.net/owscott/archive/2007/09/02/application-vs-appdomain.aspx http://msdn.microsoft.com/en-us/library/system.appdomain(VS.85).aspx

like image 133
nicknystrom Avatar answered Aug 26 '26 11:08

nicknystrom



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!