1 Reply Latest reply on Nov 16, 2017 1:40 PM by polinao RSS
    mandersson Newbie

    twapi.dll 'System.DllNotFoundException' in thingworx-dotnet-common.dll .net SDK



    I am trying the .net SDK and setting up the SteamSensorClient example. I can't get it to work, it seams it can't find the twapi.dll or load it.


    I have tried to copy the dll to the output debug folder. Tried to copy the complete tw folder. I have followed the instructions in the support article: Article Viewer | PTC.


    I have installed the Visual C++ Redistributable for visual studio 2017. Tried different compliations, x86 and x64. Note the C++ Redistributable are x64 bit.

    Anyone with the same issue? I am using Visual studio 2017 and .net framework 4.6.1.


    Thanks Mattias


    Error message:

    Message=Not possible to read DLL-file twApi.dll: ... (Undantag från HRESULT:

      Source=<Cannot evaluate the exception source>


    System.DllNotFoundException occurred


      Message=Det gick inte att läsa in DLL-filen twApi.dll: Det går inte att hitta den angivna modulen. (Undantag från HRESULT:

      Source=<Cannot evaluate the exception source>


       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:\projects\MED-61061-CD-055_M030_Dotnet-SDK-5-7-1-1969-win\Example\SteamSensorConsole\SteamSensorClient.cs:line 18

       at SteamSensorConsole.SteamSensorClient.Main(String[] args) in C:\projects\MED-61061-CD-055_M030_Dotnet-SDK-5-7-1-1969-win\Example\SteamSensorConsole\SteamSensorClient.cs:line 81