【问题标题】:HRESULT: 0xC0048021 in 64 bit modeHRESULT:64 位模式下的 0xC0048021
【发布时间】:2015-10-06 21:55:00
【问题描述】:

请看下面的代码片段:

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?

2015 年 7 月 10 日更新

我已经运行了下面的代码:

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 个条目,包括:Fuzzy Lookup DTSTransform.BestMatch.2

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

【问题讨论】:

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


    【解决方案1】:

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

    如需了解 DTSX 和 DTSX2 的不同之处,请check here

    【讨论】:

    • 谢谢。我已经添加了问题的更新。你能看看吗? 64 位模式下缺少模糊查找。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-16
    相关资源
    最近更新 更多