title: Keep unserializable object in application memory
body: <p>On my asp.net site I'm using an third party component for every user to provide data und subsume actions. Unfortunatly the component initialization is pretty slow (about 1-2 seconds) - way too long to initialize every page request. </p>
  
  <p>So I'm trying to store this object in my application. But in any way it is null after the next page request. Simple objects are working as expected, of course.</p>
  
  <p>I have tried so far</p>
  
  <ul>
  <li>Static variables</li>
  <li>HttpContext.Session</li>
  <li>HttpContext.Cache</li>
  <li>TempData</li>
  </ul>
  
  <p>In all cases my application forgets everything, but I don't get any error.</p>
  
  <p>Is there any way to achieve keeping those objects in memory? </p>
  
  <p>Here is my minimal example. When I exchange the values to string everything works fine. With this object, I get <code>null</code> in Login method.</p>
  
  <pre><code>public class HomeController : Controller
  {
      public static IFrameworkItem Test;
      // GET: Home
      public ActionResult Index()
      {
          Test = FrameworkItem.Create("admin", "admin");
          return View();
      }
  
      public ActionResult CreateItem(string username, string password)
      {
          var test = HomeController.Test;
          return null;
      }
  }
  </code></pre>