dotnet core application deployed on local service fabric throws Microsoft speech services exception


I have a dotnet core 2.2 application that consumes Microsoft cognitive speech services version 1.8.0. The application is deployed on a single node local service fabric cluster.

I have added the service fabric support using visual studio 2019 Right click on root project -> Add -> Container Orchestrator Support -> Service Fabric

After successful deployment, when I hit the controller API I get following exception

> **System.DllNotFoundException: Unable to load DLL
> 'Microsoft.CognitiveServices.Speech.core.dll' or one of its
> dependencies: The specified module could not be found. (Exception from
> HRESULT: 0x8007007E)**    at
> Microsoft.CognitiveServices.Speech.Dialog.Internal.DialogServiceConfig.bot_framework_config_from_subscription(IntPtr&
> config, String subscription, String region)    at
> Microsoft.CognitiveServices.Speech.Dialog.BotFrameworkConfig.FromSubscription(String
> subscription, String region)    at
> WebApi.Controllers.MyController..ctor() in MyController.cs:line 71   
> at lambda_method(Closure , IServiceProvider , Object[] )    at
> Microsoft.AspNetCore.Mvc.Controllers.ControllerActivatorProvider.<>c__DisplayClass4_0.<CreateActivator>b__0(ControllerContext
> controllerContext)    at
> Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.<>c__DisplayClass5_0.<CreateControllerFactory>g__CreateController|0(ControllerContext
> controllerContext)    at
> Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State&
> next, Scope& scope, Object& state, Boolean& isCompleted)    at
> Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()
> at
> Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter()
> at
> Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext
> context)    at
> Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next,
> Scope& scope, Object& state, Boolean& isCompleted)    at
> Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()
> at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()   
> at Microsoft.AspNetCore.Routing.EndpointMiddleware.Invoke(HttpContext
> httpContext)    at
> Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.Invoke(HttpContext
> httpContext)    at
> Serilog.AspNetCore.RequestLoggingMiddleware.Invoke(HttpContext
> httpContext)    at
> Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext
> context)    at
> Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext
> context)

I can see the docker publish folder in dotnet core application. Publish folder has win-x86 & win-x64 runtimes containing native Microsoft.CognitiveServices.Speech.core.dll & Microsoft.CognitiveServices.Speech.extension.kws.dll.

asked on Stack Overflow Apr 9, 2020 by anjalis • edited Apr 9, 2020 by M--

1 Answer


I was able to workaround this issue as described here.

Looks like the issue is with VC++ runtime. These dlls are required for working with Microsoft Speech APIs but are not copied into the container by default. So, I updated my docker file to copy the VC++ runtime dlls into the container & it worked.

answered on Stack Overflow Apr 27, 2020 by anjalis

User contributions licensed under CC BY-SA 3.0