Reference Assembly in SSIS Script Task (.net Custom Assembly)

In this blog post I want to show how to reference custom .net Assembly in SSIS Script Task.

Assume you want to use some JSON dll in your Script Task instead of this json connector.

Here are the steps.

Add .net Assembly  (i.e dll) to GAC (Needed in SSIS Script Task)

using gacutil command. Make sure you assembly is signed with Strong Name

To register 3.5 Framework assembly use gacutil from below path:
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\gacutil.exe
To register 4.0 Framework assembly use gacutil from below path:
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\gacutil.exe

Copy Assembly dll to SDK folder

After you GAC assembly you must Copy it to the following paths (NOTE: {version} in below path can be 90,100,110,120,130 …)
90=SQL 2005,  100=SQL 2008, 110=SQL 2010…. If you have 32-Bit machine then just copy to first path below.

C:\Program Files\Microsoft SQL Server\{version}\SDK\Assemblies\
C:\Program Files (x86)\Microsoft SQL Server\{version}\SDK\Assemblies

SSIS Script Task - Add reference to custom assembly - Copy to SDK folder
SSIS Script Task – Add reference to custom assembly – Copy to SDK folder

Add Assembly dll reference in SSIS Script Task

  1. open SSIS Script Task Editor
  2. Add reference to Custom .net Assembly which we copied in the above step. To add reference you have to browse dll which you want to use (e.g.  c:\Program Files\Microsoft SQL Server\{version}\SDK\Assemblies\yourassembly.dll )
  3. Hit OK and Save.
SSIS Script Task - How to add reference to custom dll (assembly) in Script Editor
SSIS Script Task – How to add reference to custom dll (assembly) in Script Editor

Now try to write some code and test your Script Task….

Hope this helps.

Binary World is a Software Development company located in Atlanta, USA (since 2007). Binary World specialized in Business Intelligence, mobile, cloud computing and .Net Application Development.