"Cannot find the requested .Net Framework data provider" after upgrading to NHibernate 3.2

I am using NHibernate 3.1 and I am upgrading to version 3.2. I also use confOrm 1.0.1.5, and I upgrade to 2.0.0.0vVersion. My version of Firebird NET Provider is 2.7. I am making some changes to my code because confOrm no longer contains ConfOrm.Mapper . When I try to make a selection, it returns the following error:

 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() 

Any help is appreciated, thanks!

+4
source share
2 answers

I searched for your error and came to this thread in Social MSDN . To generalize the solution (scroll down for the Barrett solution), it is likely that something is wrong in your machine.config files. This user reported adding a closing tag to his machine.config file:

 <!-- 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> 

Btw, I googled for Unable to find the requested .Net Framework data provider. It cannot be installed. , which is a more interesting part of the error reported. There are more interesting finds if the above does not help.


A few additional studies led me to this blog post explaining why this could be a problem in a situation where you have multiple dataproviders, and how to solve it. Note: this question fooobar.com/questions/121353 / ... is related, like this one (the solution is also in machine.config).

+2
source

Abel, thanks for your reply. I try my best! Every possible solution, I try to reinstall VS, Firebird, Net Framework 4, but nothing works, so I formatted my computer and worked perfectly with the new version of nhibernate.

0
source

Source: https://habr.com/ru/post/1399860/


All Articles