[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-19 UTC."],[[["\u003cp\u003eThis page provides reference documentation for the \u003ccode\u003eServiceCollectionExtensions\u003c/code\u003e class within the Google Cloud Build v1 API, specifically for .NET development.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of the \u003ccode\u003eServiceCollectionExtensions\u003c/code\u003e is 2.15.0, with a list of all versions starting from 1.0.0 to the current version, each with their own respective documentation.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eServiceCollectionExtensions\u003c/code\u003e class is a static class used to extend \u003ccode\u003eIServiceCollection\u003c/code\u003e, allowing for the configuration of API clients.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eServiceCollectionExtensions\u003c/code\u003e class offers methods to add a singleton \u003ccode\u003eCloudBuildClient\u003c/code\u003e to the service collection.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eAddCloudBuildClient\u003c/code\u003e methods provide options for configuring the \u003ccode\u003eCloudBuildClient\u003c/code\u003e through an optional action on the \u003ccode\u003eCloudBuildClientBuilder\u003c/code\u003e, with or without the \u003ccode\u003eIServiceProvider\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Cloud Build v1 API - Class ServiceCollectionExtensions (2.16.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.16.0 (latest)](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/latest/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [2.15.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.15.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [2.14.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.14.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [2.13.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.13.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [2.12.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.12.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [2.11.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.11.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [2.10.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.10.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [2.9.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.9.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [2.8.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.8.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [2.7.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.7.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [2.6.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.6.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [2.5.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.5.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.4.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.3.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [2.2.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.2.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [2.1.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.1.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [2.0.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.0.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [1.4.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/1.4.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [1.3.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/1.3.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [1.2.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/1.2.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/1.1.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)\n- [1.0.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/1.0.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions) \n\n public static class ServiceCollectionExtensions\n\nReference documentation and code samples for the Cloud Build v1 API class ServiceCollectionExtensions.\n\nStatic class to provide extension methods to configure API clients. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e ServiceCollectionExtensions \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Microsoft.Extensions.DependencyInjection](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/latest/Microsoft.Extensions.DependencyInjection)\n\nAssembly\n--------\n\nGoogle.Cloud.CloudBuild.V1.dll\n\nMethods\n-------\n\n### AddCloudBuildClient(IServiceCollection, Action\\\u003cCloudBuildClientBuilder\\\u003e)\n\n public static IServiceCollection AddCloudBuildClient(this IServiceCollection services, Action\u003cCloudBuildClientBuilder\u003e action = null)\n\nAdds a singleton [CloudBuildClient](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/latest/Google.Cloud.CloudBuild.V1.CloudBuildClient) to `services`.\n\n### AddCloudBuildClient(IServiceCollection, Action\\\u003cIServiceProvider, CloudBuildClientBuilder\\\u003e)\n\n public static IServiceCollection AddCloudBuildClient(this IServiceCollection services, Action\u003cIServiceProvider, CloudBuildClientBuilder\u003e action)\n\nAdds a singleton [CloudBuildClient](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/latest/Google.Cloud.CloudBuild.V1.CloudBuildClient) to `services`."]]