views:

236

answers:

1

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?

+2  A: 

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

nicknerdy