title: SSIS package not executing Script Task when called from C# web form
body: <p>I have a C# web form built in Visual Studio that calls a SSIS package. The first step in the SSIS package is a Script Tasks that unzips a file. It then deletes data in some tables in SQL Server and then inserts data back into those tables from the contents of the .zip file. When the package is run in VS, it completes successfully without any issues. When I call the package from the C# form, it will not run the Script Task but doesn't throw any errors. </p>
  
  <p>Here is my code that calls the SSIS package:</p>
  
  <pre><code>using System;
  using Microsoft.SqlServer.Dts.Runtime; // SSIS Package Execution
  
  namespace LoadZip
  {
      public class ExecuteSSIS
      {
          public void exePackage(string tbFilePath, string server)
          {
              String pkgLocation = @"C:\SSIS.dtsx";
              Package ssisPackage;
              Application app;
              DTSExecResult result;
              Variables vars;
  
              app = new Application();
              ssisPackage = app.LoadPackage(pkgLocation,null);
  
              vars = ssisPackage.Variables;
              vars["sqlServerName"].Value = server; Console.WriteLine("var server = " + server);
              vars["filenameWithPath"].Value = tbFilePath; Console.WriteLine("var tbFilePath = " + tbFilePath);
  
              result = ssisPackage.Execute();
  
              if (result == DTSExecResult.Success)
                  Console.WriteLine("SSIS Package Successfully Executed");
              else if (result == DTSExecResult.Failure)
              {
                  Console.WriteLine("********** SSIS PACKAGE FAILED **********");
                  foreach (DtsError local_DtsError in ssisPackage.Errors)
                  {
                      Console.WriteLine(local_DtsError.Description);
                  }
                  Console.WriteLine("********** END FAILED REPORT **********");
              }
          }
      }
  }
  </code></pre>
  
  <p>Here is what the SSIS package looks like:</p>
  
  <p><img src="https://i.stack.imgur.com/Tj2RJ.png" alt="SSIS Package"></p>
  
  <p>As I mentioned, when I run the package from my C# form, I get returned "SSIS Package Successfully Executed" but it really does not run it. Instead it seems to "fail" at the Script Task and not execute the rest of the package.</p>
  
  <p>If I disable the Script Task (UnZip File) and re-run the SSIS package from my C# form, the package executes successfully. So I know my form is hitting the package and passing along the variables, but it just doesn't seem to like the script task although when executed outside the form, it works just fine.</p>