SSIS and Sql Server Journey

Personal Notes of Sarabjit Singh and Bhavpreet Singh

SSIS Script task: FileNotFoundException: Could not load file or assembly While refering to third party DLL

on April 9, 2013

While referring to a third party DLL in the SSIS Script task we encountered following error:

Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target
of an invocation. —> System.IO.FileNotFoundException: Could not load file or assembly
‘xyzzz, Version=5.3.0.26835, Culture=neutral, PublicKeyToken=5b5f377bc08a4d32’ or one
of its dependencies. The system cannot find the file specified.
File name: ‘xyzzz, Version=5.3.0.26835, Culture=neutral,
PublicKeyToken=5b5f377bc08a4d32’
at ST_d83cb23ff54e47979cb61222ad9d6b85.csproj.ScriptMain.CreatePdf(String pstrFileName,
String pstrHtml)
at ST_d83cb23ff54e47979cb61222ad9d6b85.csproj.ScriptMain.GeneratePdf(DataSet pobjDs)
at ST_d83cb23ff54e47979cb61222ad9d6b85.csproj.ScriptMain.Main()

Solution: Both the solutions specified work fine. Either of them can be refereed.

Solution 1: Place the xyzzz.DLL to location “C:\Windows\assembly” (this is where the GAC
will place all the files). The file gets INSTALLED there and you need to UNINSTALL to remove it.

Solution 2 (for 32 bit processor): Place the xyzzz.DLL to location “C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn

Solution 2 (for 64 bit processor): Place the xyzzz.DLL to location “c:\Program Files\Microsoft SQL Server\100\DTS\Binn\”

Hope it Helps🙂

Feel free to suggest a better option.


11 responses to “SSIS Script task: FileNotFoundException: Could not load file or assembly While refering to third party DLL

  1. ssisnoob says:

    Thank you so much!!! Exactly what I needed.

  2. kishore says:

    Thank you so much it works fine

  3. kishore says:

    it is working GOOD In BIDS Solution working while installing the package through manifest I am getting error FilenotFound Exception:could not load dll file
    please provide solution as related to the error

    Thanks,
    Kishore

  4. Hanzz says:

    Thanks for the tip !

    For solution 1 I needed a strong name😦

  5. Modest says:

    Your message help me, but in my case instead of copy the files to the library in the assembly folder , i had to install the library using the gacutil cause windows didn’t allow me to copy the dlls there, but thank you very much

  6. […] In order to use the Dynamics CRM SDK, I needed to add references to the Microsoft.xrm.sdk.dll and Microsoft.crm.sdk.proxy.dll files. I found that I received an “Assembly not found” error when running the SSIS package, and this was due to the fact that I needed to copy these DLL files to a specific directory under the local SQL Server installation directory location. Here is a link that describes the problem. […]

  7. hghgh says:

    thnx alot

  8. Roy Bercovitch says:

    I use the this code to load dll that is not in GaC
    static ScriptMain()
    {

    AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);

    }

    static System.Reflection.Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
    {

    if (args.Name.Contains(“CRM2015.Proxy”))
    {

    string path = @””;

    return System.Reflection.Assembly.LoadFile(System.IO.Path.Combine(path, “CRM2015.Proxy.dll”));

    }

    return null;
    }

  9. ab says:

    Worked like charm. I spent 2 days to register my custom DLL but your solution was life save. Thanks!!!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: