Getting the error: Could not load file or assembly 'ThomsonReuters.Udap.BusTools.dll' is not a valid

Getting the error: Could not load file or assembly 'ThomsonReuters.Udap.BusTools.dll' is not a valid Win32 application.

Best Answer

  • sujit
    Answer ✓

    Replacing EikonPipeDII.dll and I18nResource.dll from Eikon install folder with ones from x64 package worked great. Now I can connect and download the data in Matlab.

    @Alex Putkov. Thanks for being so patient and helpful. Cheers!!!

Answers

  • Could you please provide more information about this. What is the context? Where are you getting this error?

  • I am trying to connect Matlab to Eikon. Followed the instructions mentioned in https://developers.thomsonreuters.com/article/using-eikon-net-sdk-matlab and downloaded the .m files zipped in EikonNETMatlabExample.

    When I run treikonnect, I get the above error

  • Which version of Matlab are you using? Please make sure the bitness of Eikon .NET SDK you downloaded from NuGet corresponds to the bitness of of your Matlab environment as per the Installation section of the article providing the example. Also make sure to copy all the files listed in the Installation section of the article to the folder referenced in treikonnet.m module.

  • @Alex Putkov. I am using Matlab 2018a 64 bit. Downloaded thomsonreuters.desktop.sdk.dataaccess.signed.x64.1.8.4 from Nuget and installed by running Install-Package ThomsonReuters.Desktop.SDK.DataAccess.Signed.x64

    at nuget PM Console . Have all the dll files listed in the article together with msvcp120.dll and msvcr120.dll in the common folder. Still getting the error. Not sure what is going wrong

  • One more thing. Make sure you use the versions of Common.Logging, Newtonsoft.Json and protobuf-net packages that got downloaded with ThomsonReuters.Desktop.SDK.DataAccess.Signed.x64.1.8.4 and not the latest versions of these packages. I.e. you should have
    Common.Logging.dll v2.1.2
    Newtonsoft.Json.dll v6.0.8.18111
    protobuf-net.dll v2.0.0.66

  • @Alex Putkov. did as you suggested. But no luck. I am using the files available in lib\net40 folder as available in the package

  • However, the error has now changed. Now its throwing up the following error: Message: Could not load file or assembly

    'file:///C:\Temp\EikonNetSDK\ThomsonReuters.Desktop.SDK.DataAccess.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format. Source: mscorlib

  • This error message very strongly suggests a mismatch in the bitness of ThomsonReuters.Desktop.SDK.DataAccess.dll and Matlab. Did you copy ThomsonReuters.Desktop.SDK.DataAccess.dll from ThomsonReuters.Desktop.SDK.DataAccess.Signed.x64 package?

  • Replaced ThomsonReuters.Desktop.SDK.DataAccess.dll from .x64 package. Error has changed again. Now I am getting:

    Message: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. Source: mscorlib

    • Delete all files from your EikonNetSDK folder.
    • Copy EikonPipeDll.dll and i18nresource.dll from Eikon install folder to your EikonNetSDK folder.
    • Copy the rest of the files listed in the article from ThomsonReuters.Desktop.SDK.DataAccess.Signed.x64 package to your EikonNetSDK folder.
    • Try running Matlab code in the example.
  • did that..now back to the old error:

    Message: Could not load file or assembly 'ThomsonReuters.Udap.BusTools.dll' or one of its dependencies. is not a valid Win32 application. (Exception from HRESULT: 0x800700C1) Source: mscorlib

  • A quick Web lookup on the error message suggests that the most likely reason for the error is an attempt to load a 32-bit dll into a 64-bit process. Are you sure you copied all the files from x64 package? You previously mentioned that you included Microsoft C++ runtime dlls (msvcp120.dll and msvcr120.dll) in the folder referenced by the example. Most likely you already have these files in the system folder. Try deleting them from EikonNetSDK folder and running the example again. These two files should then be picked up from the system folder.

  • I just realized I previously instructed you to use EikonPipeDll.dll and I18nResource.dll from Eikon install folder. Try replacing them with the namesake files from x64 package.
    If you still get the same error message, check all the files in the EikonNetSDK folder to see if any of them are 32-bit. Here's one way to do this.
    https://superuser.com/questions/358434/how-to-check-if-a-binary-is-32-or-64-bit-on-windows