C# Client#

This guide provides step-by-step instructions to developing and running a Dlubal API client.

Prerequisites#

Before starting, ensure your system meets the following requirements:

  1. Installed .NET SDK (version 8.0)

    • You’ll need the .NET SDK to install and use NuGet packages in a .NET-based project.

    • Verify the installation by running:

      dotnet --version
      
  2. Installed Visual Studio Code as your code editor:

    • Verify the installation by running:

      code --version
      
  3. Installed C# Extension in VS Code:

    • Open the Extensions view by pressing Ctrl+Shift+X.

    • Search for C# and click on Install.

Create a New Project#

  1. Open Visual Studio Code.

  2. Open the Integrated Terminal

    • In VS Code, press Ctrl+` to open the terminal, or go to the menu and select Terminal > New Terminal.

  3. Create a New Project

    • In the Terminal, run the following command to create a new console application project:

      dotnet new console -n MyDlubalProject
      
    • This will create a new folder named MyDlubalProject with a basic console application.

  4. Open the Project Folder in VS Code

    • Navigate into the newly created project folder and open it:

      cd MyDlubalProject
      code .
      

Install the Dlubal API Package#

Option 1: Installing from the Terminal (CLI)

  1. Open a Terminal in your project directory.

  2. Run the following command to install the package into your project

    dotnet add package Dlubal.Api
    

Option 2: Installing via the Nuget Package Manager

  1. Install NuGet Package Manager Extension in VS Code

    • Go to the Extensions view (press Ctrl+Shift+X)

    • Search for NuGet Package Manager and click Install on the relevant extension.

  2. Use NuGet Package Manager to install the package

    • After installing the extension, open the Command Palette (press Ctrl+Shift+P)

    • Search for NuGet Package Manager: Add Package and select it.

    • In the input box, type the name of the package Dlubal.Api and select the correct version if needed.

    • The package will be installed and added to your project’s dependencies.

Verify the Installation#

To verify the package has been installed correctly:

  1. Open a Terminal in your project directory.

  2. Run the following command:

    dotnet list package
    
  3. Ensure Dlubal.Api appears in the list of installed packages.