Cognitive-services-speech-sdk: Getting exception when running console application in .net core 2.1 from a Mac

Created on 4 Sep 2018  路  6Comments  路  Source: Azure-Samples/cognitive-services-speech-sdk

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

1) Create a Console Application with .netcore2.1
2) Call: Speechfactory.FromSubscription("key", "region")
3) The app will throw an exception about not being able to find a dll

Any log messages given by the failure

Unhandled Exception: System.AggregateException: One or more errors occurred. (The type initializer for 'Microsoft.CognitiveServices.Speech.Internal.carbon_csharpPINVOKE' threw an exception.) ---> System.TypeInitializationException: The type initializer for 'Microsoft.CognitiveServices.Speech.Internal.carbon_csharpPINVOKE' threw an exception. ---> System.TypeInitializationException: The type initializer for 'SWIGExceptionHelper' threw an exception. ---> System.DllNotFoundException: Unable to load shared library 'Microsoft.CognitiveServices.Speech.csharp.bindings.dll' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(libMicrosoft.CognitiveServices.Speech.csharp.bindings.dll, 1): image not found
at Microsoft.CognitiveServices.Speech.Internal.carbon_csharpPINVOKE.SWIGExceptionHelper.SWIGRegisterExceptionCallbacks_carbon_csharp(ExceptionDelegate applicationDelegate, ExceptionDelegate arithmeticDelegate, ExceptionDelegate divideByZeroDelegate, ExceptionDelegate indexOutOfRangeDelegate, ExceptionDelegate invalidCastDelegate, ExceptionDelegate invalidOperationDelegate, ExceptionDelegate ioDelegate, ExceptionDelegate nullReferenceDelegate, ExceptionDelegate outOfMemoryDelegate, ExceptionDelegate overflowDelegate, ExceptionDelegate systemExceptionDelegate)
at Microsoft.CognitiveServices.Speech.Internal.carbon_csharpPINVOKE.SWIGExceptionHelper..cctor()
--- End of inner exception stack trace ---
at Microsoft.CognitiveServices.Speech.Internal.carbon_csharpPINVOKE.SWIGExceptionHelper..ctor()
at Microsoft.CognitiveServices.Speech.Internal.carbon_csharpPINVOKE..cctor()
--- End of inner exception stack trace ---
at Microsoft.CognitiveServices.Speech.Internal.carbon_csharpPINVOKE.SpeechFactory_FromSubscription(String jarg1, String jarg2)
at Microsoft.CognitiveServices.Speech.Internal.SpeechFactory.FromSubscription(String subscription, String region)
at Sample.ConsoleApp.Program.RecognizeSpeechAsync() in //Program.cs:line 14

Expected/desired behavior

Not get the exception

OS and Version?

MacOS 10.13.6 - Using VS for mac 7.6.3

Versions

0.6

All 6 comments

Sorry, currently Speech SDK does not support .netcore on Mac yet. (Please find supported languages and platforms here. We will add it at a later time, but I do not have any date yet at this point.

@zhouwangzw
I thought all .netcore2.x projects where multiplatform and I figured I could use this example to then move the code to mobile platforms like android and iOS using xamarin and c#. I'm very motivated to see this happen so if you need help with anything, be it brainstorming, rubber ducking or grunt work with lines of code, you can count on me to try and make this SDK truly multiplatform.

BTW, thanks for answering so fast

Thank you for your willingness for help! Multiplatform and multi-language support is definitely one of important features we want to provide.

The Speech SDK currently uses native C++ implementation in core, and then adds different language bindings on top of that. That is the reason why SDK currently only supports .netcore on Windows and Linux. We will add support for more platforms in future.

Thank you again!

As Zhou said - this will come, but no ETA yet. I'm closing this here now, we have this on our to-do list, we will publish some more detailed plan for platform support in the next month(s).

@wolfma61 @zhouwangzw Thanks a lot for your replies!

Just wanted to tell you that @jimbobbennett made a binding of the android speech sdk. Hope it serves you (:

Here are the links to the articles he wrote about it:
https://www.jimbobbennett.io/binding-the-cognitive-services-android-speech-sdk/
https://www.jimbobbennett.io/binding-the-cognitive-services-android-speech-sdk-part-2-making-the-code-more-c-like/

And here is the repository: https://github.com/jimbobbennett/SpeechSdkXamarinSample

thank you for the about!
we ill take a very close look asap and see if we can accelerate integration

Was this page helpful?
0 / 5 - 0 ratings