Exception when using third party dll files in a script task

  • Hello all

    I work at a company, which deploys its products on its customers systems. I was asked to make sure that a SSIS package that used to run on SQL 2008 would run on both SQL 2012 and SQL 2014. The package contains 2 script tasks that use third party dll files. Initialy, when I ren the package I recived the following error exception:

    at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)

    at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)

    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

    at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)

    at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()

    First thig I’ve done was to make sure those dlls are referenced correctly in the script. Then I’ve googled it, and found a solution. I copied those dlls to the binn directory that its path depends on the version of sql (C:\Program Files\Microsoft SQL Server\110\DTS\Binn for sql 2012, and C:\Program Files\Microsoft SQL Server\120\DTS\Binn for sql 2014). That solution is not satisfying and I was asked to find a solution that will not be depended on the SQL version of the client.

    Does anybody have another idea?

    Any help would be much appriciated.

    PS sorry for my poor English, it is not my mother tongue

  • i'm pretty sure that all third party dlls have to be registered in the Global Assembly Cache(GAC) as it's not enough to just have the dll's in the folder, when it comes to SSIS packages.

    so if you are running this on the server, you'll need to register the assemblies on the server.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Thanks, it worked.

    I have a small confession, I’m not a programmer, I’m a DBA. I’ve lived happy 48 years without knowing about the existence of GAC and gacutil.exe. Today my life became a little bit happier thanks to you, because I was able to solve this annoying problem at work. So thanks again you’ve been very helpful.

  • scohn 53313 (3/10/2016)


    Thanks, it worked.

    I have a small confession, I’m not a programmer, I’m a DBA. I’ve lived happy 48 years without knowing about the existence of GAC and gacutil.exe. Today my life became a little bit happier thanks to you, because I was able to solve this annoying problem at work. So thanks again you’ve been very helpful.

    Haha, well done for posting back. I'll bet no one had even considered the existence of a GAC 48 years ago 🙂

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply