Installing or upgrading the LUSID C# SDK

The LUSID C# SDK provides convenient access to the LUSID REST API in .NET 6 environments.

Note: Supporting applications in the FINBOURNE platform (such as Drive, Scheduler and Luminesce) have their own C# SDKs.

Note the following:

  • We strongly recommend pinning a SDK to an exact version to control when you take updates and make your builds repeatable.

  • The master/main branch of a SDK may not always have the latest REST API version; there may, for example, also be v2 or v3 branches. We aim to keep master/main updated with the latest API version, but there may be some lead time while we deprecate older endpoints. Once we deprecate older API versions, the latest API version is moved to the master/main branch. 

Installing the latest LUSID C# SDK

You can install v2 of the LUSID C# SDK using the following .NET command:

$ dotnet add package Lusid.Sdk

Alternatively, you can download the source from Github.

To authenticate for the first time, you must generate a client ID and secret and store them with the credentials of a valid LUSID user as either environment variables or in a secrets file. The LUSID C# SDK uses these credentials to obtain a short-lived API access token from FINBOURNE's identity provider (Okta) on demand. More information.

Documentation for SDK methods is available as a searchable package on Readthedocs

Upgrading to v2 from an earlier version

You can upgrade from v1 to v2 of the LUSID C# SDK by using the following .NET command:

$ dotnet add package Lusid.Sdk

We recommend upgrading to this version as soon as possible to ensure you have access to the latest features.

Note that you must upgrade all SDKs used in a particular process to v2 at the same time. A process that uses both the Scheduler and Drive SDKs, for example, must either use v1 of both SDKs or v2 of both SDKs; mixing major versions will lead to dependency conflicts.

Users need to update their code to reflect the following v2 changes...

Prerequisites for v2

.NET at version 6.0 or above.

Preview SDKs

This release discontinues publishing the LUSID Preview SDK, instead adding the Experimental and Beta lifecycle APIs to a single SDK. The LUSID C# SDK now contains all the newest features; only Lusid.Sdk need be installed. Note that making requests to Experimental and Beta APIs requires additional licences; for more details please contact support

Long-running API requests

Long-running API requests are enabled, giving users the option to extend or remove request timeout limits (previously timed out at 350 seconds). To extend the timeout on API calls, construct a configuration object and pass it into the ApiFactory, for example:

var configuration = new Configuration
{
    BasePath = "https://<your-domain>.lusid.com/api",
    AccessToken = System.Environment.GetEnvironmentVariable("ACCESS_TOKEN"),
    Timeout = (int)TimeSpan.FromMinutes(10).TotalMilliseconds,
};
var client = new ApiFactory(configuration);

Name changes

The following namespaces, classes and interfaces are renamed:

  • using Lusid.Sdk.Utilities becomes using Lusid.Sdk.Extensions.

  • LusidApiFactory becomes ApiFactoryFactory.

  • ILusidApiFactory becomes IApiFactory.

Version becomes a reserved word in OpenApi Generator:

  • Sdk.Version becomes Sdk.ModelVersion.

  • Any model that implemented an Sdk.Version (now Sdk.ModelVersion) changes from Version to _Version

Installing v1 of the LUSID C# SDK

Please note v1 of Lusid.Sdk and Lusid.Sdk.Preview is now discontinued, but if you do need to install it then two packages are published:

If you do need to install v1 of the LUSID C# SDK for any reason, note two packages are published:

  • Lusid.Sdk contains only APIs with a lifecycle status of Production or Early Access. You can install the LUSID C# SDK using the following .NET command:

    $ dotnet add package Lusid.Sdk --version "[1.*,2.0)"
  • Lusid.Sdk.Preview contains additional APIs with a lifecycle status of Experimental or Beta. You can install the LUSID C# Preview SDK using the following .NET command:

    $ dotnet add package Lusid.Sdk.Preview --version "[1.*,2.0)"