Before you use SDK for C# to send and subscribe to messages, you must prepare the environment by following the instructions provided in this topic.
Environment requirements
- .NET is installed. For more information, visit Install .NET.
- Visual Studio 2015 or later is installed. For more information, visit Install Visual Studio.
After .NET is installed, you can run the dotnet --version
command to check the version of NET.
Install SDK for C#
Perform the following steps to install SDK for C#:
- Download SDK for C# and the project file to your on-premises machine and decompress them. Aliyun_MQ_SDK is the directory where the SDK is located. Aliyun_MQ_SDK.sln is the project file.
- Use Visual Studio to open the Aliyun_MQ_SDK.sln file and import it to the Aliyun_MQ_SDK project.
- Execute the Samples.cs file. In the Aliyun_MQ_SDK project, the Samples.cs file appears. This file provides the sample code about how to send and subscribe to messages by using SDK for C#. Replace the example values in the code with the values used in your application. Then, save the file and execute it.