C# VS2015-SSIS自定义组件-定制表单未显示,而是获取高级编辑器
我正在尝试为VS2015中的SSIS开发一个自定义源组件。在努力让组件显示在SSIS工具箱中之后,我成功地做到了这一点,但是当单击组件而不是显示定制表单时,它会直接进入高级编辑器。我完全按照Microsoft文档中的描述实现了该类: 但它仍然没有显示出来 我已经用过了C# VS2015-SSIS自定义组件-定制表单未显示,而是获取高级编辑器,c#,sql-server,ssis,visual-studio-2015,C#,Sql Server,Ssis,Visual Studio 2015,我正在尝试为VS2015中的SSIS开发一个自定义源组件。在努力让组件显示在SSIS工具箱中之后,我成功地做到了这一点,但是当单击组件而不是显示定制表单时,它会直接进入高级编辑器。我完全按照Microsoft文档中的描述实现了该类: 但它仍然没有显示出来 我已经用过了 namespace CustomImporter { [DtsPipelineComponent( DisplayName = "Custom importer", Description = "Custom I
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
}
然后在forms类中:
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
}
}
有什么明显的错误吗?我不是C#方面的专家,所以我真的不知道指定UITypeName参数的DtsPipeline代码应该是什么样子。在Microsoft引用链接中,它与其余的类名或程序集名不匹配,但我已确保当我将组件注册到GAC或卸载它时,PublicKeyToken与我在命令提示窗口中看到的内容匹配,因此它不能是那样。我知道这是非常微妙的,但我在任何地方都看不到任何文档来显示表单
我已在GAC中注册了dll,并将其复制到以下文件夹:
C:\Program Files\Microsoft SQL Server\130\DTS\PipelineComponents
C:\ProgramFiles(x86)\Microsoft SQL Server\130\DTS\PipelineComponents
它出现在SSIS工具箱中
任何帮助都将不胜感激。我认为您的UITypeName属性是错误的。应该是
"namespace.classThatInheritsFromIDtsComponentUI, AssemblyName"
试一试
我认为您的UITypeName属性是错误的。应该是
"namespace.classThatInheritsFromIDtsComponentUI, AssemblyName"
试一试
我也遇到了这个问题。在我的头撞在桌子上两天后,我注意到,在构建项目时,VS列出了一些警告(Code
CS1762
)关于UI项目中的Microsoft.SqlServer.DTSPipelineWrap
和Microsoft.SqlServer.DTSRuntimeWrap
程序集引用的Embed Interop Types
属性
几天前,我讨论了另一个问题,该问题还涉及那些引用的
嵌入互操作类型
属性,解决方案是将它们的值设置为false
。因此,我也尝试在这里应用它,令人惊讶的是它解决了这个问题。我也遇到了这个问题。在我的头撞在桌子上两天后,我注意到,在构建项目时,VS列出了一些警告(CodeCS1762
)关于UI项目中的Microsoft.SqlServer.DTSPipelineWrap
和Microsoft.SqlServer.DTSRuntimeWrap
程序集引用的Embed Interop Types
属性
几天前,我讨论了另一个问题,该问题还涉及那些引用的
嵌入互操作类型
属性,解决方案是将它们的值设置为false
。因此,我也尝试在这里应用它,令人惊讶的是它解决了问题。您解决了这个问题吗?我也有同样的问题,如果你能分享你是如何解决这个问题的,我将不胜感激。你解决了这个问题吗?我也有同样的问题,如果你能分享你是如何解决这个问题的,我将不胜感激。