Problem with building project that uses imported dlls

I am making an MMORPG since a few days, and I already have my main menu with a login screen

Today I started to make a C# script to connect my project to a MSSQL database, and I got it to work also

But my problem is that in only works in the editor, when I try to build this project it says that I need to import System.EnterpriseServices.dll as well because it can’t be found…

I imported that dll as wel, and then I needed to import System.EnterpriceServices.Thunk.dll

When I did that and try to build again I got these two errors (with stack trace)

NullReferenceException: Object reference not set to an instance of an object
Mono.Cecil.StructureReader.VisitModuleDefinitionCo llection (Mono.Cecil.ModuleDefinitionCollection modules)
Rethrow as ReflectionException: Can not read module : System.EnterpriseServices.Thunk.dll
Mono.Cecil.StructureReader.VisitModuleDefinitionCo llection (Mono.Cecil.ModuleDefinitionCollection modules)
Mono.Cecil.ModuleDefinitionCollection.Accept (IReflectionStructureVisitor visitor)
Mono.Cecil.AssemblyDefinition.Accept (IReflectionStructureVisitor visitor)
Mono.Cecil.AssemblyFactory.GetAssembly (Mono.Cecil.Binary.ImageReader irv, Boolean manifestOnly)
Mono.Cecil.AssemblyFactory.GetAssemblyManifest (Mono.Cecil.Binary.ImageReader reader)
Mono.Cecil.AssemblyFactory.GetAssemblyManifest (System.String file)
UnityEditor.AssemblyHelper.GetAssemblyDefinitionCa ched (System.String path, System.Collections.Generic.Dictionary2 cache) (at C:/BuildAgent/work/b0bcff80449a48aa/Editor/Mono/AssemblyHelper.cs:47) UnityEditor.AssemblyHelper.FindAssemblyName (System.String fullName, System.String name, System.String[ ] allAssemblyPaths, System.String[ ] foldersToSearch, System.Collections.Generic.Dictionary2 cache) (at C:/BuildAgent/work/b0bcff80449a48aa/Editor/Mono/AssemblyHelper.cs:85)
UnityEditor.AssemblyHelper.AddReferencedAssemblies Recurse (System.String assemblyPath, System.Collections.Generic.List1 alreadyFoundAssemblies, System.String[ ] allAssemblyPaths, System.String[ ] foldersToSearch, System.Collections.Generic.Dictionary2 cache) (at C:/BuildAgent/work/b0bcff80449a48aa/Editor/Mono/AssemblyHelper.cs:69)
UnityEditor.AssemblyHelper.FindAssembliesReference dBy (System.String[ ] paths, System.String[ ] foldersToSearch) (at C:/BuildAgent/work/b0bcff80449a48aa/Editor/Mono/AssemblyHelper.cs:107)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

AND

Error building Player: Extracting referenced dlls failed.

Is there anybody who has an idea of what I am doing wrong? Or someone who can tell me an alternative way of connecting to MSSQL server directly?

Maybe that dll is built on top of a .NET version that Mono can’t work with.
Unity uses Mono2.6 and in certain cases you can import Net3.5 dlls, bu I’ve never seen anything from .Net4 work in Unity.

I found the problem, I didnt need to Import System.EnterpriseServices.dll at all, I needed to import two other dll’s

If somebody has the problem that he gets this error when building your project that needs database connection;
NullReferenceException: Object reference not set to an instance of an object

Then all you need to do is import the dlls I18N.dll and I18N.West.dll from the path C:\Program Files (x86)\Unity\Editor\Data\Mono\lib\mono\unity

If you did this then normally you will be able to build your project as a standalone player and your database connection will work :slight_smile:

At least for me it did :slight_smile: