Thư viện ứng dụng .NET
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Thư viện ứng dụng .NET được lưu trữ trên GitHub và được phân phối dưới dạng gói NuGet. Thư viện này cung cấp một số tính năng giúp bạn sử dụng API, bao gồm cả việc quản lý thông tin đăng nhập dễ dàng hơn và tạo các ứng dụng dịch vụ Google Ads API.
Thư viện này hỗ trợ các .NET Framework sau:
- .NET Framework 4.7.2 trở lên (
net472
)
- .NET Standard 2.1 (
netstandard2.1
)
- .NET 6.0 (
net6.0
)
- .NET 8.0 (
net8.0
)
.NET Standard 2.1 tương thích với một số phiên bản và cách triển khai .NET khác, vì vậy, thư viện này có thể hoạt động tốt trên nhiều nền tảng khác.
Tuy nhiên, chúng tôi chưa kiểm tra chính thức khả năng tương thích và do đó không hỗ trợ chính thức các nền tảng này.
Hãy truy cập vào https://learn.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-1
để tìm hiểu thêm về khả năng tương thích với .NET Standard.
Thư viện .NET của Google Ads API sử dụng Grpc.Net.Client
làm mặc định, với một phương án dự phòng là Grpc.Core
trên các nền tảng không được hỗ trợ. Bạn có thể buộc sử dụng Grpc.Core
bằng cách đặt UseGrpcCore
thành true
. Xem phần Sử dụng thư viện Grpc cũ.
Để bắt đầu sử dụng thư viện này, hãy kiểm tra các điều kiện tiên quyết và tham khảo hướng dẫn bắt đầu.
Để biết thông tin về mã thông báo làm mới OAuth2, hãy xem Quy trình ứng dụng web và máy tính OAuth. Để thực hiện các lệnh gọi API bằng tài khoản dịch vụ OAuth2, hãy xem quy trình tài khoản dịch vụ OAuth.
Hãy tham khảo các hướng dẫn sau đây để biết các tính năng và tiện ích của thư viện:
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-08-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-08-26 UTC."],[[["\u003cp\u003eThe Google Ads API client library for .NET will no longer support .NET 5.0 starting with version 19.0.0, and users should upgrade to a supported version before the end of 2024.\u003c/p\u003e\n"],["\u003cp\u003eThe library supports .NET Framework 4.7.2+, .NET Standard 2.1, .NET 6.0, and .NET 8.0.\u003c/p\u003e\n"],["\u003cp\u003eIt is available as a NuGet package and hosted on GitHub, providing features for easier credential management and service client creation.\u003c/p\u003e\n"],["\u003cp\u003eWhile .NET Standard 2.1 offers compatibility with various .NET versions and implementations, only the explicitly listed frameworks are officially supported.\u003c/p\u003e\n"],["\u003cp\u003eUsers can find comprehensive documentation and guides, covering setup, OAuth flows, logging, and advanced features on the official Google Ads API website.\u003c/p\u003e\n"]]],[],null,["# The .NET Client Library\n\nThe .NET client library is [hosted on GitHub](https://github.com/googleads/google-ads-dotnet) and is distributed\nas a [NuGet package](//www.nuget.org/packages/Google.Ads.GoogleAds/). It\noffers several features to help you use the API, including easier management\nof credentials and creation of Google Ads API service clients.\n\nThe library supports the following .NET Frameworks:\n\n- .NET Framework 4.7.2+ (`net472`)\n- .NET Standard 2.1 (`netstandard2.1`)\n- .NET 6.0 (`net6.0`)\n- .NET 8.0 (`net8.0`)\n\n.NET Standard 2.1 is compatible with several other .NET versions and\nimplementations, so the library might work fine on many other platforms.\nHowever, we haven't officially tested the compatibility and thus don't\nofficially support these platforms.\nSee https://learn.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-1\nto learn more about .NET standard compatibility.\n\nThe Google Ads API .NET library uses `Grpc.Net.Client` as the default, with a\nfallback to `Grpc.Core` on unsupported platforms. You can force the use of\n`Grpc.Core` by setting `UseGrpcCore` to `true`. See\n[Use the legacy Grpc library](/google-ads/api/docs/client-libs/dotnet/getting-started).\n\nTo start using this library, check the\n[prerequisites](/google-ads/api/docs/get-started/introduction) and consult the\n[getting started guide](/google-ads/api/docs/client-libs/dotnet/getting-started).\n\nFor information on OAuth2 refresh tokens, check out [OAuth desktop and web\napplication flows](/google-ads/api/docs/client-libs/dotnet/oauth-web). And to make API calls\nusing OAuth2 service accounts, see [OAuth service account\nflow](/google-ads/api/docs/client-libs/dotnet/oauth-service).\n\nConsult the following guides for the library's features and utilities:\n\n- [Logging](/google-ads/api/docs/client-libs/dotnet/logging)\n- [FieldMasks](/google-ads/api/docs/client-libs/dotnet/field-masks)\n- [ResourceNames](/google-ads/api/docs/client-libs/dotnet/resource-names)\n- [Custom gRPC interceptors](/google-ads/api/docs/client-libs/dotnet/custom-interceptors)\n- [Protocol buffer types](/google-ads/api/docs/client-libs/dotnet/working-with-protobuf)"]]