Search code examples
ssiscsvhelper

Using CsvHelper in SSIS Projects


I am trying to use CsvHelper in my SSIS project specifically as a source component in my data flow. Unfortunately, SSIS doesn’t integrate with NuGet, so I would think that the CsvHelper DLL needs to be registered to the GAC. I haven’t worked directly with the GAC in years. Is it just the CsvHelper DLL that I need to register? If so, how do I find it?


Solution

  • The crux of whether you can put something into the GAC is whether the DLL is strongly signed. Looking at the project, I see an entry for an SNK (strongly named key) so that's checked off the list.

    How to find it

    Assuming it's on your system from a command/dos prompt

    cd /d C:\
    dir /s /b csvhelper.dll
    

    If you can find the specified DLL, then you need to GAC it

    How to GAC it

    Open a visual studio command prompt as a local administrator (or find your GAC installation and open a command prompt as an administrator)

    gacutil.exe -if Path\to\my\dll\cvshelper.dll
    

    Note that you may need to specify the path to the gacutil.exe

    Gac find

    This will be the same mechanism as finding the dll above. Open a command prompt and search for it. Your results may vary but here's what my box looks like

    C:\>dir /s /b gacutil.exe
    C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\gacutil.exe
    C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\x64\gacutil.exe
    C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\gacutil.exe
    C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\x64\gacutil.exe
    C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\gacutil.exe
    C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\x64\gacutil.exe
    C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\gacutil.exe
    C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\x64\gacutil.exe
    C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\gacutil.exe
    C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\x64\gacutil.exe
    

    Lather, rinse, repeat

    You'll need to ensure the DLL has been GAC'ed on any box that will be running your SSIS solution so keep track of any hiccups you have doing this on your local machine as it'll need repeating on the actual servers.