Home Running a dotnetcore2.0 C# module, with OpenCV, in a nanoserver docker container
Reply: 0

Running a dotnetcore2.0 C# module, with OpenCV, in a nanoserver docker container

user1798
1#
user1798 Published in July 20, 2018, 1:19 am

I have a very basic C# dotnet core 2.0 application which uses a couple very basic features of OpenCV as a proof of concept.

I'm trying to run this in a nanoserver container, eventually to be deployed as an IoT Edge module but I get an error saying that it cannot locate a dll.

Unhandled Exception: System.TypeInitializationException: The type initializer for 'OpenCvSharp.NativeMethods' threw an exception. ---> 
System.DllNotFoundException: Unable to load DLL 'OpenCvSharpExtern': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

I have tried compliling with just dotnet publish IoTCoreCSharp.csproj and with dotnet publish IoTCoreCSharp.csproj --runtime win10-x64 --configuration Debug --force both without luck.

My docker file looks like this:

FROM microsoft/dotnet:2.0.0-runtime-nanoserver-1709

ARG EXE_DIR=.

WORKDIR /app

COPY $EXE_DIR/ ./

COPY system32_opencvsharp_deps/ C:/Windows/System32

CMD ["dotnet" "IoTCoreCSharp.dll"]

system32_opencvsharp_deps contains avicap32.dll, avifil32.dll, msacm32.dll, msvfw32.dll, and vcruntime140.dll
OpenCvSharpExtern.dll is located in the root of the directory of the dll we're executing.

Edit: The program runs in a windowsservercore based image with dotnet installed on it perfectly on my dev machine, but this kind of image does not run on Windows 10 IoT Core which we need. Error when trying to run on IoT Core: c:\Program Files\docker\docker.exe: Error response from daemon: container e9da3baa806f161153fdb7f60a9401a5ff46c32a959499cbe0bd822b1fc0dda3 encountered an error during Start: failure in a Windows system call: The compute system exited unexpectedly. (0xc0370106).

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.324941 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO