Visual Studio .DLL plug-in for Unity

Hi,

I just downloaded Unity 4.3.1 and it tells me it’s still using the old Mono 2.0, as per:

C:\Program Files (x86)\Unity\Editor\Data\Mono\bin>mono.exe -V
Mono JIT compiler version 2.0 (Visual Studio built mono)
Copyright (C) 2002-2010 Novell, Inc and Contributors. www.mono-project.com
TLS: normal
GC: Included Boehm (with typed GC)
SIGSEGV: normal
Notification: Thread + polling
Architecture: x86
Disabled: none

C:\Program Files (x86)\Unity\Editor\Data\Mono\bin>

…that seems a bit odd since Mono is up to 3.x at this point, but if it works I’m fine with it.

I ran through the tutorial “Using Mono DLLs in a Unity Project” as found here: http://docs.unity3d.com/Documentation/Manual/UsingDLL.html

…and it worked perfectly when I compiled under the native .Net 4.0 Framework, and dragged it into the Unity project.

So my question is this; if it worked without my project having to think about Mono (targeting it’s framework instead of the native .Net 4.0 one), then can you just build for .Net 4.0 and not worry about compliance with Unity ? All I’m going to be doing with the plug in is facilitating API to API communication between Unity and my employers application, if a developer wished to tap into my employers services, which means converting one API call to another…

Boneill

The version of Mono that Unity uses (even in 4.3.1) targets .NET Framework 3.5. If you want to build DLLs and be sure they’re going to work you need to change the target framework to 3.5. You can still build them in Visual Studio without doing anything special, just make sure it targets the correct framework version. There are also framework elements that aren’t available in Unity so you’ll have to avoid them (like System.Data).

That’s great info thanks. My project is now targeted to 3.5. Do you know if there is a list of framework elements not available in Unity, and whether that is related to the platform the game is being ported/targeted to (Mac, Win, iOS, Android etc.) ?