# Google.Cloud.Diagnostics.Common - Class ErrorReportingExtensions (5.3.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [5.3.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/latest/Google.Cloud.Diagnostics.Common.ErrorReportingExtensions)
- [5.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/5.2.0/Google.Cloud.Diagnostics.Common.ErrorReportingExtensions)
- [5.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/5.1.0/Google.Cloud.Diagnostics.Common.ErrorReportingExtensions)
- [5.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/5.0.0/Google.Cloud.Diagnostics.Common.ErrorReportingExtensions)
- [4.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/4.4.0/Google.Cloud.Diagnostics.Common.ErrorReportingExtensions)
- [4.3.1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/4.3.1/Google.Cloud.Diagnostics.Common.ErrorReportingExtensions)

    public static class ErrorReportingExtensions

Reference documentation and code samples for the Google.Cloud.Diagnostics.Common class ErrorReportingExtensions.

Extension methods for registering the Error Reporting component for Dependency Injection.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> ErrorReportingExtensions

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.Diagnostics.Common](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/latest/Google.Cloud.Diagnostics.Common)

## Assembly

Google.Cloud.Diagnostics.Common.dll

## Methods

### AddGoogleErrorReporting(IServiceCollection, ErrorReportingServiceOptions)

    public static IServiceCollection AddGoogleErrorReporting(this IServiceCollection services, ErrorReportingServiceOptions options = null)

Registers the Error Reporting component for Dependency Injection.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `services` | `https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection` |
| `options` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/latest/Google.Cloud.Diagnostics.Common.ErrorReportingServiceOptions` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection` |   |