I am wondering if a static class in an ASP.NET MVC application can be initialized more than once . I initially developed my application so that the static component retrieved some things from the database and served as a cache, and I added an update method to the class that was called from the constructor. The update method was also available through the administrative part of the application. At some point, I noticed that the data was updated without using this manual trigger, which means that the static constructor runs more than once.
There are several scenarios where I could reasonably see how this happens, such as an unhandled Exception
that causes reinitialization. But I cannot reproduce this, so I would like to know for sure.
Gleno source share