{"id":13458357,"url":"https://github.com/aliyun/aliyun-openapi-net-sdk","last_synced_at":"2025-05-13T17:10:15.610Z","repository":{"id":3201470,"uuid":"45900227","full_name":"aliyun/aliyun-openapi-net-sdk","owner":"aliyun","description":"The Alibaba Cloud V1.0 SDK will soon enter the Basic Security Maintenance phase and is no longer recommended for use.","archived":false,"fork":false,"pushed_at":"2025-05-06T06:11:05.000Z","size":35556,"stargazers_count":545,"open_issues_count":20,"forks_count":623,"subscribers_count":70,"default_branch":"master","last_synced_at":"2025-05-09T11:03:16.626Z","etag":null,"topics":["dotnet","net","sdk","v1"],"latest_commit_sha":null,"homepage":"https://www.nuget.org/profiles/aliyun-openapi-sdk","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aliyun.png","metadata":{"files":{"readme":"README-CN.md","changelog":"CHANGELOG","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-11-10T09:04:59.000Z","updated_at":"2025-05-07T06:48:57.000Z","dependencies_parsed_at":"2023-01-13T16:22:35.540Z","dependency_job_id":"651f7cec-1c1b-4160-9bd0-5253d4466f22","html_url":"https://github.com/aliyun/aliyun-openapi-net-sdk","commit_stats":{"total_commits":2698,"total_committers":27,"mean_commits":99.92592592592592,"dds":"0.34025203854707187","last_synced_commit":"347526eb84477629b876b52459af84be1c8b2a33"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliyun%2Faliyun-openapi-net-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliyun%2Faliyun-openapi-net-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliyun%2Faliyun-openapi-net-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliyun%2Faliyun-openapi-net-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aliyun","download_url":"https://codeload.github.com/aliyun/aliyun-openapi-net-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253416150,"owners_count":21904995,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dotnet","net","sdk","v1"],"created_at":"2024-07-31T09:00:51.369Z","updated_at":"2025-05-13T17:10:10.582Z","avatar_url":"https://github.com/aliyun.png","language":"C#","funding_links":[],"categories":["C\\#"],"sub_categories":[],"readme":"[English](./README.md) | 简体中文\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\" https://www.alibabacloud.com\"\u003e\u003cimg src=\"https://aliyunsdk-pages.alicdn.com/icons/Aliyun.svg\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eAlibaba Cloud SDK for .NET\u003c/h1\u003e\n\n[![.NET CI](https://github.com/aliyun/aliyun-openapi-net-sdk/actions/workflows/ci.yml/badge.svg)](https://github.com/aliyun/aliyun-openapi-net-sdk/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/gh/aliyun/aliyun-openapi-net-sdk/graph/badge.svg?token=TiTJg3ch1j)](https://codecov.io/gh/aliyun/aliyun-openapi-net-sdk)\n[![Nuget Version](https://badge.fury.io/nu/aliyun-net-sdk-core.svg)](https://www.nuget.org/packages/aliyun-net-sdk-core/)\n[![Nuget Download](https://img.shields.io/nuget/dt/aliyun-net-sdk-core.svg?label=Nuget%20Download\u0026style=flat)](https://www.nuget.org/packages/aliyun-net-sdk-core/)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/aliyun/aliyun-openapi-net-sdk/blob/master/LICENSE)\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Faliyun%2Faliyun-openapi-net-sdk.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Faliyun%2Faliyun-openapi-net-sdk?ref=badge_shield)\n\n阿里云 V1.0 SDK 即将进入基础安全维护阶段，不再建议使用，建议使用 V2.0 SDK。\n\n## 使用诊断\n\n[Troubleshoot](https://api.aliyun.com/troubleshoot?source=github_sdk) 提供 OpenAPI 使用诊断服务，通过 `RequestID` 或 `报错信息` ，帮助开发者快速定位，为开发者提供解决方案。\n\n## 使用Demo及其示例\n\n您可以在 [阿里云 OpenAPI 开发者门户](https://api.aliyun.com/) 中查看您所使用的产品代码示例。\n\n## 环境要求\n\nAlibaba Cloud SDK for .NET 适用于:\n\n- **.NET Framework 4.5** 及其以上版本\n- **.NET Standard 2.0** 及其以上版本。\n- **C# 4.0** 及其以上版本\n\n## 安装\n\n进入 [Alibaba Cloud SDK for .NET Nuget Package](https://www.nuget.org/profiles/aliyun-openapi-sdk) 页面，查看已发布的阿里云产品 SDK 模块列表。\n\n\u003e **注意：** 部分阿里云产品的 SDK 未收录到这个列表中，例如对象存储（OSS），表格存储（Table Store），请前往这些产品的详情页获取相应的 SDK。\n\n使用ECS产品时，应安装 [ECS Nuget Package](https://www.nuget.org/packages/aliyun-net-sdk-ecs/)。\n如果要安装特定版本，请添加`--version`，否则它将安装此软件包的最新版本。\n\n您可以通过 NuGet 程序包管理器来安装：\n\n- 在 `解决方案资源管理器面板` 中右击您的项目选择 `管理 NuGet 程序包` 菜单，在打开的 `NuGet 管理面板` 中点击 `浏览` 选项卡输入 `aliyun-net-sdk`，在下方列表中选择 `Authors` 为 `Alibaba Cloud` 由官方发布的各产品模块，选择您期望的模块点击 **安装** 即可。\n\n或者通过 .NET CLI 工具来安装（以安装 ECS为例）\n\n    dotnet add package aliyun-net-sdk-ecs\n\n## 快速开始\n\n- 要使用 Alibaba Cloud SDK for .NET，您需要一个云账号以及一对 Access Key ID 和 Access Key Secret。请在阿里云控制台中的 [AccessKey 管理页面](https://usercenter.console.aliyun.com/#/manage/ak) 上创建和查看您的 Access Key，或者联系您的系统管理员。\n\n- 要使用 Alibaba Cloud SDK for .NET 访问某个产品的 API，您需要事先在 [阿里云控制台](https://home.console.aliyun.com/new#/) 中开通这个产品。\n\n以下这个代码示例向您展示了调用阿里云 .NET SDK 的 3 个主要步骤：\n\n1. 创建 `DefaultAcsClient` 实例并初始化；\n2. 创建 API 请求并设置参数；\n3. 发起请求并处理返回。\n\n```csharp\nusing Aliyun.Acs.Core;\nusing Aliyun.Acs.Core.Profile;\nusing Aliyun.Acs.Core.Exceptions;\nusing Aliyun.Acs.Ecs.Model.V20140526;\n\nclass Program\n{\n    static void Main(string[] args)\n    {\n        // 构建一个 Client，用于发起请求\n        IClientProfile profile = DefaultProfile.GetProfile(\n            \"\u003cyour-region-id\u003e\",\n            \"\u003cyour-access-key-id\u003e\",\n            \"\u003cyour-access-key-secret\u003e\");\n        DefaultAcsClient client = new DefaultAcsClient(profile);\n\n        try\n        {\n            // 构造请求\n            DescribeInstancesRequest request = new DescribeInstancesRequest();\n            request.PageSize = 10;\n\n            // 发起请求，并得到 Response\n            DescribeInstancesResponse response = client.GetAcsResponse(request);\n            System.Console.WriteLine(response.TotalCount);\n        }\n        catch (ServerException ex)\n        {\n            System.Console.WriteLine(ex.ToString());\n        }\n        catch (ClientException ex)\n        {\n            System.Console.WriteLine(ex.ToString());\n        }\n    }\n}\n```\n\n在创建 DefaultAcsClient 实例并初始化时，您需要填写 3 个参数：`Region ID`、`Access Key ID` 和 `Access Key Secret`。`Access Key ID` 和 `Access Key Secret` 可以从控制台获得；而 `Region ID` 可以从 [地域列表](https://help.aliyun.com/document_detail/40654.html) 中获得。\n\n### 使用 BearerToken 调用 [CCC](https://www.nuget.org/packages/aliyun-net-sdk-ccc/) 产品\n\n首先需要保证您已经安装了相应的 Nuget 包依赖。\n\n```csharp\nusing Aliyun.Acs.Core;\nusing Aliyun.Acs.Core.Profile;\nusing Aliyun.Acs.Core.Exceptions;\nusing Aliyun.Acs.CCC.Model.V20170705;\n\nclass Program\n{\n    static void Main(string[] args)\n    {\n        // 构建一个 Client，用于发起请求\n        var profile = DefaultProfile.GetProfile(\"\u003cyour-region-id\u003e\");\n        var bearerTokenCredentialProvider = new BearerTokenCredentialProvider(\"\u003cyour-bearertoken\u003e\");\n\n        var client = new DefaultAcsClient(profile, bearerTokenCredentialProvider);\n\n        try\n        {\n            // 构造请求\n            var request = new ListPhoneNumbersRequest();\n\n            // 发起请求，并得到 Response\n            var response = client.GetAcsResponse(request);\n\n            // Do something as you want below\n        }\n        catch (ServerException ex)\n        {\n            System.Console.WriteLine(ex.ToString());\n        }\n        catch (ClientException ex)\n        {\n            System.Console.WriteLine(ex.ToString());\n        }\n    }\n}\n```\n\n## 文档\n\n- [环境要求](docs/0-Requirements-CN.md)\n- [SSL 验证](docs/1-Verify-CN.md)\n- [调试](docs/2-Debug-CN.md)\n- [代理](docs/3-Proxy-CN.md)\n- [超时](docs/4-Timeout-CN.md)\n- [产品Nuget包](docs/5-Packages-CN.md)\n- [日志](docs/6-Log-CN.md)\n- [客户端与凭证](docs/7-Client-CN.md)\n- [Endpoint](docs/8-Endpoint-CN.md)\n\n## 问题\n\n[提交Issue](https://github.com/aliyun/aliyun-openapi-net-sdk/issues/new)，不符合指南的问题可能会立即关闭。\n\n## 发行说明\n\n每个版本的详细更改记录在 [发行说明](aliyun-net-sdk-core/ChangeLog.md) 中。\n\n## API参考\n\n要知道您想访问的产品提供的 API 以及它们的参数，请参考开放 API 的 [产品列表](https://develop.aliyun.com/tools/openapilist)。\n\n## 许可证\n\n源码基于 [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0.html) 许可协议开放授权\n\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Faliyun%2Faliyun-openapi-net-sdk.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Faliyun%2Faliyun-openapi-net-sdk?ref=badge_large)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliyun%2Faliyun-openapi-net-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faliyun%2Faliyun-openapi-net-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliyun%2Faliyun-openapi-net-sdk/lists"}