Custom Transformation works in SSDT 2012 but not SSDT 2015

0

I'm attempting to build a custom transformation task for an SSIS package. I have been following an example of how to do this, in order to better understand how all the pieces work together in order to build my own. I have gotten to the point where I am trying to use the custom task it within a Data Flow task.

In SSDT 2012 (using VS 2012 Shell), I am able to drag it onto the design canvas hook it up to my input and outputs, and double-click on it to view the Advanced Properties.

However, in SSDT 2015 (using VS 2015 Community), the task displays in the SSIS Toolbox as expected, but when I drag it onto the design canvas, I receive the error below.

When attaching the code to the SSDT 2015 process for debugging, it chokes within the ProvideComponentProperties() method (see below for code snippet).

Code Snippet:

public override void ProvideComponentProperties()
{
    // Set component information
    ComponentMetaData.Name = "CustomEmailValidator";
    ComponentMetaData.Description = "Transformation to validate email using Regular Expressions.";

    // Reset the component
    // Deletes each Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSInput100 and IDTSOutput100 from the component
    RemoveAllInputsOutputsAndCustomProperties();

    // Add an input object
    IDTSInput100 inputObject = ComponentMetaData.InputCollection.New();
    inputObject.Name = "InputToCustomEmailValidator";
    inputObject.ErrorRowDisposition = DTSRowDisposition.RD_FailComponent;

    // Add an output object
    IDTSOutput100 outputObject = ComponentMetaData.OutputCollection.New();
    outputObject.Name = "OutputFromCustomEmailValidator";
    outputObject.SynchronousInputID = inputObject.ID; // Synchronous Transform

    // Add an error object
    AddErrorOutput("ErrorFromCustomEmailValidator", inputObject.ID, outputObject.ExclusionGroup);
}

Error #1:

===================================

The component could not be added to the Data Flow task. Could not initialize the component. There is a potential problem in the ProvideComponentProperties method. (Microsoft Visual Studio)

===================================

Error at Data Flow Task [CustomEmailValidator [47]]: System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSComponentMetaData100'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{887BD061-82D4-4F06-A222-337D42E7F896}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)). at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, IntPtr& ppTarget, Boolean& pfNeedsRelease) at Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSComponentMetaData100.set_Name(String pbstrName) at CustomEmailValidator.CustomEmailValidatorTransform.ProvideComponentProperties() at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostProvideComponentProperties(IDTSManagedComponentWrapper100 wrapper)

===================================

Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSComponentMetaData100'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{887BD061-82D4-4F06-A222-337D42E7F896}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)). (Microsoft.SqlServer.DTSPipelineWrap)

------------------------------ Program Location:

at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HandleUserException(Exception e) at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostProvideComponentProperties(IDTSManagedComponentWrapper100 wrapper) at Microsoft.SqlServer.Dts.Pipeline.Wrapper.CManagedComponentWrapperClass.ProvideComponentProperties() at Microsoft.DataTransformationServices.Design.PipelineTaskDesigner.AddNewComponent(String clsid, Boolean throwOnError, Boolean select)

Edit #1 Updated the TargetServerVersion property (in the Integration Services Project Configuration Properties) to SQL Server 2016 (from 2017). Doing this got me through the error above, however, resulted in a new error. Progress?

Error #2:

===================================

The component could not be added to the Data Flow task. Could not initialize the component. There is a potential problem in the ProvideComponentProperties method. (Microsoft Visual Studio)

===================================

Error at Data Flow Task [CustomEmailValidator [41]]: System.MissingMethodException: Method not found: 'Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSComponentMetaData100 Microsoft.SqlServer.Dts.Pipeline.PipelineComponent.get_ComponentMetaData()'. at CustomEmailValidator.CustomEmailValidatorTransform.ProvideComponentProperties() at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostProvideComponentProperties(IDTSManagedComponentWrapper100 wrapper)

===================================

Method not found: 'Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSComponentMetaData100 Microsoft.SqlServer.Dts.Pipeline.PipelineComponent.get_ComponentMetaData()'. (Microsoft.SqlServer.DTSPipelineWrap)

------------------------------ Program Location:

at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HandleUserException(Exception e) at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostProvideComponentProperties(IDTSManagedComponentWrapper100 wrapper) at Microsoft.SqlServer.Dts.Pipeline.Wrapper.CManagedComponentWrapperClass.ProvideComponentProperties() at Microsoft.DataTransformationServices.Design.PipelineTaskDesigner.AddNewComponent(String clsid, Boolean throwOnError, Boolean select)

c#
ssis
sql-server-data-tools
asked on Stack Overflow Apr 4, 2018 by Russ • edited Apr 4, 2018 by Russ

1 Answer

0

The likely culprit is that you developed your component against the SQL Server 2012 SSIS bindings. Using VS 2015, the SSIS project is targeting 2016 (or even 2017) as the default. So, when you add the task onto the canvas, the component binding IDs don't match up.

You either need to generate another version of your componentry for 2016 (and 2014 and 2017 if you want to cover all the bases) or change the target version of your SSIS project (right click on the project itself, select Properties. In the ...Build? section, it should say what the target version of SSIS/SQL Server is)

answered on Stack Overflow Apr 4, 2018 by billinkc

User contributions licensed under CC BY-SA 3.0