title: Type '' in Assembly '' is not marked as serializable. linq-to-sql
body: <p>I am using asp.net and have configured the sessions to stored in SQL server.  My porject has many object and several linq-to-sql dbml's.  I have configured all the them to have unidirectional serialization and also made a few customized changes.</p>
  
  <p>When I run the app I keep getting this error in my application_error event handler</p>
  
  <p><strong>Type 'Data.Karaoke.spCWP_SelUserPrivilegesResult' in Assembly 'App_Code.thzd8p2j, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.</strong></p>
  
  <p>from the error I am not sure if it is coming from the dbml.designer.cs file which this is the code:</p>
  
  <pre><code>[Function(Name="dbo.spCWP_SelUserPrivileges")]
  public ISingleResult&lt;spCWP_SelUserPrivilegesResult&gt; spCWP_SelUserPrivileges([Parameter(Name="IDCWPUser", DbType="Int")] System.Nullable&lt;int&gt; iDCWPUser)
  {
    IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), iDCWPUser);
    return ((ISingleResult&lt;spCWP_SelUserPrivilegesResult&gt;)(result.ReturnValue));
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>[DataContract()]
  public partial class spCWP_SelUserPrivilegesResult
  {
  
    private int _IDTypeCWPModule;
  
    private string _TypeKey;
  
    private bool _Security;
  
    public spCWP_SelUserPrivilegesResult()
    {
    }
  
    [Column(Storage="_IDTypeCWPModule", DbType="Int NOT NULL")]
    [DataMember(Order=1)]
    public int IDTypeCWPModule
    {
      get
      {
        return this._IDTypeCWPModule;
      }
      set
      {
        if ((this._IDTypeCWPModule != value))
        {
          this._IDTypeCWPModule = value;
        }
      }
    }
  
    [Column(Storage="_TypeKey", DbType="VarChar(10) NOT NULL", CanBeNull=false)]
    [DataMember(Order=2)]
    public string TypeKey
    {
      get
      {
        return this._TypeKey;
      }
      set
      {
        if ((this._TypeKey != value))
        {
          this._TypeKey = value;
        }
      }
    }
  
    [Column(Storage="_Security", DbType="Bit NOT NULL")]
    [DataMember(Order=3)]
    public bool Security
    {
      get
      {
        return this._Security;
      }
      set
      {
        if ((this._Security != value))
        {
          this._Security = value;
        }
      }
    }
  }
  </code></pre>
  
  <p>How can I determine where the error originated from?
  Or what does the error mean?</p>
  
  <p>i am unsure how to solve or what to look for to solve the issue.</p>