title: Assign list to a ssis variable
body: <p>I tried to assign a list to a user variable , but it doesn't seems to work. Here is the code, what could be wrong?</p>
  
  <pre><code>StreamReader r = new StreamReader(Dts.Variables["User::filepath"].Value.ToString())
  {
      string[] a = r.ReadLine().Split(';');
      List&lt;string&gt; list = new List&lt;string&gt;(a);             
      Dts.Variables["User::firstRow"].Value = list;
  }
  </code></pre>
  
  <blockquote>
    <p>at System.RuntimeMethod‌​Handle.InvokeMethod(O‌​bject target, Object[] arguments, Signature sig, Boolean constructor) at
    System.Reflection.Ru‌​ntimeMethodInfo.Unsaf‌​eInvokeInternal(Objec‌​t
    obj, Object[] parameters, Object[] arguments) at
    System.Reflection.Ru‌​ntimeMethodInfo.Invok‌​e(Object obj,
    BindingFlags invokeAttr, Binder binder, Object[] parameters,
    CultureInfo culture)
        at System.RuntimeType.I‌​nvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs,
    ParameterModifier[] modifiers, CultureInfo culture, String[]
    namedParams) at
    Microsoft.SqlServer.‌​Dts.Tasks.ScriptTask.‌​VSTATaskScriptingEngi‌​ne.ExecuteScript()</p>
  </blockquote>
  
  <p>that is the error when I run the script in ssis</p>