The Machine Translation . NET SDK allows developers of the Windows platform to use Alibaba Cloud Machine Translation conveniently through the .NET platform. Currently, the SDK supports . NET Framework 3.5, 4.0, and 4.5. SDK files vary with different .NET Framework versions, but the interfaces and functions are the same.
The GitHub address of the SDK is as follows: Click Here to access GitHub.
You also need to download the Alibaba Cloud . NET SDK
To quickly start using the Machine Translation . NET SDK, take the following steps:
For more information about how to create an Alibaba Cloud account, see Sign up with Alibaba Cloud.
We recommend that you complete real-name authentication as soon as possible to better use Alibaba Cloud services. Otherwise, some services may be unavailable.
To use the Machine Translation. NET SDK, you must apply for an Alibaba Cloud Access Key.
Log on to Alibaba Cloud’s Access Key Management page. Select an Access Key (consisting of an Access Key ID and Access Key Secret) for the SDK. If you do not have an Access Key, create one and make sure the Access Key is enabled.
Currently, the Machine Translation SDK supports . the .NET 3.5 and .NET 4.0/4.5 running environments. To support Machine Translation SDK development, we recommend that you install:
- Microsoft. Net Framework 3.5/4.0/4.5 (the specific version depends on the target environment required by your program.)
- Visual Studio 2010 and later versions
- We recommend that you download the Alibaba Cloud . NET SDK
Install the Log Service After the .NET development environment is installed, install the Machine Translation . NET SDK. Details:
Download the .NET SDK at GitHub: here
If you are using Visual Studio 2017 to open the project, unload the feature test project inside the project solution.It is advised to install SDK using NuGet. Do not perform compilation.Examples of NuGet installation command:
- dotnet add package aliyun-net-sdk-ros —version 2.2.8
- dotnet add package aliyun-net-sdk-alimt
static void Main(string args)
IClientProfile profile = DefaultProfile.GetProfile(
DefaultAcsClient client = new DefaultAcsClient(profile);
TranslateGeneralRequest request = new TranslateGeneralRequest();
request.Method = "POST";
request.FormatType = "text";
request.SourceLanguage = "zh";
request.SourceText = "你好";
request.TargetLanguage = "en";
TranslateGeneralResponse response = client.GetAcsResponse(request);
catch (ServerException ex)
catch (ClientException ex)