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.
Contents
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
Add Assembly dll reference in SSIS Script Task
- open SSIS Script Task Editor
- 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 )
- Hit OK and Save.
Now try to write some code and test your Script Task….
Hope this helps.