ConfigurationSectionGroup.ForceDeclaration Method (Boolean)
Assembly: System.Configuration (in system.configuration.dll)
The ForceDeclaration method forces this ConfigurationSectionGroup declaration to be written to the file if force is true. If force is false, this action may be ignored if the ConfigurationSectionGroup is required by the system.
The ForceDeclaration method can force a ConfigurationSectionGroup to be written to a configuration file even if it is not required because it is already declared in a parent file. Also, it can remove a group from a configuration file if the group is not required.
You may want to use the ForceDeclaration method to make a configuration file more portable from one machine to another, without warring about if the group declaration already exists.
The following code example shows how to use the ForceDeclaration.
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.