Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.
Options

Handling different frameworks Unity and VisualStudio

One of my problems is that I am developing with Unity3D. Unity do not support more that 3.5 .net framework. I am using an external partie set of dlls that are released in 4.5 but I need it for programming but I cannot import them in Unity. As I understand that Universal Apps can work with 4.5 framework, so I do not know how to handle this . Should I program in Unity? Is possible? Should I add this code after making the VS application, how can I test it afterwards. How can I add this to existing scrips in Unity.
Thanks!

Tagged:

Best Answer

  • Options
    Answer ✓

    Unity uses a subset of .Net framework 3.5 (Mono .Net). However you can target UWP apps and use the .Net compiler to compile for .Net 4.5, just be warned it's not cross platform at this point. You have the use the NET_FX_CORE and WINDOWS_UWP defines, in your cs scripting files. After you've compiled your applications in Unity and generated the cs project files, you're free to continue added what ever logic you need as long as it follows the UWP contracts.

    Another note, if you need to use some raw level api's that even unity doesn't support you may want to look at the IL2CPP scripting engine, this produces DirectX and C++ projects which you can further take and expand upon with the Hololens framework.

    Dwight Goins
    CAO & Founder| Independent Architect | Trainer and Consultant | Sr. Enterprise Architect
    MVP | MCT | MCSD | MCPD | SharePoint TS | MS Virtual TS |Windows 8 App Store Developer | Linux Gentoo Geek | Raspberry Pi Owner | Micro .Net Developer | Kinect For Windows Device Developer
    http://dgoins.wordpress.com

Answers

  • Options
    james_ashleyjames_ashley ✭✭✭✭
    @DiegoV,

    If you need to call these external dlls from inside unity, then you will need to pinvoke them from unity most likely. Even though your unity project is built as a uwp app, I don't think there's a way to take advantage of that to create a bridge between your dlls and unity.

    Its honestly been a while so I'm not sure what happens when you pinvoke a .net 4.5 dll from mono.

    Here's a decent guide to pinvoking from unity: http://ericeastwood.com/blog/17/unity-and-dlls-c-managed-and-c-unmanagedhttp://ericeastwood.com/blog/17/unity-and-dlls-c-managed-and-c-unmanaged

    James Ashley
    VS 2017 v5.3.3, Unity 2017.3.0f3, MRTK 2017.1.2, W10 17063
    Microsoft MVP, Freelance HoloLens/MR Developer
    www.imaginativeuniversal.com

  • Options
    Answer ✓

    Unity uses a subset of .Net framework 3.5 (Mono .Net). However you can target UWP apps and use the .Net compiler to compile for .Net 4.5, just be warned it's not cross platform at this point. You have the use the NET_FX_CORE and WINDOWS_UWP defines, in your cs scripting files. After you've compiled your applications in Unity and generated the cs project files, you're free to continue added what ever logic you need as long as it follows the UWP contracts.

    Another note, if you need to use some raw level api's that even unity doesn't support you may want to look at the IL2CPP scripting engine, this produces DirectX and C++ projects which you can further take and expand upon with the Hololens framework.

    Dwight Goins
    CAO & Founder| Independent Architect | Trainer and Consultant | Sr. Enterprise Architect
    MVP | MCT | MCSD | MCPD | SharePoint TS | MS Virtual TS |Windows 8 App Store Developer | Linux Gentoo Geek | Raspberry Pi Owner | Micro .Net Developer | Kinect For Windows Device Developer
    http://dgoins.wordpress.com

  • Options

    I think that I will try to use Dwight_Goins_EE_MVP answers! Thanks anyway

Sign In or Register to comment.