Multiple instances of httpmodule

I have an asp.net website that uses a web application, and they are both in the same application pool (with one workflow). There is an httpmodule on the website, the web.config file loaded into it, and it is curious that both the main website and the application will be served by separate httpmodule instances. Why is this? Since they are in the same process, it seems that they should use one instance.

Also, if I try to use static variables in the application, they will point to different objects than on the asp.net website. The same question as before, since they are in the same process, should not they be the same object or is it impossible to make .net some kind of border inside the process?

+3
source share
1 answer

IIS creates a separate AppDomain for each application. These AppDomains live inside the same process of the operating system, but can be considered as separate processes in terms of your managed code. That is, they do not exchange 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

+3
source

Source: https://habr.com/ru/post/1704150/


All Articles