ไลบรารีของไคลเอ็นต์ .NET
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ไลบรารีของไคลเอ็นต์ .NET โฮสต์อยู่ใน GitHub และจัดจำหน่าย
เป็นแพ็กเกจ NuGet โดยมีฟีเจอร์หลายอย่างที่จะช่วยให้คุณใช้ API ได้ เช่น การจัดการข้อมูลเข้าสู่ระบบที่ง่ายขึ้น
และการสร้างไคลเอ็นต์บริการ Google Ads API
ไลบรารีรองรับ .NET Framework ต่อไปนี้
- .NET Framework 4.7.2 ขึ้นไป (
net472
)
- .NET Standard 2.1 (
netstandard2.1
)
- .NET 6.0 (
net6.0
)
- .NET 8.0 (
net8.0
)
.NET Standard 2.1 ใช้งานร่วมกับ .NET เวอร์ชันและการติดตั้งใช้งานอื่นๆ ได้หลายรายการ ดังนั้นไลบรารีอาจทำงานได้ดีในแพลตฟอร์มอื่นๆ อีกมากมาย
อย่างไรก็ตาม เรายังไม่ได้ทดสอบความเข้ากันได้อย่างเป็นทางการ จึงไม่รองรับแพลตฟอร์มเหล่านี้อย่างเป็นทางการ
ดูข้อมูลเพิ่มเติมเกี่ยวกับความเข้ากันได้ของ .NET Standard ได้ที่ https://learn.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-1
ไลบรารี .NET ของ Google Ads API ใช้ Grpc.Net.Client
เป็นค่าเริ่มต้น โดยจะเปลี่ยนไปใช้ Grpc.Core
ในแพลตฟอร์มที่ไม่รองรับ คุณบังคับให้ใช้
Grpc.Core
ได้โดยตั้งค่า UseGrpcCore
เป็น true
ดูหัวข้อ
ใช้ไลบรารี Grpc รุ่นเดิม
หากต้องการเริ่มใช้ไลบรารีนี้ โปรดดูข้อกำหนดเบื้องต้นและอ่านคู่มือการเริ่มต้นใช้งาน
ดูข้อมูลเกี่ยวกับโทเค็นการรีเฟรช OAuth2 ได้ที่ขั้นตอนการทำงานของแอปพลิเคชัน OAuth บนเดสก์ท็อปและเว็บ และหากต้องการทำการเรียก API
โดยใช้บัญชีบริการ OAuth2 โปรดดูขั้นตอนของบัญชีบริการ OAuth
ดูฟีเจอร์และยูทิลิตีของไลบรารีได้ในคำแนะนำต่อไปนี้
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-26 UTC
[null,null,["อัปเดตล่าสุด 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)"]]