# TestClusterHostFactory Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.testinghost/orleans.testinghost.testclusterhostfactory/)

## CreateClusterClient(string, IConfiguration, Action&lt;IHostBuilder&gt;) {#createclusterclient-string-microsoft-extensions-configuration-iconfiguration-sys-f8954e81}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.testinghost/orleans.testinghost.testclusterhostfactory/methods/createclusterclient-string-microsoft-extensions-configuration-iconfiguration-sys-f8954e81/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.TestingHost/TestClusterHostFactory.cs#L83-L102)

```csharp
public static IHost CreateClusterClient(string hostName, IConfiguration configuration, Action<IHostBuilder> postConfigureHostBuilder = null)
```

Creates the cluster client.

### Parameters

- `hostName` (`string`): Name of the host.
- `configuration` (`IConfiguration`): The configuration.
- `postConfigureHostBuilder` (`Action<IHostBuilder>`): An optional delegate which can be used to configure the host builder just prior to a host being built.

### Returns

The cluster client host.

## CreateSiloHost(string, IConfiguration, Action&lt;IHostBuilder&gt;) {#createsilohost-string-microsoft-extensions-configuration-iconfiguration-system-a-46d39b15}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.testinghost/orleans.testinghost.testclusterhostfactory/methods/createsilohost-string-microsoft-extensions-configuration-iconfiguration-system-a-46d39b15/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.TestingHost/TestClusterHostFactory.cs#L38-L71)

```csharp
public static IHost CreateSiloHost(string hostName, IConfiguration configuration, Action<IHostBuilder> postConfigureHostBuilder = null)
```

Creates an returns a new silo.

### Parameters

- `hostName` (`string`): The silo name if it is not already specified in the configuration.
- `configuration` (`IConfiguration`): The configuration.
- `postConfigureHostBuilder` (`Action<IHostBuilder>`): An optional delegate which can be used to configure the host builder just prior to a host being built.

### Returns

A new silo.

## DeserializeConfiguration(string) {#deserializeconfiguration-string-175da74a}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.testinghost/orleans.testinghost.testclusterhostfactory/methods/deserializeconfiguration-string-175da74a/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.TestingHost/TestClusterHostFactory.cs#L125-L130)

```csharp
public static IConfiguration DeserializeConfiguration(string serializedSources)
```

Deserializes a configuration string.

### Parameters

- `serializedSources` (`string`): The serialized sources.

### Returns

The deserialized configuration.

## SerializeConfiguration(IConfiguration) {#serializeconfiguration-microsoft-extensions-configuration-iconfiguration-0f87f673}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.testinghost/orleans.testinghost.testclusterhostfactory/methods/serializeconfiguration-microsoft-extensions-configuration-iconfiguration-0f87f673/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.TestingHost/TestClusterHostFactory.cs#L112-L115)

```csharp
public static string SerializeConfiguration(IConfiguration configuration)
```

Serializes configuration to a string.

### Parameters

- `configuration` (`IConfiguration`): The configuration.

### Returns

The serialized configuration.
