SSIS error: Cannot load script for Execution

Asked

Viewed 155 times

2

Executing the data load generates the following error: "Cannot load script for Execution".

The data load executes a Script Task. In this Script find a CSV file, in which it takes the date of the last modification and stores it in another variable.

 public void Main()
    {
        System.IO.FileInfo theFile =
              new System.IO.FileInfo(Dts.Variables["User::FilePath"].Value.ToString());

        if (theFile.Exists)
        {
            Dts.Variables["User::FileDateModified"].Value = theFile.LastWriteTime;
        }
        Dts.TaskResult = (int)ScriptResults.Success;
    }

Running by VS works 100%, but running the load by MS generates the error.

We recently downloaded the DW server, also changed SQL Server for 2016.

Do you have a way to fix the mistake? There’s another way to get the date of the last data load modification?

  • looks like a classic path error, did not find the file in the expected location

  • I validated the path. All right on that.

  • Gives a look here, see if it helps.

  • In Solution explorer Right-click your SSIS project choose Properties->Configuration Properties->Targetserverversion->SQL Server 2016

  • I changed the code according to Ivan Ferrer’s link and it didn’t. And I’ve also changed the version to 2016 as suggested by Augusto Vasques who also did not solve.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.