cognitive-services-speech-sdk: SDK doesn't work in .NET 4.6.1

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Create a project with .NET core
  2. Change the target framework to net461
  3. Add configuration manager for x64 or x32 and target that platform
  4. Installed the VC++ distributables (no effect)
  5. Try to call a sample code that uses SDK that used to work with .NET core

Expected behavior It should work like when .NET core was target platform

Version of the Cognitive Services Speech SDK 1.3.1

Platform, Operating System, and Programming Language

  • OS: Windows 10
  • Hardware - x64
  • Programming language: C#

Additional context

System.DllNotFoundException: Unable to load DLL 'Microsoft.CognitiveServices.Speech.core.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
   at Microsoft.CognitiveServices.Speech.Internal.SpeechConfig.speech_config_from_subscription(IntPtr& config, String subscriptionKey, String region)
   at Microsoft.CognitiveServices.Speech.SpeechConfig.FromSubscription(String subscriptionKey, String region)
   at SpeechCognitiveServices.Program.<CallCognitiveServices>d__3.MoveNext()

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 24 (3 by maintainers)

Most upvoted comments

Discussed with @anbhar and the issue there was solved by manually adding Microsoft.CognitiveServices.Speech.core.dll to the application project.

Based on this thread, there is several reasons why the issue might happen. We will collect information from here and improve our sample projects/documentation on this in coming releases. Thanks for all feedback

Actually we found the source of our problem: visual studio d++ redistributable!!!

The PC we are using as a deploy machine for speech recognition software didn’t have any vc_redist installed. In fact any solution using speech recognition libs (we tested .netcore console app, wpf .net framework) were not able to run correctly. After installing the vc_redist_x64.exe file all the samples where running correctly.

I think you should update the documentation specifying that vc_redist is a MUST HAVE lib to correctly execute the code on any machine running Windows. It may be a obvious, but if you are developing some apps and deploying to third-party machines a reminder could be really useful (we wasted about two working days of development for this missing!!!)

@jhakulin , where can we get this missing dll?

@nrobert it should be in the \bin\x64\Debug or \bin\x86\Debug directory based on how you Debug - “Microsoft.CognitiveServices.Speech.core.dll”.

A simple “Add -> Existing Item” to the project should do the trick. You’ll want to make sure its included in the deployment.

You are describing the steps you took in Visial Studio?

I had the problem also once. It appears that during build/deployment the dll wasn’t copied. I did a ‘clean project’ and ‘rebuild’ and it worked …

hope this helps.