0
votes

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.

1
Can you check this similar github issue for some fixes people used?LoekD
@LoekD - I tried all the given options. Still no luck. Even manually adding dll to the project root didn't work either.anjalis
@LoekD - I was able to find a workaround for this issue & is posted as an answer. Thanks for your help.anjalis

1 Answers

0
votes

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.