"The binary code for the script is not found" - ssis

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.

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.

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.

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)

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.

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.

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

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

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;

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.

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)

Related

Visual Studio 2015 - Nuget Exception - GetFullVsVersionString must be called on the UI thread

While attempting to build or open a project in Visual Studio 2015 Update 3, I keep getting errors around nuget package management.
Whenever I build the project the first time after opening VS, I get the error message below.
I also get it when I try to open the nuget package manager dialog.
Anyone else experience this?
An exception was thrown while initializing part
"Nuget.PackageManagement.VisualStudio.VSolutionManager".
GetFullVsVersionString must be called on the UI thread.
Here is another thread in stack about this issue :
Visual Studio 2015 Initializing Part Nuget.PackageManagement.VisualStudio.VSolutionManager must be called on UI Thread
And here is in github :
GetFullVsVersionString must be called on the UI thread #3419
People say install this plugin for fix this issue.
But when i open that url i face this error :
We're sorry, the page you requested cannot be found!
In VisualStudio 2015 -> Tools -> Extensions and updates -> Online:
Search for the string: "Fix NuGet GetFullVsVersionString must be
called on the UI thread" and install the given fix.
Alternatively you can download the fix at : GetFullVsVersionString
fix
Now in February 2018, the latest NuGet Package Manager version
3.4.4.1321 does not have the fix included, so the patch must be applied.
As Steve Greene's answer describes, I also had the Telerik extension
installed, so that might have caused the problem.
I searched that phrase in VS - But could n't find anything.
Also GetFullVsVersionString fix does n't exist any more.
I also reinstalled nuget package manager - no help.
What is the solution?
EDIT 1 :
When i delete .vs hidden folder and open VS error vanished.
but when i close VS & reopen it again i face that error again.
What is wrong about .vs hidden folder?
Several suggestions:
1) disable any third installed party extensions under Tools--> Extensions and Updates--> Installed to check whether there is an extension that caused this issue.
2) Close VS, delete all files under C:\Users\xxx\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache
You can also delete .vs hidden folder, bin and obj folder of the project.
Then, restart VS to test again.
Further, try to reinstall Nuget Package Manager extension again.
3) restore VS environment, enter C:\Users\Administrator\AppData\Local\Microsoft\VisualStudio\14.0
And you can just rename the 14.0 folder to another name like VS2015_Backup(just make a backup for your VS2015 environment).
Then, restart VS to test the issue.
4) open Control Panel-->Programs and Features-->right-click on VS2015 Program-->change-->Repair

Can't get TeamCity to use C# 7.1 - but works manually using msbuild

I have TeamCity 2019.1.5 with most recent Visual Studio Tool 2017 installed:
I have a project which uses C# 7.1 features, and it compiles locally just fine in VS 2017, and I made sure it has <LangVersion>latest</LangVersion> in CSPROJ file. But when I run it from TeamCity (agent is on the same server) with the following build step:
it fails with the following error in the logs:
[Csc] Services\MappingService.cs(1942, 40): error CS8107: Feature 'default literal' is not available in C# 7.0. Please use language version 7.1 or greater.
If I start VS2017 command prompt on the server and go to the project's folder and run msbuild tt.csproj /target:Rebuild it works fine: compiles and I do not get any errors. Needless to say, if I remove C# 7.1-specific code, everything works in the current configuration.
I installed Visual Studio Tool 2019 and with MSBuild 16 it works without any problems as well. But I prefer to use 2017 tools so both server and dev environments are the same. What can cause this issue?
I had this problem and fixed it by fixing the solution configuration in the build step configuration. It needs to be set to either "Debug" or "Release". Mine was set to a parameter, which resolved to something other than one of those values.

Azure Devops Build SSIS task

I have created an SSIS package using VS 2017 and added the project to Azure Devops. I am trying to setup a build task in Azure Devops using the SQL Integration Service add in. Everything I am doing is setup on my machine which includes the Agent Pool etc. When trying to setup parameters for the SSIS build the Devenv Version selection only gives me 12 and 14. VS2017 doesn't appear. As a result it appears that when I do a build the incorrect version on devenv is used and the build (even though it doesn't say its failed) fails.
The version the build is using is C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Devenv.com but should be using C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE>Devenv.com
How do I get to DEVENV config parameter to include the Hosted VS2017 version?
The following web page gives an idea of what I am trying to achieve: -
http://chamindac.blogspot.com/2018/09/build-and-deploy-ssis-with-azure-devops.html
I ended up using a powershell script instead.
The script has one line to run the build.
&"${env:ProgramFiles(x86)}\Microsoft Visual Studio\2017\Professional\Common7\IDE\devenv.com" "C:\Users\me\Downloads\vsts-agent-win-x64-2.140.0_work\2\s\POC_SSIS.sln" /rebuild
I place the code in a .ps1 file and put it into the root of my repo. I then used the Powershell config to reference the file and it worked.
I did a similar thing for the deployment where I used : -
ISDeploymentWizard /S /SP:C:\Users\me\Downloads\vsts-agent-win-x64-2.140.0_work\2\s\POC_SSIS\bin\Development\POC_SSIS.ispac /DS:serverName /DP:/SSISDB/POC_SSIS/POC_SSIS

