2015-11-02 95 views
0

我已將.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

回答

0

問題出在自定義的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解決方案。

就是這樣。