2012-07-16 57 views
0

我想在我的託管代碼實現自定義數據流組件。這裏是我的自定義數據流組件:自定義管道組件SSIS錯誤:HREF 0xC0048021

[DtsPipelineComponent(DisplayName = "RenameComponent", ComponentType = ComponentType.Transform)] 
public class MapperComponent : PipelineComponent 
{ 
    List<IDTSVirtualInputColumn100> dontMapList; 

    public override void ProvideComponentProperties() 
    { 
     base.ProvideComponentProperties(); 

     base.RemoveAllInputsOutputsAndCustomProperties(); 
     IDTSInput100 input = ComponentMetaData.InputCollection.New(); 
     input.Name = "Input"; 

     IDTSOutput100 output = ComponentMetaData.OutputCollection.New(); 
     output.Name = "Output"; 
     output.SynchronousInputID = input.ID; 

     // Make the output asynchronous 
     output.SynchronousInputID = 0; 
     FindOldColumns(input); 
    } 
} 

我編譯,與GAC註冊,並保存到C:\ Program Files文件\ Microsoft SQL Server的\ 100個\ DTS \ PipelineComponents目錄。

我然後運行下面的代碼將組件添加到我的數據流任務:

private static IDTSComponentMetaData100 CreateRenameTransformation(MainPipe dataFlow, Train train) 
    { 
     IDTSComponentMetaData100 renameTransformation = dataFlow.ComponentMetaDataCollection.New(); 

     // Set stock properties 
     renameTransformation.ComponentClassID = "Dexter.CustomComponents.MapperComponent"; 
     renameTransformation.Name = "RenameTransformation"; 
     renameTransformation.Description = "Rename and remove incompatible columns"; 

     CManagedComponentWrapper instance = renameTransformation.Instantiate(); 
     instance.ProvideComponentProperties(); 

     return renameTransformation as IDTSComponentMetaData100; 
    } 

在運行時(當我嘗試創建pacakge),我收到以下錯誤: 0xC0048021 -1073446879 DTS_E_ERRORCOMPONENT 該模塊丟失,未註冊,不可升級,或缺少必需的接口。該組件的聯繫信息是「%1」。

感謝,

+0

此外僅供參考,當我讀取所有PipelineComponentInfos componentInfos = application.PipelineComponentInfos;組件創建名稱,Dexter.CustomComponents.MapperComponent已註冊。 – doug 2012-07-16 16:59:19

+0

只是爲了驗證我明白你在做什麼。您已創建自定義數據流組件,並進行註冊並安裝它。您正在嘗試通過SSIS對象模型創建一個包來使用組件,*當它失敗時就是*。如果您使用BIDS執行相同的任務會怎麼樣? – billinkc 2012-07-16 17:55:12

+0

你怎麼沒有將組件添加到BIDS?我想你必須將組件添加到BIDS才能在包中使用它。 – rvphx 2012-07-16 20:01:26

回答

1

我曾面臨同樣的問題,「錯誤代碼:0xC0048021」,並解決它。由於數據流任務中添加了腳本組件,因此出現此問題。

我從這裏安裝此版本的SSDT的https://msdn.microsoft.com/en-us/mt429383

然後,在SSDT Solution Explorer中右鍵單擊該項目,進入屬性 - >配置屬性 - > TargetServerVersion = SQL SERVER 2014

然後,在SSDT Solution Explorer中右鍵單擊該項目,進入屬性 - >配置屬性 - >調試 - > Run64BitRuntime =假

參照此鏈接http://blogs.msdn.com/b/ssis/archive/2016/03/03/what-s-new-for-ssis-2016-rc0.aspx