Deploying the component

The deploy process is not trivial. You need to:
  1. Copy the compiled .DLL inside a particular folder within the x86 installation directory of MS SQL Server
  2. Copy the compiled .DLL inside a particular folder within the x64 installation directory of MS SQL Server
  3. Register the .DLL into the Global Assembly Cache

If you have a 32bit SQL server, you could skip phase 2. If you own the x64 version of SQL Server, you need to copy the .DLL inside both directory, because the VisualStudio Designer uses a 32bit environment while the MS SQL Server uses a 64bit environment. So, when you are developing the SSIS package you will use the Design method (ProvideComponentProperty) within a 32bit .DLL and when running the project the 64bit .DLL is used instead.
In my current setup (standard setup of MS SQL 2012 64bit enterprise) the paths are:
  • "C:\Program Files (x86)\Microsoft SQL Server\110\DTS\PipelineComponents";
  • "C:\Program Files\Microsoft SQL Server\110\DTS\PipelineComponents".

Then we need to register the assembly in the GAC. To do so, open the “Visual Studio command prompt” and type in the following command:

Gacutil.exe /f /i <PATHTODLL.DLL>

This will force the installation of the new assembly. If you already have installed a previous version of the same assembly, I suggest to remove it first, by using the /f command of the DLL name (no path is needed).

Easy deploy

In order to make the component easy to deploy, I’ve written a very simple batch script which takes care of doing all the needed operations. Please have a look to the following listing:
@echo off
CALL "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
echo Coping DLL into BISD (x86) directory
copy bin\release\MassTrimmer.dll "C:\Program Files (x86)\Microsoft SQL Server\110\DTS\PipelineComponents"
echo Coping DLL into BISD (x64) directory
copy bin\release\MassTrimmer.dll "C:\Program Files\Microsoft SQL Server\110\DTS\PipelineComponents"
echo Unregistering previous dll 
gacutil /uf MassTrimmer
echo Registering dll into GAC
gacutil /f /i bin\release\MassTrimmer.dll
pause

You can create a “deply.bat” script file inside the visual Studio project directory. Make sure to update the paths to the current Visual Studio Environment and MS SQL installations. Please, note that the script will deploy the .dll called “MassTrimmer.dll” which is inside the bin\Release directory. This dll is created by Visual Studio by rebuilding the project, selecting as deploy mode “Release” instead of “Debug”. Beside, you’ll need administrator rights to run this script.

Proceed with Component Performances

Last edited Apr 26, 2014 at 9:46 PM by webking, version 3