MissingMethodException using native dll library in unity (currently a no-op) - c#

I'm trying to integrate CLIPS library in unity beta (x64) using mono 2.0 and net 4.6.
I'm using a net wrapper for clips: https://github.com/yifeitao/CLIPSNet
This project has two main files:
managedCLIPS.dll, which compiles clips C files into managed C++.
clipsNET.dll, the actual wrapper for mono, which uses managedclips.
I can compile both files and drag to unity, but when trying to run it I get some errors: MissingMethodException: Method contains unsupported native code
https://imgur.com/ESLJdGT
I used MoMa: mono migration analyzer and and it says "Methods called marked with [MonoTodo]: 5" and Currently a no-op
https://imgur.com/pS4uMZ4
¿Any ideas of how can I solve this?
Thanks!

Related

How to reference ubuntu MATLAB runtime libraries in C#?

I have a C# program that uses the MWARRAY.dll from MATLAB. I am trying to run this program on Ubuntu with mono. But, it keeps saying the MWArray.dll was not found. I have install Matlab runtime on my Ubuntu machine. I wanted to know how to reference Matlab ubuntu libraries in C# code. Is it even possible?
You can use DLLmaps to map library names for specific operating systems. For example, you can put a line like <dllmap dll="some.dll" target="libsome.so" os="!windows"/> in your /etc/mono/config file and it will be mapped for every project.

how to use a .net dll with static utility functions in unity 5?

I have a .NET 3.5 .dll build with VS2015 that contains some static utility functions and has no further dependencies. What I want to achieve is to use those utility functions in a C# Script in my Unity 5.5 (personal edition) project.
I dragged the .dll into the assets browser and created a new C# Script. Unfortunately there was no automatic reference to the .dll, and I wasn't able to find any possibility to add one.
This is what unity shows when doubleclicking on the dll:
How can I use my (not in any way to Unity related) dll in my Unity C# Script?
Unity runs on Mono not on .NET - that's different things.
Use one of Unity target frameworks (set in VS project properties) when compiling dll outside Unity environment or use PInvoke.
Put dll file into "Plugins" folder.

Monogame UWP - Including a DLL library causes error

I'm creating a Monogame UWP Project and whenever I make a call to an included very basic compiled DLL .NET Core library within the project it throws the Error: Could not load file or assembly System.Runtime 4.1.0.0
Here is the project Sample:
http://www.filedropper.com/game1_2
Is everyone else getting the same Error? How do I go about fixing this issue?
Kind regards, Josh L.
As #iinspectable said in the comments:
You cannot reference a full .NET assembly from a UWP project.
UWP is a thing on it's own, and is basically incompatible with .NET as it needs to run on all Win10 platforms (where .NET is meant to be run on Windows PC). Now i don't know monogame, but if it's a .NET Library, it's incompatible with UWP.

Using .NET 4.5 code in Unity 5

I am working on a game using Unity3D version 5. The game should use strict business rules already programmed in a C# .NET4.5 engine. Using Xamarin/Mono, we hope to make this usable on windows, android, others...
I tried building the engine into a dll and use it as a managed plugin in Unity. But Unity uses an old version of Mono to compile the whole game and refuses to use .NET 4.5 dlls.
I really need to use this code, I looked into downgrading it to .NET 3.5 but it is not an acceptable solution given the work already done on the engine.
Concerning android, I think to use Xamarin to get native android code and use it as a native plugin in Unity. Now I need a solution for Windows. I am looking into ways to use the C# code in C++ to make an unmanaged dll but I am struggling understanding which way is applicable here between COM interop, C++/CLI or other methods.
Does any one knows a way to include code from .NET 4.5 in Unity with no/little effort ?
Looks like Unity is upgrading to 4.6+ and is available in beta now
https://forum.unity3d.com/threads/upgraded-mono-net-in-editor-on-5-5-0b4.433541/
Using a visual studio plugin: unmanaged exports, I have been able to export the C# .NET 4.5 to an unmanaged/native dll which I can use in Unity Engine.
This forces to call only simple functions, but with little work, it was possible for me to wrap the core of my engine.
Short answer is no.
Unity has ".NET 2.0/3.5 era functionality," according to an official blog post.
According to the same post, a future version of Unity will be upgraded to "a modern version of .NET," with no timeline given for this major undertaking.
NOTE: This answer was written in response to the original version of the question, which was simply whether the .NET 4.5 library could be used directly in Unity.

IKVMC dll in Unity TypeLoadException

I want to create a DLL from a JAR for use in Unity.
I create a jar file using JavaSE-1.7, then I create the dll from it using ikvmc v7.2.4630.5
When I use this dll in a new C# Windows application it works fine without any exceptions or errors, but when I use it in Unity it also works even though I'm getting the following TypeLoadException:
Could not load type 'java.util.Date' from assembly IKVM.OpenJDK.Core
But although this works, Unity won't export or build my project due to this exception. How can I get around this?
EDIT: Ok the only way I can get this to work is if I use JRE 1.5 and an older version of IKVM like 0.28 which doesn't solve my problem because some functionality from JRE 1.7 is not supported in JRE 1.5
Despite this is an old question, I leave some advices for future reference:
try to use the last version of IKVM (8.0 at time of writing).
Go to: Edit -> Project Settings -> Player. Under Other settings for PC / Mac change the API Compability Level from ".NET 2.0 Subset" to ".NET 2.0". Recompile.
Copy all of the DLLs provided with IKVM inside the Assets folder of your project (NOT in a subfolder).
All of the Java versions are supported (even Java 8, see Release Notes).

Categories