All Products
Search
Document Center

Content Moderation:Installation

Last Updated:Jul 31, 2023

Before you use Content Moderation SDK for .NET, you must install the required dependencies.

Prerequisites

  • .NET Framework 4.5 or later is installed.

  • .NET Standard 2.0 or later is installed.

  • C# 4.0 or later is installed.

Install the SDK

  1. Download Content Moderation SDK for .NET.

  2. Install Content Moderation SDK for .NET.

    • Install the SDK by using the .NET Core command line interface (CLI)

      Note

      To install the SDK of a specified version, you must add --version <Version number> to the command. Example: dotnet add package aliyun-net-sdk-core --version 1.0.0. If you do not specify the version number of Content Moderation SDK for .NET, the SDK of the latest version is installed.

      dotnet add package aliyun-net-sdk-core
      dotnet add package aliyun-net-sdk-green
    • Install the SDK by running the dotnet build command

      1. Add the following code to the .csproj file:

        <PackageReference Include="aliyun-net-sdk-core" Version="1.5.10" />
        <PackageReference Include="aliyun-net-sdk-green" Version="3.6.5" />
      2. Run the following command to install the SDK:

        dotnet build

Configure environment variables

In Alibaba Cloud SDK code, you can create a default access credential by defining ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET environment variables. When you call API operations of Alibaba Cloud services, the system directly accesses the credential, reads your AccessKey pair, and then automatically completes authentication. Before you use the SDK sample code, you must configure environment variables. For more information, see Configure credentials.