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.

SharingClient.dll for C# client

Hi All,

I would like to create a C# client (simple console application) which communicates with the application in Unity (Hololens app) via the HoloToolkit Sharing library. For this purpose I’ve been following the instructions from https://github.com/Microsoft/HoloToolkit/wiki/Getting-Started, Integrating the Client plugin.

The problem is that SharingClient.dll is not loaded automatically, and I get errors if I try loading it via References in the C# application (“A reference to …SharingClient.dll cannot be added. Please make sure that the file is accessible and that it is a valid assembly or COM component.”) I’ve tried multiple SharingClient.dll files, pretty much all I have, also the ones from Holograms 240 or other apps which work fine in Unity and Hololens.

Does anybody know what could be the problem with loading SharingClient.dll in the C# application? Is there a better way to achieve the network communication between a C# console application and the app on the Hololens?

Any help on this is welcome!

Best Answer

Answers

  • @holoclient are you using the

    Unity version of the HoloToolkit
    or the

    version from the Root of the HoloToolkit project for you non-Unity based C# client?

    Windows Holographic User Group Redmond

    WinHUGR.org - - - - - - - - - - - - - - - - - - @WinHUGR
    WinHUGR YouTube Channel -- live streamed meetings

  • Hi @HoloSheep ,

    Apologies for the late reply.

    I've been using https://github.com/Microsoft/HoloToolkit/tree/master/Sharing. After solving multiple errors from the script BuildSharingLib.bat, some SharingClient.dll files were generated, but I think not all of them, or not correctly. The script CopyToSDK.bat did not copy any dll in the HoloToolkit/Sharing/SDK/Client/CSharp, so I used HoloToolkit\Sharing\Src\bin\Debug\Win32\ClientUniversalCSharp\SharingClient.dll, but that didn't work. I assume I should actually use the dll from HoloToolkit\Sharing\Src\bin\Debug\Win32\ClientWindowsCSharp\ , but this one was not generated.

    Do you know if the scripts from https://github.com/Microsoft/HoloToolkit/tree/master/Sharing are up to date? Or could I find the correct CSharp SharingClient.dll somewhere else?

  • AlexDAlexD ✭✭✭

    @holoclient, in the master HoloToolkit repo you can find 2 helper applications Sharing Manager UI and Sharing Manager Universal UI which are both technically clients for the sharing platform. You can use those as a base to create a standalone app.

    To make things a bit clear:
    The ClientUniversalCSharp folder is to be used for a UWP application whereas the ClientWindowsCharp is for classic Win32 app.

  • @AlexD , thanks for confirming which SharingClient.dll I need to use, and more exactly the one from HoloToolkit\Sharing\Src\bin\Debug\Win32\ClientWindowsCSharp. The initial problem still remains, because there is no dll generated there after running the scripts from BuildAll.bat

    This is because the script BuildSharingLib.bat fails, when I run it from the command line. I'll post the error bellow, maybe someone has an idea how to fix this, because my attempts were not successful.

    The error which I get after running BuildSharingLib.bat is:

    "C:\HoloToolkit\HoloToolkit\Sharing\Src\Solutions\VisualStudio\HoloToolkit.Sharing.sln" (rebuild target) (1) ->
    "C:\HoloToolkit\HoloToolkit\Sharing\Src\Projects\SessionManagerUniversal.UI\SessionManagerUniversal.UI.csproj" (
    Rebuild target) (4) ->
    (MarkupCompilePass1 target) ->
    C:\HoloToolkit\HoloToolkit\Sharing\Src\Projects\SessionManagerUniversal.UI\SessionManagerUniversal.UI.csproj :
    XamlCompiler error WMC1006: Cannot resolve Assembly or Windows Metadata file 'System.Runtime.dll'
    C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v14.0\8.2\Microsoft.Windows.UI.Xaml.Common.targets(264,5)
    : Xaml Internal Error error WMC9999: Type universe cannot resolve assembly: System.Runtime, Version=4.0.0.0, Cul
    ture=neutral, PublicKeyToken=b03f5f7f11d50a3a. [C:\HoloToolkit\HoloToolkit\Sharing\Src\Projects\SessionManagerUn
    iversal.UI\SessionManagerUniversal.UI.csproj]

  • @holoclient are you running from VS 2015 developer cmd prompt ?

  • @neerajwadhwa ,
    Yes, I'm using VS 2015 developer cmd promt. If you have any other suggestions please met me know, because I'm running out of ideas.

  • Have you tried BuildAll.bat or BuildDependencies.bat ?

  • @neerajwadhwa ,

    I've tried both of them, but got the same error.
    It would be great to get this working, and make use of the Holotoolkit Sharing library.

  • edited August 2016

    @holoclient said:
    @neerajwadhwa ,

    I've tried both of them, but got the same error.
    It would be great to get this working, and make use of the Holotoolkit Sharing library.

    I'm also having the same issues as @holoclient.

    What exactly should the build order be? I haven't been able to find good documentation on this yet.

    Stephen Hodgson
    Microsoft HoloLens Agency Readiness Program
    Virtual Solutions Developer at Saab
    HoloToolkit-Unity Moderator

  • @holoclient said:
    Hi @HoloSheep ,

    Apologies for the late reply.

    I've been using https://github.com/Microsoft/HoloToolkit/tree/master/Sharing. After solving multiple errors from the script BuildSharingLib.bat, some SharingClient.dll files were generated, but I think not all of them, or not correctly. The script CopyToSDK.bat did not copy any dll in the HoloToolkit/Sharing/SDK/Client/CSharp, so I used HoloToolkit\Sharing\Src\bin\Debug\Win32\ClientUniversalCSharp\SharingClient.dll, but that didn't work. I assume I should actually use the dll from HoloToolkit\Sharing\Src\bin\Debug\Win32\ClientWindowsCSharp\ , but this one was not generated.

    Do you know if the scripts from https://github.com/Microsoft/HoloToolkit/tree/master/Sharing are up to date? Or could I find the correct CSharp SharingClient.dll somewhere else?

    If you go and get the SharingService.dll from the Unity branch, I believe it should work. It did for me.

    Stephen Hodgson
    Microsoft HoloLens Agency Readiness Program
    Virtual Solutions Developer at Saab
    HoloToolkit-Unity Moderator

  • I think I have the same issue and try all of the suggestions with no luck.

  • Thanks @Patrick , I'll try this, sounds good. In the meantime I've used a different approach for communicating over the network (Windows.Networking.Sockets)

Sign In or Register to comment.