question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DllNotFoundException in ASP.NET Core 3.1 Docker container

See original GitHub issue

Describe the bug

I’d like to build a docker container of my ASP.NET Core 3.1 application which uses the Speech SDK.

Unfortunately I get the following exception as soon as SpeechConfig.FromEndpoint(any(Uri), any(string)) is called:

DllNotFoundException: Unable to load shared library 
'libMicrosoft.CognitiveServices.Speech.core.so' or one of its dependencies.
In order to help diagnose loading problems, consider setting the LD_DEBUG
environment variable: liblibMicrosoft.CognitiveServices.Speech.core.so:
cannot open shared object file: No such file or directory

I’m building it with the “bionics” base images from Microsoft, which is based on Ubuntu 18.04. As far as I read this should be supported.

I’ve provided a small test project which can be run as is to reproduce the issue: SpeechSdkDockerTestProject.zip

To Reproduce Steps to reproduce the behavior:

  1. Open the project above in Visual Studio (2019, Windows, all updates installed)
  2. Run the “Docker” target
  3. Wait until /helloworld is loaded in your browser or open it yourself

Expected behavior The string “hello world” should be returned instead of the exception above.

Version of the Cognitive Services Speech SDK 1.8.0 Platform, Operating System, and Programming Language

  • OS: Windows
  • Hardware: x64
  • Programming language: C#
  • Browser doesn’t matter

Additional context

  • I’m using Linux containers in Docker v2.1.0.5
  • running cat /etc/os-release inside the Docker container returns Ubuntu 18.04.3 LTS (Bionic Beaver)
  • the runtimes directory including the *.so libs exist in the container

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
trenslowcommented, Jul 1, 2020

For anyone running their .NET Core 3.1 application using the official image (whose base is Debian 10), I simply had to install the libasound2 library for our application to use the Microsoft.CognitiveServices.Speech package. Here’s all I needed to add to the Dockerfile:

RUN apt-get update
RUN apt-get -y install libasound2

It would be nice if Microsoft could update their documentation to make it more clear what exactly is required to add on to their official Linux images in order to be able to use the Speech service.

0reactions
pankoponcommented, Jul 6, 2020

Please note that Linux system requirements are stated on the “About the Speech SDK” page: https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/speech-sdk?tabs=linux Debian 10 is not yet officially supported, but in practice you just need to install the same packages as on Debian 9, incl. libasound2. For libssl, use libssl1.1 instead of libssl1.0.2.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Identity Server 4 running within docker container Exception
I am trying to get Identity Server 4 running with ASP.NET Core in a docker container and I keep on getting the following...
Read more >
After upgrading .net core from 3.1 to 5 I'm getting error in ...
I have a native application written in c++ and complied into the .so library through docker which I'm using in the .net core...
Read more >
Running ASP.NET Core in an Alpine Linux Docker Container
The error here is that the debian docker image we are using doesn't have the nightly version of the 2.1 runtime installed and...
Read more >
Why isn't my ASP.NET Core app in Docker working?
In this post I describe a problem where my ASP.NET Core app in Docker wasn't responding to requests. This post debugs and diagnoses...
Read more >
Docker Support for My .NET Core Blog System on Azure
When I submit my code to GitHub, Azure DevOps will kick in, build the Docker image and push to Docker Hub. Then it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found