Reputation: 131
I'm trying to develop a custom source component for SSIS in VS2015. After struggling to even get the component's to display in the SSIS Toolbox I've managed to get that, but when clicking on the component instead of displaying the bespoke form it goes directly to the Advanced Editor. I've implemented the class exactly as described in the Microsoft documentation:
https://msdn.microsoft.com/en-us/library/ms136029.aspx
but it still doesn't show.
I've used the
namespace CustomImporter
{
[DtsPipelineComponent(
DisplayName = "Custom importer",
Description = "Custom Importer",
IconResource = "CustomImporter.ico",
UITypeName = "CustomImporter.CustomImporterUI, CustomImporter.CustomImporter, Version=1.1.0.0, Culture=neutral, PublicKeyToken=9b0a5b72a437255d",
ComponentType = ComponentType.SourceAdapter)
]
public class CustomImporter : Microsoft.SqlServer.Dts.Pipeline.PipelineComponent
{
//code to implement the class
}
and then in the forms class:
using System;
using System.Windows.Forms;
using Microsoft.SqlServer.Dts.Runtime;
using Microsoft.SqlServer.Dts.Pipeline.Design;
using Microsoft.SqlServer.Dts.Pipeline.Wrapper;
namespace CustomImporter
{
class CustomImporterUI : IDtsComponentUI
{
#region Members
IDTSComponentMetaData100 metaData;
IServiceProvider serviceProvider;
#endregion
#region IDtsComponentUI Member
bool IDtsComponentUI.Edit(IWin32Window parentWindow, Variables variables, Connections connections)
{
frmMain editor = new frmMain(metaData, serviceProvider, variables, connections);
DialogResult result = editor.ShowDialog(parentWindow);
if (result == DialogResult.OK)
return true;
return false;
}
void IDtsComponentUI.Help(IWin32Window parentWindow) {}
void IDtsComponentUI.Initialize(IDTSComponentMetaData100 dtsComponentMetadata, IServiceProvider serviceProvider)
{
this.metaData = dtsComponentMetadata;
this.serviceProvider = serviceProvider;
}
void IDtsComponentUI.New(IWin32Window parentWindow){}
void IDtsComponentUI.Delete(IWin32Window parentWindow){}
public void Initialize(IDTSComponentMetaData100 dtsComponentMetadata, IServiceProvider serviceProvider)
{
// Store the component metadata.
this.metaData = dtsComponentMetadata;
}
#endregion
}
}
Is there anything obvious that looks wrong? I'm not an expert in C# so I don't really know how the DtsPipeline code that specifies the UITypeName parameters should look. In the Microsoft reference link it doesn't match up with the rest of the class names or assembly name, but I've made sure that when I register the component into the GAC or uninstall it the PublicKeyToken matches what I see in the Command Prompt window so it can't be that. I know this is extremely fiddly, but I can't see any documentation anywhere to get the form to show.
I've registered the dll in the GAC and copied the dll to the following folders: C:\Program Files\Microsoft SQL Server\130\DTS\PipelineComponents C:\Program Files (x86)\Microsoft SQL Server\130\DTS\PipelineComponents
And it is appearing in SSIS Toolbox.
Any help would be much appreciated.
Upvotes: 1
Views: 694
Reputation: 1
I encountered this issue as well. After banging my head on the table for two days, I noticed that, when building the projects, VS listed some warnings(Code CS1762
) regarding the Embed Interop Types
property of the Microsoft.SqlServer.DTSPipelineWrap
and Microsoft.SQLServer.DTSRuntimeWrap
assemblies references in the UI project.
A few days ago, I posted an answer for another issue, which also dealt with the Embed Interop Types
properties of those references, and the solution was to set their values to false
. I therefore tried applying it here as well, and surprisingly it solved the problem.
Upvotes: 0
Reputation: 326
I think your UITypeName attribute is wrong. It should be the
"namespace.classThatInheritsFromIDtsComponentUI, AssemblyName"
try
UITypeName = "CustomImporter.CustomImporterUI, CustomImporter, Version=1.1.0.0, Culture=neutral, PublicKeyToken=9b0a5b72a437255d"
Upvotes: 0