自定义PipelineComponent从SQL 2008R2升级到2012的SSIS包

问题描述:

我已将.net 3.5的自定义PipelineComponent升级到4.0,并且已更新引用从... Server \ 100 \ SDK ...到... Server \ 110 \ SDK ... 发布dll已被复制到C:\ Program Files \ Microsoft SQL Server \ 110 \ DTS \ PipelineComponents \以及C:\ Program Files文件(x86)\ Microsoft SQL Server \ 110 \ DTS \ PipelineComponents \和安装在GAC C:\ Windows \ Microsoft.NET \ assembly \ GAC_MSIL中。自定义PipelineComponent从SQL 2008R2升级到2012的SSIS包

我已经为SQL2012安装了完整的SQL Server 2012和Visual Studio数据工具。

在编辑Visual Studio中的SSIS包期间,数据流选项卡上的SSIS Toolbox中的包可见。

在Visual Studio中更新过程在Visual Studio 2008目标SQL2008R2以下错误创建的软件包的2010/2012显示:

  • 升级包PackageName.dtsx(错误) 消息 错误0xc0047062:DataFlowTaskName:微软.SqlServer.Dts.Pipeline.ComponentUpgradeFailedException:PC FxRate Lookup无法自行升级。[[PerformUpgrade方法失败。]] at Microsoft.SqlServer.Dts.Pipeline.PipelineComponent.PerformUpgrade(Int32 pipelineVersion) at MyCompanyName.Services。 Infrastructure.DataFlow.PCDictionaryLookup`2.PerformUpgrade(Int32 pip elineVersion) 在Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostCheckAndPerformUpgrade(IDTSManagedComponentWrapper100包装,的Int32 lPipelineVersion)

错误0xc004801f:DataFlowTaskName:为 “PC FxRate查找” 的组件元数据无法升级到新版本的组件。 PerformUpgrade方法失败。

错误0xc001f429:软件包升级:软件包PackageName.dtsx的加载失败。

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Interoperability", "CA1405:ComVisibleTypeBaseTypesShouldBeComVisible"), ComVisible(true)] 
[ 
DtsPipelineComponent(
    CurrentVersion = 6, 
    DisplayName = "PC FxRate Lookup", 
    Description = "send to Output the corresponding value in a map via key from input for a given ScenarioId or a default value") 

] 
public class PCFxRateLookup : PCDictionaryLookup<string, double?> 



[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Interoperability", "CA1405:ComVisibleTypeBaseTypesShouldBeComVisible"), ComVisible(true)] 
[ 
DtsPipelineComponent(
    ComponentType = ComponentType.Transform, 
    DisplayName = "PC Dictionary Lookup", 
    Description = "Output the corresponding value in a map via key from input for a given ScenarioId or a default value") 
] 
public abstract class PCDictionaryLookup<T1, T2> : PipelineComponent 
{ 

有什么建议吗?

+0

您是否使用gacutil将其安装在GAC中? –

+0

是的,从C:\ Program Files \ Microsoft SDK \ Windows \ v7.0A \ bin \ NETFX 4.0工具 – Leszek

问题出在自定义的SSIS PipelineComponent中。在SSIS数据流中添加新组件没有问题,但升级 - 没有。 我必须覆盖从PipelineComponent基类PerformUpgrade方法如下:

public override void PerformUpgrade(int pipelineVersion) 
{ 
    DtsPipelineComponentAttribute attribute = (DtsPipelineComponentAttribute)Attribute.GetCustomAttribute(this.GetType(), typeof(DtsPipelineComponentAttribute), false); 
    int currentVersion = attribute.CurrentVersion; 
    ComponentMetaData.Version = currentVersion; 
} 

在GAC和适当的SQL文件夹建设项目,将DLL后,我不得不用记事本更新* .dtsx程序包。

1)Version = 2.0.0.0 >> Version = 4.0.0.0(.net向自定义SSIS包输入参数)。

2)版本= 3.0.0.0 >>版本= 4.0.0.0(新版本的自定义SSIS包)。

之后,只需使用向导来更新SSIS解决方案。

就是这样。