I try to use my own .dll in a script compoment
within ssis
. The normal procedure gives me an error: "could not load file or assembly 'xxx' or one of its dependencies. The system cannot find the file specified."
What I tried yet is I went to project -> Open in Explorer and put my .dll into the bin folder but that same error occures.
I found this C# Code and converted it to vb.net:
<Microsoft.SqlServer.Dts.Tasks.ScriptTask.SSISScriptTaskEntryPointAttribute> _
Public Partial Class ScriptMain
Inherits Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
Shared Sub New()
AppDomain.CurrentDomain.AssemblyResolve += New ResolveEventHandler(AddressOf CurrentDomain_AssemblyResolve)
End Sub
Private Shared Function CurrentDomain_AssemblyResolve(sender As Object, args As ResolveEventArgs) As System.Reflection.Assembly
If args.Name.Contains("ssisHelper") Then
Dim path As String = "c:\temp\"
Return System.Reflection.Assembly.LoadFile(System.IO.Path.Combine(path, "ssisHelper.dll"))
End If
Return Nothing
End Function
End Class
But I do not have Micorosoft.SqlServer.Dts.**Tasks**
. Anyone who can help me either get this script working or can provide another solution to get my dll running within the script compoment
?