Adding Redi Type Library reference in Visual Studio 2013

Hi.

I am trying to get real-time market price feed (Level 1) via REDI API.

The version of REDI Plus I have installed is 16.1.0. I am using Visual Studio 2013 and trying to add a reference to the Redi 1.0 Type Library in a C# console application and getting an error attached in the screenshot.

image

I am guessing this might be a installation or configuration issue, but unable to put a finger on it.

Additionally, I have installed the Excel Add-In to be able to submit orders using the Excel macro file.

Any help would be appreciated. Please let me know if additional information is needed.

Best Answer

  • zoya faberov
    Answer ✓

    Hello @mikez,

    To help you to pinpoint the issue, have created an empty 2013 console project and added reference to my local redi.tlb to it.

    I attach it here:

    consoletest1.zip

    You may be able to open it, and if no errors, remove the included reference to .redi.tlb and try adding back reference to .tlb in the local installation of your REDI Plus. The error may give further insight.

«1

Answers

  • Hello @mikez,

    Have you had a chance to see C# tutorials on monitoring L1 data

    Getting Started in C#

    and next

    Monitoring L1 in C#

  • I am waiting for my request to be a family member to be approved. I was given some word documents for installing Redi and using the API in C#.

    As part of using the API in C#, I am stuck at one of the initial steps of adding the Redi Type Library reference.

    In addition to trying to add it from the COM section shown in the screenshot above, I have tried directly adding the Redi.tlb file in Redi installation folder and also the Redi.tlb that had been given to me in one of the emails. The message I get for those is that it is not a valid assembly or COM component.

  • @zoya.farberov I now have access to the link you posted - https://developers.refinitiv.com/transactions/redi-api/learning?content=55939&type=learning_material_item. But I am stuck on the first step where I am not able add the Redi 1.0 Type Library reference in Visual studio.

    Adding the Redi.tlb directly fails with following message:

    image

  • Hello @mikez,

    In Windows Explorer, do you see .the tlb file within your local REDI installation?

    Could you please verify that the path you are specifying in Visual Studio is correct for your local installation?

  • @zoya.farberov

    Yes the path is correct, I have just deleted my name from the path from the image in my previous reply.The above error was after I selected the Redi.tlb file.

    By the way, I noticed that there is a RediLib.dll, and when I add it, I seem to be able use the RediLib.CacheControl. Is that a recommended way of using the Redi library API?

    With the regards to the root cause of the issue, is it probably that during the installation the registration of the Redi Type library COM component didn't happen correctly, which is why I am facing issues trying to add the reference?

  • @mikez,

    The recommended is TLB that is within REDIPlus (not copied to the local project). It will be updated with future updates to your REDIPlus.

    Have you followed REDI API Quickstart first?

  • @zoya.farberov

    The reference I added was to RediLib.dll which is present in %LOCALAPPDATA%\REDI Tech\Primary folder. I haven't copied it manually.

    Yes, I had gone through the REDI API Quickstart on both my machine and also our production environment when we installed the software. We have been using Redi for couple of years or so, using only Excel ("Order Entry - Equities Batch Load.xlsm") to submit orders. Now we were trying to use C# to leverage Redi API to better automate our process.

    Is it possible for some one to schedule some time and do a screen share to troubleshoot this issue? I had someone from Redi help me to a resolve an issue when we started using Redi.

  • @zoya.farberov The reference I added was to RediLib.dll which is present in %LOCALAPPDATA%\REDI Tech\Primary folder.

    I haven't copied it manually. Yes, I had gone through the REDI API Quickstart on both my machine and also our production environment when we installed the software. We have been using Redi for couple of years now, using Excel to submit orders. Currently we are trying to use C# to leverage Redi API.

    Is it possible for some one to schedule some time and do a screen share to troubleshoot this issue? I had someone from Redi help me to resolve an issue when we started using Redi.

  • Hello @mikez,

    If you see .tlb in your folder and are permissioned for it, you should be able to add .tlb as reference.

    I would try removing RediLib from references, and next, adding back in by pointing to .tlb:

    "Add Reference", browse to it, add it in. Please note, in properties it should appear as Interop.RediLib.dll, copied into your build.

    Failing this, please contact your Refinitiv account team, to try to arrange to give you a hand.

  • Good morning @zoya.farberov

    Yes, I have access to the Redi.tlb in the installation folder and have Admin permissions.

    Per your steps, I removed the reference to the Redi dll and added the Redi.tlb manually, but am getting the same error as the on I posted on May 3.

    I will check with the Redi support team again as I was directed here by them.

    Thank you for looking into this.

  • Hello @zoya.farberov.

    I followed up on the support thread on May 6th and today again. Got a reply that a session will be scheduled next week. So still waiting for the official solution for this issue.

    Thanks.

  • Hello @mikez,

    Thanks for the heads-up.

    In the meantime:

    May be worth trying Add reference -> COM-> browse to .tlb file

    Thinking, do you, by chance, have a very old .Net Framework on this project (I add reference to redi.tlb from VS2013 with no errors)?

  • Hi @zoya.farberov

    As mentioned in my previous replies, I did try adding the TLB file multiple times using "Add reference -> COM-> browse to .tlb file". The error is shown in the image from May 3.

    I am using .NET framework 4.5.2. I have also tried changing it to .NET framework 4.5 and .NET framework 4.4 with no luck.

    PS: For some reason was not able to reply to your message, hence reply to the main question thread.

  • @mikez

    (is possible to just Add->Browse, not specifying COM)

    4.5 is good

    For now, would use dll from REDI Tech\Primary folder, so you can integrate and not be held up, while dll you point to will remain consistent with REDI updates in the future.

  • @zoya.farberov

    Yes, have also tried "(is possible to just Add->Browse, not specifying COM)", which gives the same error.

    Sounds good, will be using .NET framework 4.5.2 for now.

    Regarding - "For now, would use dll from REDI Tech\Primary folder, so you can integrate and not be held up, while dll you point to will remain consistent with REDI updates in the future.";

    Do you mean use "RediLib.dll"?

    FYI, the current version I have installed on my system is 11.0.123.4040.

  • Hi @zoya.farberov

    After opening your console project I see this: image.png

    On compiling I get following warning: compilation-warning.txt

    So as per my very first message, looks like the component has not registered correctly during installation?

  • Hi @zoya.farberov

    No. The compilation warning is when I simply opened the project you provided and compiled. Your reference was NOT removed.

    If I remove the reference and try to add again, I see the following error:

    image

    This is again the same as my message from "May 03 at 12:33 PM".

    At this point, it feels like I am just going in circles trying to do the same thing over and over again, I feel that it would be really helpful to have a support call with screen sharing.

  • @Alex Putkov.

    I have no new update as I am still waiting for a reply from Warren (Trading Specialist Support, Refinitiv) to setup a screenshare meeting to troubleshoot this issue...

  • @Alex Putkov.@zoya.farberov

    As seen in the screenshot redilib-reference.png, I have added a reference to RediLib.dll and the "DisplayRediL1Quotes" code from https://github.com/TR-API-Samples/Example.REDI.CSharp.Examples/blob/master/REDIConsoleL1/RediConsoleL1.cs compiles fine.

    When I try to run the code, I get a class not registered exception while trying to create an instance of CacheControl(). Attached is a txt file with the exception. redi-exception.txt

    RediPlus is running on the same PC and I have logged in to it.

    Any help would be appreciated as this is a critical issue for us now.

  • Hello @mikez,

    Apologies for the delay, and thanks @Alex Putkov. for pointing this out, I did not look at the attachment closely.

    Is your REDIPlus running?

    The last error that you include, means that your REDIPlus is not running or the valid user is not logged in. To interact with REDIPlus via API it is required that REDIPlus be running or and a valid user be logged in.

    This exact error I can reproduce.

  • @zoya.farberov @Alex Putkov.

    Yes, REDIPlus is running and am logged in, on the same PC where I am trying to run the .NET console application. Please see the second last line of my June 4th message.

    The error from the github sample code indicates that it is a general exception message for all exceptions of type COMException.

    Also, I tried running the sample console app with direct reference to RediLib.dll in our production env., with the same REDIPlus user, and it seemed to work!

    So will try re-installing REDIPlus on my local PC as it seems like an issue with the COM library registration.

  • Hello @mikez,

    Glad to hear it runs as expected in the production environment, suggest removing .dll reference, adding .tlb, rebuilding, and it should run too.

    Absolutely agree with you. As the issue is specific to your environment, uninstalling and reinstalling REDIPlus (follow Quickstart to install addon and register DDE) is the right approach to fix this. Hopefully this will be it, if not, thinking, may be something missing or corrupted on the MSFT side, VS.

  • @mikez

    Have you installed registry settings (api.reg) for REDEPlus API? Please refer to Step 5 - Install API Package and Excel DDE Component in the REDIPlus & API Installation Guide.

  • @jirapongse.phuriphanvichai

    I believe I had ran the registry settings file when the application was first setup on my machine.

    Nevertheless, I followed "Step 5 - Install API Package and Excel DDE Component" from https://developers.refinitiv.com/transactions/redi-api/quick-start and installed the registry settings (api.reg) again.

    The Redi Type Library COM component still has an issue.

  • Hi @zoya.farberov

    Thanks for checking.

    Not yet, as Warren (trading support, Refinitiv) had asked for a time for a webex call with other members, I wanted to wait and troubleshoot this with them, assuming this is useful for the team.

    I have a new machine and will try to install REDIPlus on it over the weekend.

  • Unfortunately this is still an outstanding issue. Haven't been able to get a meeting setup with REDI Plus support...

  • Hello @mikez,

    Like to share some additional information on the error that you are seeing:

    https://stackoverflow.com/questions/44019317/visual-studio-cant-reference-tlb-dll-anymore

    Can you try registering as described, from an administrator command shell?

    Let us know how it works for you.

    Thanks

  • As suggested in the stackoverflow response, tried the 3rd option and output is attached.console-output.txt

  • @mikez

    You may need the local admin rights. I am not 100% sure, but "access denied" can be related to the unsufficient privileges. You may try to either obtain the local admin on this box and try again, with both REDIPlus and VS running in local admin space, or try on a different dev box, where the user has the local admin.