FederationConfiguration Constructor (Boolean)

.NET Framework (current version)

Initializes a new instance of the FederationConfiguration class by optionally loading settings from the system.identityModel.services section of the configuration file.

Namespace:   System.IdentityModel.Services.Configuration
Assembly:  System.IdentityModel.Services (in System.IdentityModel.Services.dll)

public FederationConfiguration(
	bool loadConfig


Type: System.Boolean

true to initialize with settings loaded from the configuration file; false to initialize to default values.

Exception Condition

The system.identityModel configuration section is not defined in the configuration file.


Before the new FederationConfiguration instance is used by any of the configured HTTP modules, call the Initialize method to ensure that the instance is properly initialized.

The system.identityModel section must be specified in a <section> element under the <configSections> element in the configuration file or an exception is thrown.

  <section name="system.identityModel" type="System.IdentityModel.Configuration.SystemIdentityModelSection, System.IdentityModel, Version=, Culture=neutral, PublicKeyToken=B77A5C561934E089" />

If loadConfig is true and only a single <federationConfiguration> element is specified, settings are loaded using that element. If multiple <federationConfiguration> elements are specified, the method attempts to load settings from the element that is unnamed of that has the DefaultFederationConfigurationName. If such an element does not exist, the method returns without loading settings. This results in an exception when the Initialize method is called.


Microsoft recommends that if you specify multiple <federationConfiguration> elements in the system.identityModel.services configuration section that at least one of them is unnamed or has its name set to an empty string.

.NET Framework
Available since 4.5
Return to top