title: Using List<customClass> in SSIS Script Components
body: <p>I have two Script Components. Fist create list and save it to the Variables.customClasslist (System.Object). When I try read this variable in the second Script Component, SSIS give me an error.</p>
  <pre><code>List&lt;CustomClass&gt; CustomClassList = (List&lt;CustomClass&gt;)this.Variables.CustomClassList;
  </code></pre>
  <p>ERROR:</p>
  <blockquote>
  <p>[A]System.Collections.Generic.List1[CustomClass] cannot be cast to [B]System.Collections.Generic.List`1[CustomClass].</p>
  <p>Type A originates from 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' in the context 'LoadNeither' at location 'C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'.</p>
  <p>Type B originates from 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' in the context 'LoadNeither' at location     'C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'.</p>
  </blockquote>
  <p>Probably adding my customClass to ScriptComponent is the source of the problem:</p>
  <pre><code>        public class ScriptMain : UserComponent
      {
      
          public override void PreExecute()
          {
              ...
          }
      
          public override void PostExecute()
          {
             ...
          }
      
          public override void CreateNewOutputRows()
          {
           List&lt;CustomClass&gt; CustomClassList = (List&lt;CustomClass&gt;)this.Variables.CustomClassList;
          }
      ...
      public class CustomClass
        { 
         some variables {get; set} 
         ect.
         ...
        }
   }
  </code></pre>
  <p>How can I do it properly?</p>