Azure / azure-service-bus-dotnet

☁️ .NET Standard client library for Azure Service Bus
https://azure.microsoft.com/services/service-bus
Other
236 stars 120 forks source link

Is there any way to use this on Unity/Hololens? #234

Open joaocc opened 7 years ago

joaocc commented 7 years ago

Hi, We are trying to find a way to connect a Unity app for Hololens to Azure Service bus. Even when using .net 4.6 experimental mode in Unity, we get some exceptions. Is anyone working on a port/fork of this library to support Unity/UWP? Thanks

vinaysurya commented 7 years ago

This library is already compiled for UWP. So should work. Have you tried and it does not work? https://github.com/Azure/azure-service-bus-dotnet/blob/dev/src/Microsoft.Azure.ServiceBus/Microsoft.Azure.ServiceBus.csproj#L45

joaocc commented 7 years ago

Hi, Unity does not support threading in the same way that UWP does, so it doesn't really work. We have tried porting some of the SAS code to Unity for Hololens for a quick proof of concept, and we needed some changes in the code (things as trivial as UriEncode had to be found in the WWW class). Probably more importantly, Unity has it's own way of invoking HTTP methods (WWW, UnityWebRequest or some custom libraries).

This is a reflection of a more general problem, that we could not find any ready-to-use SDK for Azure to be used on Unity for Hololens. OTOH, it exists for AWS (https://github.com/aws/aws-sdk-unity). It would be great if Microsoft could port the SDK for Unity for Hololens.

joaocc commented 7 years ago

We just found another problem in trying to use it. HMAC256 works on the Editor, but then it fails in building. We found a workaround by looking at how AWS does it in the SDK mentioned above...

HashAlgorithm.Create("SHA-256")

It seems that for some reason System.Security.Cryptography.HMAC256 is not available when building for Hololens (it works in Editor) but System.Security.Cryptography.HashAlgorithm is available in both places.

@vinaysurya: I believe these 2 examples help illustrate the difficulties we encounter.

vinaysurya commented 7 years ago

@joaocc, we'll try this out when we find some time and evaluate what could be done here.

joaocc commented 7 years ago

@vinaysurya, Do you have any updates on this? If this is not the case, as much as we would love to use Azure for our projects, we will have to consider alternative solutions. Thx

krishnan-unni commented 6 years ago

I am not sure if this would help. But I managed to use Azure sdk (not service bus specifically, but Iot Hub) in unity and Hololens this way. My instructions here: http://unicodeexception.com/2017/11/13/hololens-iot-awesomeness/