Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS App Pools & Static Classes

I've always wondered, lets say you have two asp.net websites running in the same app pool.

Lets call them Website 1 and Website 2

Both of these websites reference some shared code, lets call it Awesome.dll

Lets say that Awesome.dll contains a class defined as below

public static class Foo
{
   public static string Bar { get; set; }
}

My question:

Do both websites share the same static class or do they have their own isolated copy? That is to say, if Website 1 makes a change to Foo.Bar, is that change reflected in website 2?

like image 543
iamkrillin Avatar asked Jun 17 '12 11:06

iamkrillin


People also ask

What are IIS app pools?

IIS Application Pool Definition Application pools in Internet Information Services (IIS) is a mechanism designed to comprise a group of web applications corresponding to one or more worker processes (w3wp.exe) sharing a common configuration.

What is default app pool in IIS?

For every application pool you create, the Identity property of the new application pool is set to ApplicationPoolIdentity by default. The IIS Admin Process (WAS) will create a virtual account with the name of the new application pool and run the application pool's worker processes under this account by default.

What is the application pool?

An application pool serves as a container for your applications in IIS. It's a collection of one or more URLs that can be served by a worker process, and it provides isolation: applications that run on one application pool are in no way affected by other applications that run on different application pools.


1 Answers

My understanding is that while the websites will be in the same App Pool, they'll still be in their own App Domain. That means they can't see each other's objects, and each one will have it's own instantiation of the static class.

like image 87
Andomar Avatar answered Nov 01 '22 19:11

Andomar