Use a SSIS package as Template in SSDT for Visual Studio 2017 Community

. Hi everybody!, I'm running into a small problem.
I have VS 2017 Community Edition, I've installed SSDT (SQL Server Data Tools)
I've built an SSIS package (a generic one) and now I would like to use it as a template for future packages.
So, I was digging in the web, also here in StackOverflow and found for example this article:
Setting up SSIS Item Template in SQL Server Data Tools for Visual Studio 2012
I found lot of other articles in MS for example:
https://learn.microsoft.com/en-us/sql/integration-services/create-packages-in-sql-server-data-tools
others, etc. and followed up to the tee but, for some reason I can't make it work.
This is my folder structure for my VS installation
I've left out of the tree some folders that doesn't apply to the problem
I put my package in the places I found in the articles and didnt work.
Sometimes, in the articles mentioned folders that I didn't have so I created and tried but nothing also (so deleted this folders)
I'm really lost, I tried everything I read, and some "creative things" from my yard but no results.
Anyone has come through this or has some experience about this issue?
Anyone can help?
Thank you very much.
Best regards and Happy new year!!
Gabriel
Well based on the articles I've read and the help of #billinkc, I finally figured out where to put the package, I was missing something also, but I realised when I read #billinkc answer.
When you are on VS Community Version, you have to put the package in this path:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\SSIS\ProjectItems\DataTransformationProject\DataTransformationItems
The files you need to make it work are, a dtsx file (the package that will be the template) and a vsdir file which mainly needs to have this structure I used this values and worked fine:
YourPackageName.dtsx| |The name you want to appear|100|The description of the package| |21| |#44
You can check all the fields of the vsdir file in the MS documentation:
https://learn.microsoft.com/en-us/visualstudio/extensibility/internals/template-directory-description-dot-vsdir-files
So now I have it running!
Thanks for your help!!
I don't have 2017 installed but this appears to work for 2015 so if you don't mind being a guinea pig...
Close out all instances of Visual Studio
Copy your template package into Common7\IDE\PrivateAssemblies\ProjectItems\DataTransformationProject\DataTransformationItems
Open your SSIS project
Right click on the project and select Add, New Item and you should have your template package listed (TemplatePackage2)
For reference, below is what my folder structure looks like. Since I couldn't remember whether the package templates lived at DataTransformationProject or DataTransformationProject\DataTransformationItems, I put a copy of my template package in both, varying by name to see what was picked up in the editor
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\PrivateAssemblies\ProjectItems\DataTransformationProject\DataTransformationItems
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\PrivateAssemblies\ProjectItems\DataTransformationProject\DataTransformationProjectItems.vsdir
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\PrivateAssemblies\ProjectItems\DataTransformationProject\TemplatePackage.dtsx
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\PrivateAssemblies\ProjectItems\DataTransformationProject\DataTransformationItems\DtsProjectItems.vsdir
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\PrivateAssemblies\ProjectItems\DataTransformationProject\DataTransformationItems\TemplatePackage2.dtsx
General notes about templates
The first is that the only way to get to your template is through the click path described above. If I want to add a new package, my default click path is right click on SSIS Package and select "New SSIS Package"
Pre-2012, the internal IDs of components and the package would remain the same. BIDS Helper had functionality to address this. Why it mattered was if you were attempting to track performance for packages, if they all report the same GUID you're going to have a hell of a time discerning whether Data Flow Task that ran for 10 hours is the same one that normally takes 10 seconds or was a second (different) package executed.
Developers will need to be local administrators on their machine to deploy the template package(s) and you'll need a process to keep that up to date. That or you need to engage the network admins to get these copied to developer machines.
Finally, if I had template logic, I'd probably abstract that away into Biml and then use source control to ensure people are working with the current version and avoids the whole permission issue.

Configuration Visual Studio 2015 - Windows 10 Project

I need to add a new configuration in Visual Studio 2015.
Exist other configurations and are correct & work.
When I had a new configuration, with name "Test", in option "Copy Settings from:" I selected "Empty" and I Check "Create new project configuration".
If I run the application with this new configuration(For example Release, Debug, etc...) I have an error:
"Couldn't find the required information in the lock file. Make sure you have UAP,Version=v10.0.240/Win10- mentioned in your targets".
I dont know resolve this error.
Someone help me?
Thanks
I had the same problem.
First, apparently, did you mean Visual Studio 2015? If not, you need to install VS2015.
In VS2015 that helped in my case - enable "Compile with .NET Native tool chain" in your project build properties and ensure that "Platform" not set to AnyCPU.