LSEG Data Library for .Net

Getting Started with .NET
Example Source Code

.NET/C#

Examples referenced

Last Update November 2024
.NET/C# - Compilers/Packages Compilers: Microsoft VS 2019, 2022
Packages Preloaded: NuGet Package Manager 2.12 (or greater)
C# Version 6.0 or greater
Prerequisites

Access Credentials

If accessing content from:

  • Desktop (LSEG Workspace 1.8 or greater)
  • Deployed Environment (ADS 3.2 or greater)

The goal of this Getting Started tutorial is to provide the .NET developer with the steps required to prepare an environment to access content within the desktop (LSEG Workspace) or platform (Refinitiv Data Platform). The LSEG Data Library for .NET is designed as an ease-of-use interface allowing the developer simple access to content from multiple supporting access points. That is, they can choose to access content directly within the cloud, access from the desktop through the LSEG Workspace desktop application, or via a locally deployed enterprise streaming installation (ADS).

This quick start guide will provide the steps to set up and configure the .NET example package necessary to access the content.

Additional details on the prerequisites

All examples are built with Microsoft .NET 8.0 and should be pre-installed.  The library supports .NET Framework 4.8, .NET 6.0 and .NET 8.0.

All examples will automatically download NuGet dependencies when loading/building a solution.  NuGet Package Manager 2.12 (or greater) is required to be pre-installed prior to loading the solution.  The minimum Package Manager is available within the modern Visual Studio IDE's such as 2019, 2022.  Developers may need to upgrade their package managers for older IDE's such as VS2015.

Define your credentials

By default, the example package will attempt to connect into the desktop (LSEG Workspace) to retrieve content, however, overriding the default is easily configurable.  Desktop users will not require any further configuration specifications within the package, other than acquiring proper LSEG Workspace credentials. Platform access, via the Refinitiv Data Platform (RDP),  will require either v1 (version 1) or v2 (version 2) credentials.  The downloadable example package will provide a series of examples that will cover specific capabilities that will support a cross-section of the services within the platform.  Once the .NET Example package has been downloaded and uncompressed, load the solution project within Visual Studio.

To ensure you can successfully execute the examples within the Content and Delivery sections, you will need to define your credentials within the Configuration folder of the example package.  Depending on how you plan to access content, you can then test whether your credentials work by running one of the examples within the Quick Start section.

First, load up the Credentials.cs file within the Configuration folder.

The Credentials file is a series of settings, depending on how you plan to access the content.  Prior to setting, ensure you have reviewed the Access Credentials Guide to determine the requirements. Modify the relevant configuration parameters to specify any connection properties and user credentials.

 

Enable your session environment

When testing against the examples within the folders, you only need to set up your session environment once.  Once enabled, many examples will automatically use that session.  Within the Session.cs source file, update the SessionType setting to DESKTOP, RDP (v1/v2), DEPLOYED or CONFIG.  The default is DESKTOP

The CONFIG setting can be very useful if you already have an existing configuration file defined.  For those examples that don't explicitely define an explicit session, users can define credentials within their own configuration.  Refer to the section 4.1 - Configuration for further details.  This capability is not required but more for convenience.

It's worth noting that within the entire package, certain applications will require an explicit session specification.  For example, the ESG examples will only be availble on RDP and thus you will see an explicit session specification for these examples.

Testing your Credentials

Once the credential settings have been defined, select an example outlined within the Quick Start folder.  For the selected example:

  1. Right-click the specific project and choose "Set As Startup Project"
  2. From the Visual Studio menu, choose "Build - Build Solution"
  3. Once built, run the example by hitting (Ctrl+F5).

Example 1.1 - PlatformSession

Test your RDP credentials to ensure access.  Based on credentials provided, this example will prompt whether to test your v1 (version 1) or v2 (version 2) credentials.  Running the example should result in the following output:

Example 1.2 - DesktopSession

Test your desktop credentials to ensure access.  When testing your desktop credentials, the Eikon or Refinitiv Workspace application must be running.  Running the example should result in the following output:

Example 1.3 - DeployedSession

Test your connection into a deployed streaming environment providing access to streaming market data services.  Running the example should result in the following output:

Note: The NuGet packages used by these examples will automatically load.  If you have issues or errors during the build, Clean the solution then Build again.

If you have any issues running the examples, refer to the Troubleshooting section below for more details.

If you have successfully verified a connection using one of the Quick Start examples, you are ready to explore the examples available within the Delivery and Content folders defined within the example package.

Troubleshooting

The specific quick start example you chose to test your credentials will provide the reason for failure.  For example:

The details you provided within the Credentials.cs file within the Configuration project may be incorrect.  Refer to the section above for details around credentials and verify these settings.  In addition, ensure you have chosen the correct Session for your connection requirements.  Depending on your session settings, it is suggested to reach out to the appropriate person(s) if you believe your connection details are correct:

  • RDP Session
    • Reach out to your account representive to report and confirm the issues you are facing and they can verify the connection details and access credentials based on your license    
  • Desktop Session
    • Within either Refinitiv Workspace or Eikon, you can access Get Help & Support by navigating to the Help menu or executing the "F1" hotkey
  • Deployed Session
    • Reach out to your local market data team and they can confirm your DACs credentials

To further analyze details related to any errors, you can refer to the log file generated by all examples.  For the specific project, navigate to the executable directory (bin) and locate the log file - format: RDPLog_<pid>.log

Next Steps

Once credentials have been verified, feel free to work through the tutorials to better understand the capabilities and power of the LSEG Data Library for .Net.