无法找到请求的.net框架数据提供程序。它可能没有安装

发布于 2024-09-24 07:51:56 字数 216 浏览 6 评论 0原文

我正在尝试连接到 64 位 Windows 7 电脑上的 informix 数据库。我已经能够在 32 位电脑上很好地建立连接,但是当尝试在 64 位电脑上运行它时出现上述错误。它正在寻找 IBM.Data.Informix 驱动程序,但表示找不到。我的 GAC 中有该 dll 的 2 个版本 - 3.0.0.2 和 9.0.0.2。

有谁知道如何让它发挥作用吗?

感谢您的任何想法。

I am trying to connect to an informix database on a 64 bit windows 7 pc. I have been able to make the connection just fine on a 32bit pc, but I get the above error when trying to run it on the 64 bit pc. It is looking for the IBM.Data.Informix driver, but says it can't find it. I've got 2 versions of that dll in my GAC - 3.0.0.2 and 9.0.0.2.

Does anyone have any idea how to get this working?

Thanks for any thoughts.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

深空失忆 2024-10-01 07:51:56

我发现了问题 - 我必须通过添加以下行来编辑 machine.config -

<runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" appliesTo="v2.0.50727">
            <dependentAssembly xmlns="urn:schemas-microsoft-com:asm.v1">
                <assemblyIdentity name="IBM.Data.Informix" publicKeyToken="7c307b91aa13d208" culture=""/>
                <bindingRedirect oldVersion="2.81.0.0" newVersion="3.0.0.2"/>
            </dependentAssembly>
            <dependentAssembly xmlns="urn:schemas-microsoft-com:asm.v1">
                <assemblyIdentity name="IBM.Data.Informix.3.0.0" publicKeyToken="7c307b91aa13d208" culture=""/>
                <bindingRedirect oldVersion="2.81.0.0" newVersion="3.0.0.2"/>
                <codeBase version="3.0.0.2" href="C:\Program Files\IBM\Informix\Client-SDK\bin\netf20\specific\IBM.Data.Informix.3.0.0.dll"/>
            </dependentAssembly>
        </assemblyBinding>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" appliesTo="">
            <dependentAssembly xmlns="urn:schemas-microsoft-com:asm.v1">
                <assemblyIdentity name="IBM.Data.Informix" publicKeyToken="7c307b91aa13d208" culture=""/>
                <bindingRedirect oldVersion="2.81.0.0" newVersion="3.0.0.2"/>
            </dependentAssembly>
            <dependentAssembly xmlns="urn:schemas-microsoft-com:asm.v1">
                <assemblyIdentity name="IBM.Data.Informix.3.0.0" publicKeyToken="7c307b91aa13d208" culture=""/>
                <bindingRedirect oldVersion="2.81.0.0" newVersion="3.0.0.2"/>
                <codeBase version="3.0.0.2" href="C:\Program Files\IBM\Informix\Client-SDK\bin\netf20\specific\IBM.Data.Informix.3.0.0.dll"/>
            </dependentAssembly>
        </assemblyBinding>
    </runtime>  

    <connectionStrings>
        <add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
    </connectionStrings>

    <system.data>
        <DbProviderFactories>
            <add name="Microsoft SQL Server Compact Data Provider" invariant="System.Data.SqlServerCe.3.5" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=3.5.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
            <add name="IBM Informix .NET Data Provider" invariant="IBM.Data.Informix" description="IBM Informix Data Provider for .NET Framework 2.0" type="IBM.Data.Informix.IfxFactory, IBM.Data.Informix, Version=3.0.0.2, Culture=neutral, PublicKeyToken=7c307b91aa13d208"/>
            <add name="IBM Informix .NET Data Provider 3.0.0" invariant="IBM.Data.Informix.3.0.0" description="IBM Informix Data Provider 3.0.0 for .NET Framework 2.0" type="IBM.Data.Informix.IfxFactory, IBM.Data.Informix.3.0.0, Version=3.0.0.2, Culture=neutral, PublicKeyToken=7c307b91aa13d208"/>
        </DbProviderFactories>
    </system.data>

I found the issue - I had to edit the machine.config by adding the following lines -

<runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" appliesTo="v2.0.50727">
            <dependentAssembly xmlns="urn:schemas-microsoft-com:asm.v1">
                <assemblyIdentity name="IBM.Data.Informix" publicKeyToken="7c307b91aa13d208" culture=""/>
                <bindingRedirect oldVersion="2.81.0.0" newVersion="3.0.0.2"/>
            </dependentAssembly>
            <dependentAssembly xmlns="urn:schemas-microsoft-com:asm.v1">
                <assemblyIdentity name="IBM.Data.Informix.3.0.0" publicKeyToken="7c307b91aa13d208" culture=""/>
                <bindingRedirect oldVersion="2.81.0.0" newVersion="3.0.0.2"/>
                <codeBase version="3.0.0.2" href="C:\Program Files\IBM\Informix\Client-SDK\bin\netf20\specific\IBM.Data.Informix.3.0.0.dll"/>
            </dependentAssembly>
        </assemblyBinding>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" appliesTo="">
            <dependentAssembly xmlns="urn:schemas-microsoft-com:asm.v1">
                <assemblyIdentity name="IBM.Data.Informix" publicKeyToken="7c307b91aa13d208" culture=""/>
                <bindingRedirect oldVersion="2.81.0.0" newVersion="3.0.0.2"/>
            </dependentAssembly>
            <dependentAssembly xmlns="urn:schemas-microsoft-com:asm.v1">
                <assemblyIdentity name="IBM.Data.Informix.3.0.0" publicKeyToken="7c307b91aa13d208" culture=""/>
                <bindingRedirect oldVersion="2.81.0.0" newVersion="3.0.0.2"/>
                <codeBase version="3.0.0.2" href="C:\Program Files\IBM\Informix\Client-SDK\bin\netf20\specific\IBM.Data.Informix.3.0.0.dll"/>
            </dependentAssembly>
        </assemblyBinding>
    </runtime>  

    <connectionStrings>
        <add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
    </connectionStrings>

    <system.data>
        <DbProviderFactories>
            <add name="Microsoft SQL Server Compact Data Provider" invariant="System.Data.SqlServerCe.3.5" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=3.5.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
            <add name="IBM Informix .NET Data Provider" invariant="IBM.Data.Informix" description="IBM Informix Data Provider for .NET Framework 2.0" type="IBM.Data.Informix.IfxFactory, IBM.Data.Informix, Version=3.0.0.2, Culture=neutral, PublicKeyToken=7c307b91aa13d208"/>
            <add name="IBM Informix .NET Data Provider 3.0.0" invariant="IBM.Data.Informix.3.0.0" description="IBM Informix Data Provider 3.0.0 for .NET Framework 2.0" type="IBM.Data.Informix.IfxFactory, IBM.Data.Informix.3.0.0, Version=3.0.0.2, Culture=neutral, PublicKeyToken=7c307b91aa13d208"/>
        </DbProviderFactories>
    </system.data>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文