SSIS Script component - namespace not found

  • I am trying to upgrade a SSIS project from 2016 to 2019 and having issues with some script components in data flow tasks.

    If I change the TargetServerVersion of the project to SQL Server 2019 then these types of errors (this is when I rebuild the script from within the script editor):

    The type or namespace name 'ScriptBuffer' could not be found (are you missing a using directive or an assembly reference?)
    The type or namespace name 'PipelineBuffer' could not be found (are you missing a using directive or an assembly reference?)
    The type or namespace name 'OutputNameMap' could not be found (are you missing a using directive or an assembly reference?)

    If I add a new script component to the DFT and copy/paste the existing component code into the new component then I get different errors:

    The type or namespace name 'ConnectionManager' could not be found (are you missing a using directive or an assembly reference?)
    The type or namespace name 'DtsConvert' does not exist in the namespace 'Microsoft.SqlServer.Dts.Runtime' (are you missing an assembly reference?)

    This is the piece of code where the new errors are:

      public override void AcquireConnections(object transaction)
    {
    if (Connections.Target != null)
    {
    ConnectionManager cm = Microsoft.SqlServer.Dts.Runtime.DtsConvert.GetWrapper(Connections.Target);

    I am using VS2017 for my SSIS project although I get the same issues with VS2019.  I have installed and reinstalled SSDT for both versions.  I also have a SQL2019 instance installed.

    Any ideas what is causing this and what I am missing?

    We provide software to clients who might run either SQL 2016 or SQL 2019 and we want to have a single code base which we can deploy to both versions of SQL so any solution must be workable with this in mind.

  • I have found an answer.

    When I recreated the script component, the Microsoft.SqlServer.ManagedDTS reference was missing.  Added the reference and it now works fine.

Viewing 2 posts - 1 through 1 (of 1 total)

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