> ## Documentation Index
> Fetch the complete documentation index at: https://easyaf.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# IHostBuilder

> Extension methods for IHostBuilder from Microsoft.Extensions.Hosting.Abstractions

## Definition

**Assembly:** Microsoft.Extensions.Hosting.Abstractions.dll

**Namespace:** Microsoft.Extensions.Hosting

## Syntax

```csharp theme={"dark"}
Microsoft.Extensions.Hosting.IHostBuilder
```

## Summary

This type is defined in Microsoft.Extensions.Hosting.Abstractions.

## Remarks

See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/microsoft.extensions.hosting.ihostbuilder) for more information about the rest of the API.

## Methods

### <Icon icon="puzzle-piece" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Configure <Badge color="green">Extension</Badge>

<Note>Extension method from `Microsoft.Extensions.Hosting.BreakdanceHostBuilderExtensions`</Note>

Configures the application request pipeline for the web host.
This is a convenience wrapper around ConfigureWebHost for Breakdance test scenarios.

#### Syntax

```csharp theme={"dark"}
public static Microsoft.Extensions.Hosting.IHostBuilder Configure(Microsoft.Extensions.Hosting.IHostBuilder builder, System.Action<Microsoft.AspNetCore.Builder.IApplicationBuilder> configure)
```

#### Parameters

| Name        | Type                                                              | Description                                                                                                                                   |
| ----------- | ----------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `builder`   | `Microsoft.Extensions.Hosting.IHostBuilder`                       | The [IHostBuilder](/breakdance/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) to configure.                                         |
| `configure` | `System.Action<Microsoft.AspNetCore.Builder.IApplicationBuilder>` | The delegate to configure the [IApplicationBuilder](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.builder.iapplicationbuilder). |

#### Returns

Type: `Microsoft.Extensions.Hosting.IHostBuilder`
The [IHostBuilder](/breakdance/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) for chaining.

### <Icon icon="puzzle-piece" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetAllServiceDescriptors <Badge color="green">Extension</Badge>

<Note>Extension method from `Microsoft.Extensions.DependencyInjection.Breakdance_Assemblies_IHostBuilderExtensions`</Note>

Get all registered [ServiceDescriptor](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.servicedescriptor)ServiceDescriptors\</see> for a given container.

#### Syntax

```csharp theme={"dark"}
public static System.Collections.Generic.Dictionary<System.Type, Microsoft.Extensions.DependencyInjection.ServiceDescriptor> GetAllServiceDescriptors(Microsoft.Extensions.Hosting.IHostBuilder builder)
```

#### Parameters

| Name      | Type                                        | Description |
| --------- | ------------------------------------------- | ----------- |
| `builder` | `Microsoft.Extensions.Hosting.IHostBuilder` | -           |

#### Returns

Type: `System.Collections.Generic.Dictionary<System.Type, Microsoft.Extensions.DependencyInjection.ServiceDescriptor>`

#### Remarks

Taken from [https://stackoverflow.com/a/60529530/403765](https://stackoverflow.com/a/60529530/403765)

### <Icon icon="puzzle-piece" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetContainerContentsLog <Badge color="green">Extension</Badge>

<Note>Extension method from `Microsoft.Extensions.DependencyInjection.Breakdance_Assemblies_IHostBuilderExtensions`</Note>

#### Syntax

```csharp theme={"dark"}
public static string GetContainerContentsLog(Microsoft.Extensions.Hosting.IHostBuilder hostBuilder)
```

#### Parameters

| Name          | Type                                        | Description |
| ------------- | ------------------------------------------- | ----------- |
| `hostBuilder` | `Microsoft.Extensions.Hosting.IHostBuilder` | -           |

#### Returns

Type: `string`

### <Icon icon="puzzle-piece" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> UseStartup <Badge color="green">Extension</Badge>

<Note>Extension method from `Microsoft.Extensions.Hosting.BreakdanceHostBuilderExtensions`</Note>

Specifies the startup type to be used by the web host.
This is a convenience wrapper around ConfigureWebHost for Breakdance test scenarios.

#### Syntax

```csharp theme={"dark"}
public static Microsoft.Extensions.Hosting.IHostBuilder UseStartup<TStartup>(Microsoft.Extensions.Hosting.IHostBuilder builder) where TStartup : class
```

#### Parameters

| Name      | Type                                        | Description                                                                                           |
| --------- | ------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `builder` | `Microsoft.Extensions.Hosting.IHostBuilder` | The [IHostBuilder](/breakdance/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) to configure. |

#### Returns

Type: `Microsoft.Extensions.Hosting.IHostBuilder`
The [IHostBuilder](/breakdance/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) for chaining.

#### Type Parameters

* `TStartup` - The startup type.
