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.
List<CustomClass> CustomClassList = (List<CustomClass>)this.Variables.CustomClassList;
ERROR:
[A]System.Collections.Generic.List1[CustomClass] cannot be cast to [B]System.Collections.Generic.List`1[CustomClass].
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'.
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'.
Probably adding my customClass to ScriptComponent is the source of the problem:
public class ScriptMain : UserComponent
{
public override void PreExecute()
{
...
}
public override void PostExecute()
{
...
}
public override void CreateNewOutputRows()
{
List<CustomClass> CustomClassList = (List<CustomClass>)this.Variables.CustomClassList;
}
...
public class CustomClass
{
some variables {get; set}
ect.
...
}
}
How can I do it properly?