If a static class is put in App_Code, does that imply only one instance will be created, shared by different http requests?
Or each request still brings one request?
Tha开发者_运维知识库nks.
The static instances will be shared between all requests. See this question:
Are static class instances unique to a request or a server in ASP.NET?
You will have one instance for each worker process. You can have several worker processes on one machine handling requests for the same website (a "web garden").
The instance will be shared for all requests in that worker process only.
In addition, there can be two worker processes running for a short time during AppPool recycling, since it's done using a roll-over process (the old worker continues to process old requests while the new worker handles new ones).
There will be no instance at all!
static classes are never instantiated.
精彩评论