ConfigurationManager::OpenMachineConfiguration Method ()
Opens the machine configuration file on the current computer as a Configuration object.
Assembly: System.Configuration (in System.Configuration.dll)
| Exception | Condition |
|---|---|
| ConfigurationErrorsException | A configuration file could not be loaded. |
Machine configuration settings apply to the whole computer and all applications that reside on it, unless overridden for the local application. Machine configuration settings are read from the Machine.config file of the currently running version of the .NET Framework. The Machine.config file is located in the following subdirectory:
%windir%\Microsoft.NET\Framework\version\config
Note |
|---|
To obtain the Configuration object for a resource, your code must have read permissions on all the configuration files from which it inherits settings. To update a configuration file, your code must additionally have write permissions for both the configuration file and the directory in which it exists. It is not possible to access the Machine.config file for other versions of the .NET Framework that might be installed on the computer. |
Available since 2.0
