question

Upvotes
Accepted
3 1 2 4

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.

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.

redi-apivisual-studio
image.png (41.8 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

10 Answers

Upvotes
Accepted
23k 22 9 14

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.


consoletest1.zip (63.6 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

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?

image.png (33.7 KiB)
Upvotes
23k 22 9 14

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#

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
3 1 2 4

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.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

@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.

Upvotes
3 1 2 4

@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.png (20.6 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

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?

Show more comments
Upvotes
23k 22 9 14

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.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

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.

Upvotes
3 1 2 4

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.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

@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.

Upvotes
3 1 2 4

@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.


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
23k 22 9 14

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.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

@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.

Upvotes
23k 22 9 14

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.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
23k 22 9 14

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

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

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.

@zoya.farberov I tried running the sample code on a local admin account after installing REDI Plus 19.1.0 and it worked. I verified that my domain account is a local Admin.

From our call, we had tried uninstalling, deleting some entries from windows registry, and then reinstalling REDI Plus 19.1.0, but to no avail. So at this point I am not entirely sure if there is some domain policy which is causing permission issues despite being a local admin or something else.

For now I will be using my local account for the development.

Thank you for all your help everyone!

Click below to post an Idea Post Idea