2012-03-05 56 views
4

我使用NHibernate 3.1,並且我更新到3.2版本。我也使用confOrm 1.0.1.5,我更新到2.0.0.0v版本。我的Firebird NET Provider版本是2.7。我對代碼做了一些修改,因爲confOrm不再包含ConfOrm.Mapper。當我嘗試做一個選擇它會返回以下錯誤:NHibernate 3.2更新後無法找到請求的.Net Framework數據提供程序

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

任何幫助表示讚賞,謝謝!

回答

2

我GOOGLE了你的錯誤,來到this thread on 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> 

順便說一句,我用Google搜索Unable to find the requested .Net Framework Data Provider. It may not be installed.,這是報告的錯誤的更有趣的部分。有更有趣的發現,如果上述沒有幫助。


一點點進一步的研究給我帶來了this blog post,這就解釋了爲什麼這可能是會有一個問題,如果有多個的dataProvider,以及如何解決它。注意:StackOverflow questionthis one(解決方案也在machine.config中)相關。

0

Abel,謝謝你的回答。我儘可能地嘗試!每一個可能的解決方案,我嘗試重新安裝VS,Firebird,Net Framework 4,但沒有任何工作,所以我格式化我的電腦,並與新版本的nhibernate工作正常。

相關問題