<p>I deploy asp.net core application docker image to Kubernetes cluster. My application is using NAudio to get microphone stream from the user and send to Google Speech-To-Text.</p>

<p>But after I deployed, getting the error below in Kubernetes logging:</p>

<blockquote>
  <p>System.DllNotFoundException: Unable to load shared library
  'Msacm32.dll' or one of its dependencies. In order to help diagnose
  loading problems, consider setting the LD_DEBUG environment variable:
  libMsacm32.dll: cannot open shared object file: No such file or
  directory at NAudio.Wave.Compression.AcmInterop.acmStreamOpen2(IntPtr&amp;
  hAcmStream, IntPtr hAcmDriver, IntPtr sourceFormatPointer, IntPtr
  destFormatPointer, WaveFilter waveFilter, IntPtr callback, IntPtr
  instance, AcmStreamOpenFlags openFlags) at
  NAudio.Wave.Compression.AcmStream..ctor(WaveFormat sourceFormat,
  WaveFormat destFormat) at
  NAudio.Wave.WaveFormatConversionProvider..ctor(WaveFormat
  targetFormat, IWaveProvider sourceProvider) at
  NAudio.Wave.WaveFormatConversionStream..ctor(WaveFormat targetFormat,
  WaveStream sourceStream) at
  Web.API.GoogleApi.GoogleSpeechSession.WriteBufferToStreamingContext(Byte[]
  buffer) in /app/GoogleApi/GoogleSpeechSession.cs:line 385 at
  Web.API.GoogleApi.GoogleSpeechSession.SubmitToGoogle(Byte[] buffer) in
  /app/GoogleApi/GoogleSpeechSession.cs:line 406</p>
</blockquote>

<p>So, is there any way to deploy NAudio to Kubernetes? or I have to change to another library?</p>

<p>Please help me if you know about it.
Thanks</p>

Vo Dinh Duy
<p>Considering that Kubernetes only very recently began to support Windows containers, and that support is still so sketchy as to virtually make Windows containers still unsupported, I'd imagine you're running linux containers.</p>

<p>Something like an audio library is very often going to be platform-specific, using APIs provided by a particular operating system, drivers compatible only with a particular operating system, etc. I'd imagine that's the case here: your NAudio library only works in Windows. You need to find a library that is either cross-platform or will work in linux, if you're going to be using linux containers.</p>

<p>.NET Core 2.0 began allowing references to .NET Framework libraries as a convenience. There's tons of .NET Framework libraries and components out there, many of which are no longer updated, but yet are perfectly compatible with .NET Standard and thus .NET Core. However, being able to add the reference is not a guarantee that will will <em>actually</em> work, and in particular, work cross-platform.</p>

<p>For what it's worth, you should attempt to mimic your production environment as closely as possible in development. In particular here, if you're going to be deploying to linux containers in Kubernetes, then you should use linux containers in your dev environment (fully supported by Docker for Windows) and even actually use Kubernetes (built in to Docker for Windows).</p>
