.NET API Problem ThomsonReuters.Desktop.SDK.DataAccess.TinyIoCResolutionException: 'Unable to resolv

I am trying to download data using C# .NET API and then feed the data into MATLAB 2018b 64-bits.

Initially, I have successfully downloaded the data using C# but not able to assembly the dll in MATLAB because the NuGet Package ThomsonReuters.Desktop.SDK.DataAccess.Signed is in 32-bits.

After reading this, I managed to install the ThomsonReuters.Desktop.SDK.DataAccess.Signed x64 package. The following error appears:

ThomsonReuters.Desktop.SDK.DataAccess.TinyIoCResolutionException

HResult=0x80131500

Message=Unable to resolve type: ThomsonReuters.Desktop.SDK.DataAccess.IInternalDataServices

Source=ThomsonReuters.Desktop.SDK.DataAccess

StackTrace:

at ThomsonReuters.Desktop.SDK.DataAccess.TinyIoCContainer.DelegateFactory.GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options)

at ThomsonReuters.Desktop.SDK.DataAccess.TinyIoCContainer.ResolveInternal(TypeRegistration registration, NamedParameterOverloads parameters, ResolveOptions options)

at ThomsonReuters.Desktop.SDK.DataAccess.TinyIoCContainer.Resolve[ResolveType](String name)

at ThomsonReuters.Desktop.SDK.DataAccess.DataServices.get_Instance()

at EikonTester.Program.Main(String[] args) in C:\Users\XUEWE614\source\repos\EikonTester\Program.cs:line 18


Inner Exception 1:

TinyIoCResolutionException: Unable to resolve type: ThomsonReuters.Desktop.SDK.DataAccess.IInternalDataServices


Inner Exception 2:

TinyIoCResolutionException: Unable to resolve type: ThomsonReuters.Desktop.SDK.DataAccess.UdapService


Inner Exception 3:

TinyIoCResolutionException: Unable to resolve type: ThomsonReuters.Desktop.SDK.DataAccess.Connection


Inner Exception 4:

TinyIoCResolutionException: Unable to resolve type: ThomsonReuters.Udap.Ipc.Managed.Common.BusAdapter.IEikonBus


Inner Exception 5:

FileNotFoundException: Could not load file or assembly 'ThomsonReuters.Udap.BusTools.dll' or one of its dependencies. The specified module could not be found.


I followed this, checked all four DLLs are presents in the bin folder and in 64-bits.

I have tried to use the Process Monitor to see where goes wrong but with no success. I am not sure which filter I should use to check the events.

the following is the packages file

<?xml version="1.0" encoding="utf-8"?>

<packages>

<package id="Common.Logging" version="2.1.2" targetFramework="net461" />

<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net461" />

<package id="protobuf-net" version="2.0.0.668" targetFramework="net461" />

<package id="ThomsonReuters.Desktop.SDK.DataAccess.Signed.x64" version="1.8.4" targetFramework="net461" />

<package id="ThomsonReuters.Udap.Ipc.Signed.x64" version="2.10.5" targetFramework="net461" />

</packages>


Any suggestions about how I should proceed?




Best Answer

  • @xuewei.zhu

    Please see the article titled Using Eikon .NET SDK in Matlab. This article provides precise instructions for setting up Eikon .NET SDK for use in Matlab.
    Note that Eikon .NET SDK has dependency on both version 10 and 12 of Microsoft C runtime libraries. All 4 of the following DLLs must be available either in the PATH or in the same folder you load Eikon .NET SDK from: msvcp100.dll, msvcr100.dll, msvcp120.dll, msvcr120.dll.

Answers

  • @Alex Putkov.

    Thanks for the quick respond.

    I followed your steps and got this error:

    Error using treikonnet (line 25)

    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

    HelpLink:


    I have checked all the DLLs manually and found out

    Common.Logging.dll ; Newtonsoft.Json.dll ; protobuf-net.dll are in 32-bits. all the others are in 64-bits.


    this is the package information

    <package id="Common.Logging" version="2.1.2" targetFramework="net461" />

    <package id="Newtonsoft.Json" version="6.0.8" targetFramework="net461" />

    <package id="protobuf-net" version="2.0.0.668" targetFramework="net461" />

    <package id="ThomsonReuters.Desktop.SDK.DataAccess.Signed.x64" version="1.8.4" targetFramework="net461" />

    <package id="ThomsonReuters.Udap.Ipc.Signed.x64" version="2.10.5" targetFramework="net461" />

  • @xuewei.zhu

    Common.Logging.dll, Newtonsoft.Json.dll, protobuf-net.dll are compiled as Any CPU. The problem is not the bitness of these libraries, it's something else. It's quite puzzling that the name of what "is not a valid Win32 application" is missing from the error message. This makes it hard to pinpoint the problem.
    Perhaps it would be a good idea to build a quick 64-bit test application using Eikon .NET SDK in Visual Studio. This will make it easier to troubleshoot the problems, should you encounter any. You could use one of the examples available under the Downloads tab on Eikon .NET SDK page. Just make sure you reference the 64-bit SDK and compile the example as 64-bit. Once you have a working .NET test app, you can use the build folder of this test app as the location to load Eikon .NET SDK from into Matlab.

  • That's where I have the error message in my original post.

    In visual studio,

    If I change the package to 32 bits, it works fine with any CPU.

    If I use 64 bits package and compile using x64, it gives me the error when I try to initialize the server at the very beginning.


  • I'm not sure I'm following the scenario. Are you saying with 32-bit Eikon .NET SDK you can compile your project as Any CPU and run it on a 64-bit Windows? I find it very hard to believe. This makes no sense to me. With 32-bit Eikon .NET SDK your project may only work if it's compiled as x86. This said, what you're looking to do is to create an x64 project. And this is where you get FileNotFoundException, right? To isolate the issue I suggest starting with a very simple test project (like the example console applications under the Downloads tab on Eikon .NET SDK page). If you experience FileNotFoundException with one of these projects, make sure all the files listed in the Installation section of Using Eikon .NET SDK in Matlab article including msvcp100.dll, msvcr100.dll, msvcp120.dll and msvcr120.dll are available either in the build folder or in the PATH. If any DLLs are loaded from the PATH, mind the file system redirector. E.g. if msvcp100.dll is meant to be loaded from System32, then x86 process will look for it in %windir%\SysWOW64. But an x64 process will look for it in %windir%\System32. If msvcp100.dll (or any other required DLL that is not in the build folder) is available in %windir%\SysWOW64, but not in %windir%\System32, then x86 process will load it successfully, but an x64 process will raise FileNotFoundException.

  • @Alex Putkov.


    What I meant was I could install 32 bits package and download the data using Any CPU without any problem. But following the same steps except using 64 bits package and x64 process throws an error message.


    I have fixed the problem now by adding the msvcr100.dll and msvcp100.dll to the bin folder. I am able to run the C# project with x64 process now. Using the build folder as the location to load Eikon .NET SDK into MATLAB, I am able to use MATLAB to download the data directly as well!


    Thanks for your help!