我剛將硬盤和操作系統從XP更改爲Win7。 之前我的源代碼是在D:驅動器,現在他們在F:,在相同的文件夾結構下。將項目移動到其他硬盤後的Dll問題
問題在於FluentNhibernate配置。我得到以下InvalidOperationException異常堆棧跟蹤:
at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory() in d:\Builds\FluentNH-v1.x-nh3\src\FluentNHibernate\Cfg\FluentConfiguration.cs:line 115
at TSI_Manager.FNH_Manager.CreateSessionFactory() in F:\.....
正如你所看到的,它試圖訪問d: ..我不知道到底是什麼嘗試,雖然訪問的內容。但從我的項目參考看,所有參考(系統...除外)都是F:,並設置爲Copy Local = True。
那麼還是指什麼D:?我錯過了哪些步驟?
乾杯!
編輯: 異常詳細信息:
System.InvalidOperationException was unhandled
Message=An error occurred creating the form. See Exception.InnerException for details. The error is: An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail.
Source=TSI Manager
StackTrace:
at TSI_Manager.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190
at TSI_Manager.My.MyProject.MyForms.get_MainForm()
at TSI_Manager.My.MyApplication.OnCreateMainForm() in F:\My Jotta\VB\Projects VS2010\IB API Projects\9.64.16\ClientManager\v0004 Changing ActiveUser\TSI Manager\My Project\Application.Designer.vb:line 35
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at TSI_Manager.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: FluentNHibernate.Cfg.FluentConfigurationException
Message=An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail.
Source=FluentNHibernate
StackTrace:
at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory() in d:\Builds\FluentNH-v1.x-nh3\src\FluentNHibernate\Cfg\FluentConfiguration.cs:line 115
at TSI_Manager.FNH_Manager.CreateSessionFactory() in F:\My Jotta\VB\Projects VS2010\IB API Projects\9.64.16\ClientManager\v0004 Changing ActiveUser\TSI Manager\DAL\FnhManager.vb:line 43
at TSI_Manager.FNH_Manager.ConfigureSessionFactory(String connectionStr) in F:\My Jotta\VB\Projects VS2010\IB API Projects\9.64.16\ClientManager\v0004 Changing ActiveUser\TSI Manager\DAL\FnhManager.vb:line 18
at TSI_Manager.MainBL.InitializeDatabase() in F:\My Jotta\VB\Projects VS2010\IB API Projects\9.64.16\ClientManager\v0004 Changing ActiveUser\TSI Manager\Generic\MainBL.vb:line 174
at TSI_Manager.MainBL..ctor() in F:\My Jotta\VB\Projects VS2010\IB API Projects\9.64.16\ClientManager\v0004 Changing ActiveUser\TSI Manager\Generic\MainBL.vb:line 92
at TSI_Manager.MainForm..ctor() in F:\My Jotta\VB\Projects VS2010\IB API Projects\9.64.16\ClientManager\v0004 Changing ActiveUser\TSI Manager\GUI\Forms\MainForm.vb:line 6
InnerException: NHibernate.HibernateException
Message=Could not create the driver from NHibernate.Driver.SQLite20Driver, NHibernate, Version=3.0.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4.
Source=NHibernate
StackTrace:
at NHibernate.Connection.ConnectionProvider.ConfigureDriver(IDictionary`2 settings) in d:\CSharp\NH\nhibernate\src\NHibernate\Connection\ConnectionProvider.cs:line 116
at NHibernate.Connection.ConnectionProvider.Configure(IDictionary`2 settings) in d:\CSharp\NH\nhibernate\src\NHibernate\Connection\ConnectionProvider.cs:line 64
at NHibernate.Connection.ConnectionProviderFactory.NewConnectionProvider(IDictionary`2 settings) in d:\CSharp\NH\nhibernate\src\NHibernate\Connection\ConnectionProviderFactory.cs:line 50
at NHibernate.Cfg.SettingsFactory.BuildSettings(IDictionary`2 properties) in d:\CSharp\NH\nhibernate\src\NHibernate\Cfg\SettingsFactory.cs:line 83
at NHibernate.Cfg.Configuration.BuildSettings() in d:\CSharp\NH\nhibernate\src\NHibernate\Cfg\Configuration.cs:line 1687
at NHibernate.Cfg.Configuration.BuildSessionFactory() in d:\CSharp\NH\nhibernate\src\NHibernate\Cfg\Configuration.cs:line 1239
at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory() in d:\Builds\FluentNH-v1.x-nh3\src\FluentNHibernate\Cfg\FluentConfiguration.cs:line 108
InnerException: System.Reflection.TargetInvocationException
Message=Exception has been thrown by the target of an invocation.
Source=mscorlib
StackTrace:
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at NHibernate.Bytecode.ActivatorObjectsFactory.CreateInstance(Type type) in d:\CSharp\NH\nhibernate\src\NHibernate\Bytecode\ActivatorObjectsFactory.cs:line 9
at NHibernate.Connection.ConnectionProvider.ConfigureDriver(IDictionary`2 settings) in d:\CSharp\NH\nhibernate\src\NHibernate\Connection\ConnectionProvider.cs:line 107
InnerException: System.ArgumentException
Message=Unable to find the requested .Net Framework Data Provider. It may not be installed.
Source=System.Data
StackTrace:
at System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName)
at NHibernate.Driver.ReflectionBasedDriver..ctor(String providerInvariantName, String driverAssemblyName, String connectionTypeName, String commandTypeName) in d:\CSharp\NH\nhibernate\src\NHibernate\Driver\ReflectionBasedDriver.cs:line 49
at NHibernate.Driver.SQLite20Driver..ctor() in d:\CSharp\NH\nhibernate\src\NHibernate\Driver\SQLite20Driver.cs:line 28
InnerException:
我希望它告訴我更多,但它只是給出了一個標準的消息,我得到了幾乎所有類型的流暢配置的:
看來,可以從所獲得的SQLite的供應商的最新版本錯誤:消息是:創建表單時發生錯誤。有關詳細信息,請參閱Exception.InnerException。錯誤是:創建SessionFactory時使用了無效或不完整的配置。請參閱PotentialReasons集合和InnerException以獲取更多詳細信息。 – bretddog 2011-05-14 08:38:34
@ bretddog:那麼這比你之前展示的要多得多。建議下一步顯然是查看InnerException和PotentialReasons集合。是你做的嗎? – 2011-05-14 08:41:11
好的,我必須說我不擅長閱讀異常細節。我上面張貼了剪貼板副本。所以,如果它給你一些提示,我可以學習嗎? PotentialReasons說Count = 0,不知道這是指什麼? – bretddog 2011-05-14 08:53:12