Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Plugin using DLL with Windows.Foundation.UniversalApiContract reference

Discussion in 'Scripting' started by KevinIH, May 27, 2019.

  1. KevinIH

    KevinIH

    Joined:
    May 20, 2019
    Posts:
    5
    Hello ! I'm trying to develop a Bluetooth LE plugin for Unity based on the Windows Universal Sample that use UWP APIs. As mentionned in official documentation here it should work with Windows 10 desktop apps.
    Now I have my DLL file but I can't test it in Unity because it logs this :

    TypeLoadException: Could not load type of field 'BLEPluginHRM.BLEConnector:bluetoothLeDevice' (9) due to: Could not load file or assembly 'Windows.Foundation.UniversalApiContract, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. assembly:Windows.Foundation.UniversalApiContract, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null type:<unknown type> member:<none>

    Same issue on Standalone or UWP platforms and I don't know how to reference this assembly. I already copy the "Windows.Foundation.UniversalApiContract.winmd" in the plugin folder with no luck.
    I'm pretty sure I have missed something but it's the first time I want to use a dll in my project so any help is appreciated.

    I'm working with Unity 2017.4.27f1 with VS 2017.
     
  2. rlmod17

    rlmod17

    Joined:
    Nov 22, 2016
    Posts:
    2
    Have the same issue, cany ideas anyone please?
     
  3. KevinIH

    KevinIH

    Joined:
    May 20, 2019
    Posts:
    5
    Hi rlmod17, you will find more info on this issue here
    Intellisense will help to link that but you will be able to test only after compilation for target platform.