Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/unity3d/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Unity3D&x2B;NHibernate,碰撞载荷“;Unity 3.5.net完整基类库“;_Nhibernate_Unity3d - Fatal编程技术网

Unity3D&x2B;NHibernate,碰撞载荷“;Unity 3.5.net完整基类库“;

Unity3D&x2B;NHibernate,碰撞载荷“;Unity 3.5.net完整基类库“;,nhibernate,unity3d,Nhibernate,Unity3d,我想娶Unity3d和NHibernate。经过大量的魔法后,它在编辑器中工作,但在Windows standalone.exe中崩溃 我拥有的主要数据访问库: MySql.Data.dll I18N.dll I18N.West.dll System.Data.dll (2.0.5, for Unity) NHibernate.dll (3.4.0) win应用程序启动时的崩溃是: TypeLoadException: Could not load type 'System.Data.Comm

我想娶Unity3d和NHibernate。经过大量的魔法后,它在编辑器中工作,但在Windows standalone.exe中崩溃

我拥有的主要数据访问库:

MySql.Data.dll
I18N.dll
I18N.West.dll
System.Data.dll (2.0.5, for Unity)
NHibernate.dll (3.4.0)
win应用程序启动时的崩溃是:

TypeLoadException: Could not load type 'System.Data.Common.DbProviderFactories' from assembly 'NHibernate'.
  at NHibernate.Driver.MySqlDataDriver..ctor () [0x00000] in d:\Downloads\nh\NHibernate-3.4.0.GA-src\src\NHibernate\Driver\MySqlDataDriver.cs:27 

.........  omitted System.Reflection chain .......


  at NHibernate.Connection.ConnectionProvider.ConfigureDriver (IDictionary`2 settings) [0x00020] in d:\Downloads\nh\NHibernate-3.4.0.GA-src\src\NHibernate\Connection\ConnectionProvider.cs:107 
Rethrow as HibernateException: Could not create the driver from NHibernate.Driver.MySqlDataDriver, NHibernate, Version=3.4.0.0, Culture=neutral, PublicKeyToken=null.
  at NHibernate.Connection.ConnectionProvider.ConfigureDriver (IDictionary`2 settings) [0x00052] in d:\Downloads\nh\NHibernate-3.4.0.GA-src\src\NHibernate\Connection\ConnectionProvider.cs:113 

  at NHibernate.Connection.ConnectionProvider.Configure (IDictionary`2 settings) [0x0004f] in d:\Downloads\nh\NHibernate-3.4.0.GA-src\src\NHibernate\Connection\ConnectionProvider.cs:64 

  at NHibernate.Connection.ConnectionProviderFactory.NewConnectionProvider (IDictionary`2 settings) [0x000bd] in d:\Downloads\nh\NHibernate-3.4.0.GA-src\src\NHibernate\Connection\ConnectionProviderFactory.cs:50 
因为它无法加载System.Data.Common.DbProviderFactorys,所以我认为它无法获取System.Data。同时,我的System.Data已100%清晰地加载,因为还有另一个身份验证代码可以直接与DB完美地工作,不涉及NHibernate

这可能是因为NHibernate是使用.Net Framework visual studio配置文件中的System.Data构建的,而Unity project使用的是2.0.5版本吗

我尝试使用“Unity 3.5.net完整基类库”中的System.Data构建NHibernate。它已成功构建,但当我将System.Data.dll放入插件时,Unity也会崩溃:

InvalidProgramException: Invalid IL code in System.Data.Common.DbConnectionStringBuilder:Remove (string): IL_0000: ret    
奇怪的是,Unity不是应该从c:\Program Files(x86)\Reference Assembly\Microsoft\Framework.NETFramework\v3.5\Profile\Unity Full v3.5\System.Data.dll读取lib吗

同时,我无法使用c:\ProgramFiles(x86)\Unity\Editor\Data\Mono\lib\Mono\Unity\System.Data.dll构建NHibernate。默认情况下,它从GAC加载v2.0.0。当我尝试在.csproj中显式编写2.0.5版本时,失败了:

Warning 2   The primary reference "System.Data, Version=2.0.5.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 processorArchitecture=x86" could not be resolved because it has an indirect dependency on the .NET Framework assembly "System.Transactions, Version=2.0.5.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which has a higher version "2.0.5.0" than the version "2.0.0.0" in the current target framework.   NHibernate
我很绝望-我应该如何构建NHibernate以及使用什么LIB使其在Unity中工作?

希望有人能找到答案。 提前谢谢!
尤拉

经过一周的定期尝试,我终于成功了:

  • 为.NET3.5构建NHibernate(不是“统一配置文件”,只是常规的3.5)
  • 将3.5 System.Data.dll从GAC放入Unity中的“plugins”文件夹
  • 就这样

    我仍然想知道为什么Unity不能接受“Unity 3.5.net完整基类库”.net配置文件中的LIB,但至少它不再阻止我了