";找不到请求的.Net Framework数据提供程序“;在更新到NHibernate 3.2之后

本文关键字:更新 之后 程序 NHibernate 请求 找不到 quot Net 数据 Framework | 更新日期: 2023-09-27 18:26:40

我使用NHibernate 3.1,并更新到3.2版本。此外,我使用confOrm 1.0.1.5,并更新到2.0.0.0vVersion。我的Firebird NET Provider版本是2.7。我对代码做了一些修改,因为confOrm不再包含ConfOrm.Mapper。当我尝试进行选择时,它会返回以下错误:

NHibernate.HibernateException : Could not create the driver from NHibernate.Driver.FirebirdClientDriver, NHibernate, Version=3.2.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4.
  ----> System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation.
  ----> System.ArgumentException : Unable to find the requested .Net Framework Data Provider.  It may not be installed.
at NHibernate.Connection.ConnectionProvider.ConfigureDriver(IDictionary`2 settings)
at NHibernate.Connection.ConnectionProviderFactory.NewConnectionProvider(IDictionary`2 settings)
at NHibernate.Cfg.SettingsFactory.BuildSettings(IDictionary`2 properties)
at NHibernate.Cfg.Configuration.BuildSettings()
at NHibernate.Cfg.Configuration.BuildSessionFactory()
at SoftManager.Dao.Util.SessionManager.get_factory() in SessionManager.cs: line 15
at SoftManager.Dao.Util.SessionManager.getSession() in SessionManager.cs: line 23
at SoftManager.Dao.GenericDao`1.findUniqueByWhere(Restricao rest, Order order) in GenericDao.cs: line 144
at SoftManager.Dao.CidadeDao.findUniqueByWhere(Restricao rest, Order order) in CidadeDao.cs: line 52
at SoftManager.Teste.TesteConsulta.consultaCidade2() in TesteConsulta.cs: line 52
at SoftManager.Teste.TesteConsulta.testes() in TesteConsulta.cs: line 17
--TargetInvocationException
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, ref Boolean canBeCached, ref RuntimeMethodHandleInternal ctor, ref Boolean bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at NHibernate.Bytecode.ActivatorObjectsFactory.CreateInstance(Type type)
at NHibernate.Connection.ConnectionProvider.ConfigureDriver(IDictionary`2 settings)
--ArgumentException
at NHibernate.Driver.ReflectionBasedDriver..ctor(String providerInvariantName, String driverAssemblyName, String connectionTypeName, String commandTypeName)
at NHibernate.Driver.FirebirdClientDriver..ctor()

感谢您的帮助!

";找不到请求的.Net Framework数据提供程序“;在更新到NHibernate 3.2之后

我在谷歌上搜索了你的错误,并在Social MSDN上找到了这个线程。总结解决方案(向下滚动查看Barrett的解决方案),您的machine.config文件中可能出现了问题。该用户在他的machine.config中报告了一个额外的结束标记,如下所示:

<!-- notice the double closing tag -->
<system.data>
    <DbProviderFactories>
        <add name="Odbc Data Provider" invariant="System.Data.Odbc" ... />
        <add name="OleDb Data Provider" invariant="System.Data.OleDb" ... />
        <add name="OracleClient Data Provider" invariant="System.Data ... />
        <add name="SqlClient Data Provider" invariant="System.Data ... />
        <add name="IBM DB2 for i .NET Provider" invariant="IBM.Data ... />
        <add name="Microsoft SQL Server Compact Data Provider" ... /></DbProviderFactories>
    <DbProviderFactories/>
</system.data>

顺便说一句,我在谷歌上搜索了找不到请求的.Net Framework数据提供程序。可能未安装,这是报告的错误中更有趣的部分。如果以上内容没有帮助的话,还有更多有趣的发现。


进一步的研究让我看到了这篇博客文章,它解释了为什么在有多个数据提供程序的情况下这会是一个问题,以及如何解决它。注意:这个StackOverflow问题是相关的,这个问题也是相关的(解决方案也在machine.config中)。

Abel,谢谢你的回答。我尽一切可能!每种可能的解决方案,我都尝试重新安装VS、Firebird、Net Framework 4,但都不起作用,所以我格式化了我的电脑,并与新版本的nhibernate配合使用。