0

I have added MSUtil dll in script task component. But when i close that projects i get the error like : Could not loaded dll.

Any one have idea about this. Please guide. Thanks.

  • A dll can only run from a command line if it has a main method. I suspect your dll is missing main. Adding the main you can still run any public method that already exists fro an application plush it gives the option of also running from a command line. – jdweng Dec 03 '18 at 13:53
  • Could you please ellaborate more? – Snehal Sawant Dec 03 '18 at 14:49
  • A dll is very similar to an exe executable in structure. When you create a console application a main is automatically created and a exe is created. So the only thing you would need in your dll is to copy the main method from a console application. Then in main() method make a call to the start of you application. The dll will then be able to run from a command line. – jdweng Dec 03 '18 at 14:57
  • What @jdweng says here is simply wrong – David Heffernan Dec 03 '18 at 21:19

1 Answers1

0

A SSIS package is executed by DTExec executable or MS Integration Service. The DLL you added to the script task have to be loaded by these processes.
You can achieve this by several approaches:

  • Add the DLL to System GAC (Global Assembly Cache) where the package is executed. My preferred method.
  • Add the DLL to the directory where exec of MS Integration Service is located. Not preferred, location can vary.
  • Provide custom assembly resolver as discussed in this article.
Ferdipux
  • 5,116
  • 1
  • 19
  • 33