Gal Ratner
Gal Ratner is a Techie who lives and works in Los Angeles CA and Austin TX. Follow galratner on Twitter Google
Application.StaticObjects is empty in an ASP.NET precompiled website

Application.StaticObjects holds all of the objects that have been defined using <object runat="server" scope="Application"> </object> tags in Global.asax. I defined my own object and used it in the Application_OnStart() event. It worked inside visual studio; however, it failed on the server. The event fired just fine, but, the object wasn’t there at all. Application.StaticObjects  was empty. After looking into it I discovered that the site simply ignored any object tags. The solution was to copy Global.asax into the recompiled site’s directory. Maybe this bug can be fixed sometime in the future.  For now, if you need any StaticObjects, you might have to use a non compiled version of Global.asax.

Posted 25 Feb 2010 4:56 AM by Gal Ratner
Filed under:

Powered by Community Server (Non-Commercial Edition), by Telligent Systems