HRESULT:64位模式下的0xC0048021

时间:2015-10-06 21:55:00

标签: sql-server vb.net visual-studio ssis

请参阅以下代码片段:

Dim fuzzyLookup As IDTSComponentMetaData100 = pipeline.ComponentMetaDataCollection.[New]()
        fuzzyLookup.ComponentClassID = "{5056651F-F227-4978-94DF-53CDF9E8CCB6}"
        Dim destDesignTimeComponentFuzzy As IDTSDesigntimeComponent100 = fuzzyLookup.Instantiate()
        destDesignTimeComponentFuzzy.ProvideComponentProperties() 'line 4

我导入了以下命名空间:

Microsoft.SqlServer.Dts.Runtime
Microsoft.SqlServer.Dts.Pipeline.Wrapper
Microsoft.SqlServer.Dts.Runtime.Wrapper

我添加了以下参考资料:

Microsoft.SQLServer.dtspipelinewrap.dll
Microsoft.SQLServer.dtsruntimewrap.dll
Microsoft.SQLServer.manageddts.dll

当我添加32位引用时,整个代码都会运行,但是没有任何反应,即package.execute什么也不做 - 模糊查找不起作用(因此我相信:https://connect.microsoft.com/SQLServer/feedback/details/634516

因此我尝试在上面的3个DLL中添加64位引用。然后我在代码的第4行得到一个例外:HRESULT:0xC0048021。为什么我在64位模式下会出现此异常?

我所做的研究表明组件类ID是错误的。 64位模糊查找是否有不同的组件类ID?

更新07/10/15

我已经运行了以下代码:

Public Shared Sub LoopComponents()
        Dim fileName As String = "C:\Development\ProgrammaticLookup\64Bit.txt"
        Dim application As New Application()
        Dim componentInfos As PipelineComponentInfos = application.PipelineComponentInfos
        Dim i As Integer = 0
        For Each componentInfo As PipelineComponentInfo In componentInfos
            i = i + 1


            Using fs As New FileStream(fileName, FileMode.Append, FileAccess.Write)
                Using sw As New StreamWriter(fs)
                    sw.WriteLine(componentInfo.Name + vbTab + componentInfo.CreationName)
                End Using
            End Using
        Next
        Console.Read()
    End Sub

当我以32位模式运行上面的代码时,日志文件中添加了42个条目,包括:模糊查找DTSTransform.BestMatch.2

当我以64位模式运行代码时,日志文件中只添加了11个条目。模糊查找不是其中一个条目。为什么64位模式中缺少组件?

1 个答案:

答案 0 :(得分:0)

您使用的是SQL Server 2012还是更高版本?如果是这样,您可能正在使用DTSX2,并且看起来模糊查找的类ID为{E4A5F949-EC93-45AB-8B36-B52936257EC2},根据this document - 第258页。

有关DTSX和DTSX2差异的概述,check here

相关问题