将项目移动到其他硬盘驱动器后出现DLL问题
本文关键字:DLL 问题 硬盘驱动器 项目 移动 其他 | 更新日期: 2023-09-27 17:56:20
我刚刚将硬盘和操作系统从XP更改为Win7。在我的源代码在 D: 驱动器上之前,现在它们在 F: 上,在相同的文件夹结构下。
问题出在 FluentNhibernate 配置上。我得到以下无效操作异常堆栈跟踪:
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:,并设置为复制本地= 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:
它实际上并没有试图访问D:(据我们所知) - 它只是认为这就是BuildSessionFactory的源代码所在。如果你想解决这个问题,你可以自己重建FluentNHibernate,但我不认为这是问题的根源。
看看异常的消息是什么 - 这可能会提供更多信息。
我认为关键问题是带有消息的InnerException:
找不到请求的 .Net 框架数据提供程序。 它可能未安装。
看起来您需要在新计算机上将相关数据提供程序安装到 GAC,或者确保在项目中正确引用它。
似乎可以从以下位置获得最新版本的SQLite提供程序:
http://sqlite.phxsoftware.com/