Skip to main content
1-Visitor
Solved

Unable to load DLL 'twApi.dll' error running SteamSensor in docker

Downloaded the .NET SDK and everything works fine on my windows 10 laptop.

 

But when running the exact same bits in a docker container, getting this error. I have tried various images such as

microsoft/aspnet
mcr.microsoft.com/dotnet/framework/sdk:4.8
docker pull mcr.microsoft.com/dotnet/framework/runtime:4.8
mcr.microsoft.com/windows/servercore:10.0.16299.1029

 

com.thingworx.communications.client.TwApiWrapper Error: 0 : Error initializing the .NET SDK. : System.DllNotFoundException: Unable to load DLL 'twApi.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at com.thingworx.communications.client.TwApiWrapper.twW_SetLoggerProperties(TwApiLogLevel level, Byte isVerboseEnabled, TwLogMessageDelegate onLogMessage)
at com.thingworx.communications.client.TwApiWrapper.ConfigureTwApiLogger()
at com.thingworx.communications.client.TwApiWrapper.Initialize(ClientConfigurator config)

Unhandled Exception: System.DllNotFoundException: Unable to load DLL 'twApi.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at com.thingworx.communications.client.TwApiWrapper.twW_SetLoggerProperties(TwApiLogLevel level, Byte isVerboseEnabled, TwLogMessageDelegate onLogMessage)
at com.thingworx.communications.client.TwApiWrapper.ConfigureTwApiLogger()
at com.thingworx.communications.client.TwApiWrapper.Initialize(ClientConfigurator config)
at com.thingworx.communications.client.ConnectedThingClient..ctor(ClientConfigurator config)
at SteamSensorConsole.SteamSensorClient..ctor(ClientConfigurator config) in C:\Users\rshrini\samples\Dotnet-SDK-5-7-6-3407-win\Example\SteamSensorConsole\SteamSensorClient.cs:line 19
at SteamSensorConsole.SteamSensorClient.Main(String[] args) in C:\Users\rshrini\samples\Dotnet-SDK-5-7-6-3407-win\Example\SteamSensorConsole\SteamSensorClient.cs:line 91

smainenteAnswer
16-Pearl

Can you verify that Microsoft Visual C++ Redistributable for Visual Studio 2012 is installed in your container ?

2 replies

smainente16-PearlAnswer
16-Pearl

Can you verify that Microsoft Visual C++ Redistributable for Visual Studio 2012 is installed in your container ?

Translate
srajgopal1-VisitorAuthor
1-Visitor

That did the trick. Thanks so much. 

Translate