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

时间:2010-09-17 13:00:40

标签: odbc informix

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

有没有人知道如何让这个工作?

感谢您的任何想法。

1 个答案:

答案 0 :(得分:0)

我发现了这个问题 - 我必须通过添加以下行来编辑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>