title: Cannot get SSIS Script Task to work
body: <p>I feel like I am missing some configuration or something, because I have followed tons of tutorials online, but cannot get any examples of a script task to work.  I cannot debug the error either because I am not a C# developer.</p>
  
  <p>Currently, I am simply checking if a file exists in a directory:</p>
  
  <p>1) <code>User::gvLastMonthImportFile</code> is string (read-only) &amp; <code>User::gvLastMonthImportFileExists</code> is Boolean (read-write)</p>
  
  <p>2) Added <code>using System.IO;</code> to my namespaces</p>
  
  <p>3) </p>
  
  <pre><code>string fullPath = Dts.Variables["User::gvLastMonthImportFile"].Value.ToString();
  Dts.Variables["User::gvLastMonthImportFileExists"].Value = File.Exists(fullPath);
  Dts.TaskResult = (int)ScriptResults.Success;`
  </code></pre>
  
  <p>ERROR:</p>
  
  <blockquote>
    <p>at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
    at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
    at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()</p>
  </blockquote>