Hi I’m a software engineer who’s recently moved into gaming so forgive me if I’m a little bit of a nube.
I’m currently trying to create a database infrastructure for a gaming simulation. Due to client requirements (or the lack of) I decided to implement an ORM(Object Relational Mapping) framework like I would if developing a normal C# app. The framework I decided to go with is NHibernate. I’ve created a C# assembly which references and configures the NHibernate class libraries and contains all the logic to connect and write to a db. Within a Unity C# script all is required is to add the dll ‘using’ reference, instansiate an object which maps to a db table, set the objects properties then execute a save() method. All this works fine when playing the game through Unity. However when I attempt a build I get the following error:
ArgumentException: The Assembly Castle.DynamicProxy is referenced by NHibernate. But the dll is not allowed to be included or could not be found.
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse…(The error continues on)
It appears Hibernate is calling a dll in which Unity does not like when attempting to build the game. I was wondering if anyone had any ideas why this is occurring and how it may be resolved (if at all). Using an ORM framework will greatly assist our development process opposed to handling all the db connections and calls manually.
You can add a pure .NET DLL to the project just by dragging it into the assets folder. However, this will not work if there is any code in the DLL that references native code. You would usually get that error only if there is native code or if the DLL is not present. However, do report back if you’re sure that this is not the case.
Don’t use jrock json
Its the worst of the options anyway if you are interested in crossplatform, never worked on iphone.
Also an XML library that attempts to even use System.Web looks VERY fishy to me as json does not need web at all, it only needs to bloat the application system with System.Xml normally
On desktop / web I use litjson
For mobile targeting too, I use jsonfx. With U3, potentially litjson works on mobile too, didn’t check it so far
I have the some problem here with Unity 3.1, I have a small game that uses .Net remoting but when i try to build i end up with this error:
ArgumentException: The Assembly System.Drawing is referenced by System.Web. But the dll is not allowed to be included or could not be found. UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1 alreadyFoundAssemblies, System.String[ ] allAssemblyPaths, System.String[ ]
It’s likely that the library is either missing or implemented in a rudimentary way for Unity. Not all of the .NET library is deemed applicable to games work, so we cut parts of it out to save memory and download time. Whenever you see something like this, it is worth checking the API compatibility level in the inspector (menu: Edit > Project Settings > Player). When the Subset option is chosen, as it is by default, then a even further reduced version of the .NET library is used, again for reasons of economy. Setting it to 2.0 compatibility will give you everything that is implemented in Unity, although as I have mentioned, this isn’t all of .NET.