[ Edit: Note, this has been resolve in current Katmai CTPs ]
You may run into issues in the current Katmai CTP if your script task uses objects contained within the ManagedDTS assembly. If you’re interested in the details, keep reading – otherwise you can skip to the bottom for a possible work around.
Public Sub Main()
Dim childPkgPath As String = “C:\Child.dtsx”
Dim app As New Application
Dim pkgChild As Package
pkgChild = app.LoadPackage(childPkgPath, Nothing)
If pkgChild.Errors.Count > 0 Then
Dts.TaskResult = ScriptResults.Failure
Dts.TaskResult = ScriptResults.Success
The above code snippet will give you the following errors:
Error 1 Argument not specified for parameter ‘contract’ of ‘Public Sub New(contract As System.AddIn.Contract.IContract, typeInfrastructureManager As Microsoft.VisualStudio.Tools.Applications.TypeInfrastructureManager)’.
Error 2 Argument not specified for parameter ‘typeInfrastructureManager’ of ‘Public Sub New(contract As System.AddIn.Contract.IContract, typeInfrastructureManager As Microsoft.VisualStudio.Tools.Applications.TypeInfrastructureManager)’.
The errors come from the proxy classes we created for our VSTA implementation. If you look at references for the project, you’ll see that there’s no reference to the Microsoft.SqlServer.ManagedDTS assembly. Instead, you’ll see our script task proxy – Microsoft.SqlServer.VSTAScriptTaskPrx.
Unfortunately, adding the missing reference isn’t enough to solve the problem. Because the proxy and the ManagedDTS assembly use the same namespace, it just causes name conflicts.
Unlike VSA, it’s very easy to reference external assemblies in VSTA. Currently the only work around is to compile your script into a custom assembly, and include it from your script task. It’s a little messy, but hopefully this is enough of an edge case that not too many people will encounter it. We’ll be working on resolving it for an upcoming CTP.