title: Problems with serializing a custom type in ASP.NET ViewState
body: <p>I've got a little struct that I want to serialize in my ViewState. It looks something like this:</p>
  
  <pre><code>[Serializable]
  private struct DayMoney
  {
      public readonly DateTime ValidFrom;
      public readonly string CurrencyCode;
      public readonly double Amount;
  }
  </code></pre>
  
  <p>It serializes just fine, but when I perform a postback/callback, I get an exception for deserializing it. Wrapped in a long list of InnerException's the root cause seems to be:</p>
  
  <blockquote>
    <p>Unable to find assembly 'BussinessTripModule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.</p>
  </blockquote>
  
  <p>Which is kinda ridiculous, because that assembly is definately loaded in the current AppDomain.</p>
  
  <p>WTF?</p>