"The binary code for the script is not found"
Asked Answered
A

12

7

I used the script found here

... And every time that I generate this dynamic package, it needs to open the script task and click "Ok" because the "The binary code for the script is not found." error aways appears. Is there a way to solve this without BIDS ? Thanks and sorry my bad english.

Aquiculture answered 7/5, 2014 at 21:0 Comment(1)
I have installed this features and components and my environment is SQL 2012. Not workAquiculture
T
6

I got this error when a SSISDB was upgraded to 2016 from 2012 and the package was not re-deployed using newer visual studio with project set to deploy to SQL Server 2016 in the project deployment properties.

Therron answered 6/9, 2018 at 15:20 Comment(0)
M
2

This is often caused to to an error or omission in the code in the script task. If you are certain that the code is correct you can go to the script properties and set the PrecompileiIntoBindaryCode to False, the default is set to true. This is under the Properties or in the Script option of the properties window.

Matterhorn answered 7/5, 2014 at 21:8 Comment(4)
Thaks you. But I cannot found this PrecompileiIntoBindaryCode property. Sorry, I did not mentioned: my environment is SQL Server 2012Aquiculture
Depending on the version, you may need to look for DelayValidation. Must be true.Matterhorn
I tested with DelayValidation. No progress :(Aquiculture
For future travelers... #16329638Ilanailangilang
A
2

This worked for us

  • From Project properties, change TargetServerVersion to SQL Server 2019 (Or desired version)

  • open the .dtsx file for each package in Notepad++ or other text editor

  • remove the following for each dtsx file (there will be 1 occurence per script component in packages)

    <PropertyGroup>
            <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    </PropertyGroup>
    
  • save the .dtsx file

  • go back into Visual Studio and rebuild the project file (as well rebuild individual script task)

Accustom answered 26/7, 2022 at 11:0 Comment(1)
Can confirm this works for projects migrating from VS2019 to VS2022 that previously targeted .NET Framework 4-4.5.1 (for which VS2022 no longer supports). Our TargetServerVersion stayed 2016 before and after.Breastplate
M
1

This error can happen if you are using C# language features in the script task within SSIS package which are not currently supported by C# language version for that package. For example, any SSIS packages targeting SQL 2012 you should only use C# language features which target .Net Framework 4.

For example, package will fail to execute within SQL server if new syntax for string concatenation used within script task instead of old way.

i.e used syntax "Found {count} rows" instead of "Found" + count + "rows". so please check if you are not using any language features which are not currently supported.

Please note that if you are using unsupported language features in script task, the SSIS package would execute correctly within Visual Studio but would fail to execute when deployed on SQL Server.

If SSIS package has been upgraded to SQL 2019 or higher, then new C# language features can be used as well. Hope this helps.

Mobilize answered 1/3, 2023 at 17:25 Comment(0)
A
0

I just ran into this error, after I changed my package deployment configuration to 2012. In the script some references we no longer linked. I had to reset the version of the .Net framework in the VS script environment, references were now legit, rebuild success.

Apologue answered 7/11, 2018 at 18:39 Comment(0)
A
0

In Visual Studio 2017, SSIS 2017 solution, had same error on a script task. Compared to another solution with similar process and discovered the issue was the Reference which had an error did not have a path listed for the dll. Removed the reference and added again. This resolved the issues.

Ardenia answered 8/1, 2019 at 15:43 Comment(0)
C
0

Uninstall VS 2015 and SSDT 14. Re Install VS 2015 and SSDT 14. Open a new Integration project and import the SSIS project using the ispac file Open the task having the error Click On Edit Script. Then either do this: In Build tab click on Run code analysis on solution or Build or Clean and then Build Save All the solution Close the window Click on OK in the task window.

OR just click on edit script and then OK button The error should go off

This is for Visual Studio 2015 Community/SSDT 14

Cann answered 9/1, 2019 at 7:34 Comment(0)
E
0

use SSMS V17.8.1 and upgrade your SSISDB and it will work, I tried it.

Epitasis answered 20/3, 2020 at 9:12 Comment(0)
A
0

For me, I found that using string interpolation caused the issue.

For example: This line caused the error:

command += $"test {property.Name}";

Changing it to this fixed the error:

command += "test " + property.Name;
Amoroso answered 22/10, 2020 at 16:26 Comment(0)
P
0

After changing from VS 2017 to VS 2019, I saw this error in SQL Server / Integration Services Catalog / "My Package" / Validate... These messages are also visible in Standard Reports / All Executions.

My particular error messages were "VS_ISBROKEN" in the SSIS.Pipeline and "The binary code for the script is not found." in my scripting task.

I opened up the scripting task (C#) and changed the project target to x86 instead of None (MSIL), rebuilt it, closed the scripting solution, pressed Ok to keep the script changes, saved, built and deployed.

That worked for me.


Addendum: It turns out that I was deploying a single package using VS2019 while the original Project was deployed using VS2017.

I think that the two deployments are not 100% compatible, and recommend that users either deploy an entire project, or deploy a package update using the same version as was used for the initial release.

You should probably ignore my suggestion above about changing project target.

Proven answered 25/3, 2022 at 18:11 Comment(1)
can you please mention the steps to change the project target if possibleDaph
J
0

Check your references, make sure all external references are added to the server's GAC.

For adding your dll(for example csvhelper.dll) in GAC you can use the following command in cmd.

C:\test>"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.7 Tools\gacutil.exe" -i csvhelper.dll

**Put your dll in a folder (for example in test folder)

**Pay attention which version of .Netframework you have(Here I used .net4.7)

Johnajohnath answered 24/11, 2022 at 4:13 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Schaffner
U
0

We went from SQL Server 2016 to 2017. The migrated package worked well initially, but when I tried to edit the script component, everything seemed to be normal and ran on my local machine, BUT it did not run on the server. I kept getting the dreaded "The binary code for the script is not found. Please open the script in the designer by clicking the Edit Script button and make sure it builds successfully." The SSIS package contains a single script component used for data staging. I use VS 2019.

I tried all the fixes above and a few others I found elsewhere. No luck.

What finally seems to have worked for me was to open the SSIS project's properties (not the script's, but the SSIS package's) and change the target SQL Server to 2017 because it was still set to 2016.

Once I changed the target, I rebuilt and redeployed. This fixed the problem!

Undamped answered 27/10, 2023 at 23:13 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.