Using a .dll coded in .NET framework 4.0 in Unity

Hello,

I’m quite new in Unity but I want to realize some unusual things !
I want to acquired some signal (with a acquisition card) and use the signal in my simulation in Unity. For example, I want to have an interface to see my heart rate and which help me to realize relaxation exercise.
I already have the acquisition card and the library (.dll) to use it. But the library is coded in .NET framework 4.0.

If I understand correctly, Unity use Mono which is compatible with .NET framework 2.0 and 3.5 but not with 4.0… So, it didn’t work when I directly put the .dll in the assets file of the the Unity project.
I tried to create an other script in Visual Studio in C# to use the library and integrate this new script in Unity but there is still the problem of compatibility between .NET 4.0 and .NET 3.5, so my script didn’t work in Unity.

Do you have any idea to be able to use this .dll in Unity ?

Thank you

Unity 2017 introduced a version of Mono which uses .NET 4.6 as an experimental feature. Maybe that will help you. To enable it you go to Edit > Project Settings > Player (Or from build settings), on the Other Settings tab.

Edit: You need an editor restart after enabling it

Subtitle: Scripting Runtime upgrade (experimental): enjoy C#6 & .NET 4.6