Skip to main content

Consume SDK via Project Reference

Follow the steps mentioned below to use SDK as a project reference.

Installation:

The following section explains how to use a C# client library in a new project.

note

This section explains how to consume an SDK in Visual Studio 2022.

  • To start a new project, right click on the current solution from the solution explorer and choose Add -> New Project.

    Add a new project in Visual Studio

  • Next, choose Console Application.

    Create a new Console Application in Visual Studio

  • Provide TestConsoleProject as the project name and click on the Next button.

    Create test console project

  • Select the target framework for your console application and click on the Create button.

    Select target framework

  • The new console project is the entry point for the execution. This requires you to set this new TestConsoleProject as the start-up project. To do this, right-click on the TestConsoleProject and choose Set as StartUp Project form the context menu.

    Adding a project reference

  • In order to use the generated library in the new project, first you need to add a project reference to the TestConsoleProject. Right click on the Dependencies node in the solution explorer and click on Add Project Reference....

    Adding a project reference

  • On the window displayed, check the client project checkbox and click OK.

    Creating a project reference

Once the TestConsoleProject is created, a file named Program.cs will be visible in the solution explorer with an empty Main method. Here, you can add code to initialize the client library and acquire the instance of a Controller class.

Adding a project reference

Test the SDK:

The generated SDK also contains one or more tests in the Tests project. In order to invoke these test cases, you need NUnit 3.0 Test Adapter Extension for Visual Studio. Once the SDK is complied, the test cases should appear in the Test Explorer window. Here, you can click Run All to execute these test cases.