Search code examples
sql-serverdllssishtml-agility-packetl

HTMLAgilitPack use in SSIS script task


I am attempting to use the Html Agility Pack in an SSIS script task. The first time it worked (or at least that what I remember). When I attempt to debug the task it invokes an error. I then reopen the script task and Visual Studio can no longer find the htmlagilitypack library reference. I've even included it specifically in the project. Has anyone had a similar issue and were able to solve it?


Solution

  • I think the exception is thrown because the reference is not found at runtime, you have to assign this reference to the Global Cache assembly using GACUTIL or just copy the HtmlAgilityPack.dll file to the following directories:

    (1) .Net Framework dll directory

     C:\Windows\Microsoft.NET\Framework\v[.net installed version]\ 
    

    example

    C:\Windows\Microsoft.NET\Framework\v4.0.30319\
    

    (2) SQL server data tools dll runtime directory

    C:\Program Files (x86)\Microsoft SQL Server\[SQL Server version]\DTS\Binn
    

    example

    C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn