diff --git a/xml/System.Configuration/AppSettingsReader.xml b/xml/System.Configuration/AppSettingsReader.xml
index 7382aa67174..abf3a0c1ce4 100644
--- a/xml/System.Configuration/AppSettingsReader.xml
+++ b/xml/System.Configuration/AppSettingsReader.xml
@@ -33,57 +33,7 @@
Provides a method for reading values of a particular type from the configuration.
-
- ` section, and then uses the to read the settings just generated.
-
-```csharp
-using System;
-using System.Configuration;
-
-class Program
-{
- static void Main(string[] args)
- {
- var reader = new AppSettingsReader();
-
- var stringSetting = reader.GetValue("String setting", typeof(string));
- Console.WriteLine("String setting: " + stringSetting);
-
- var dateTimeSetting = reader.GetValue("DateTime setting", typeof(DateTime));
- Console.WriteLine("DateTime setting: " + dateTimeSetting);
-
- try
- {
- var missingSetting = reader.GetValue("Int setting", typeof(Int32));
- }
- catch (InvalidOperationException e)
- {
- Console.WriteLine("Missing key error: " + e.Message);
- }
-
- Console.WriteLine("Press any key to continue");
- Console.ReadKey();
- }
-}
-```
-
- The following example demonstrates a configuration file used by the previous example.
-
-```xml
-
-
-
-
-
-
-
-```
-
- ]]>
-
+ To be added.
@@ -115,57 +65,7 @@ class Program
Initializes a new instance of the class.
-
- ` section, and then uses the to read the settings just generated.
-
-```csharp
-using System;
-using System.Configuration;
-
-class Program
-{
- static void Main(string[] args)
- {
- var reader = new AppSettingsReader();
-
- var stringSetting = reader.GetValue("String setting", typeof(string));
- Console.WriteLine("String setting: " + stringSetting);
-
- var dateTimeSetting = reader.GetValue("DateTime setting", typeof(DateTime));
- Console.WriteLine("DateTime setting: " + dateTimeSetting);
-
- try
- {
- var missingSetting = reader.GetValue("Int setting", typeof(Int32));
- }
- catch (InvalidOperationException e)
- {
- Console.WriteLine("Missing key error: " + e.Message);
- }
-
- Console.WriteLine("Press any key to continue");
- Console.ReadKey();
- }
-}
-```
-
- The following example demonstrates a configuration file used by the previous example.
-
-```xml
-
-
-
-
-
-
-
-```
-
- ]]>
-
+ To be added.
diff --git a/xml/System.Configuration/AppSettingsSection.xml b/xml/System.Configuration/AppSettingsSection.xml
index ac1a01ae7df..38dd71fc3c3 100644
--- a/xml/System.Configuration/AppSettingsSection.xml
+++ b/xml/System.Configuration/AppSettingsSection.xml
@@ -32,26 +32,7 @@
Provides configuration system support for the configuration section. This class cannot be inherited.
-
- object, you should use the property of the class or the property of the class.
-
-
-
-## Examples
- The following example shows how to use the class in a console application. It reads and writes the key/value pairs that are contained by the `appSettings` section. It also shows how to access the property of the class.
-
-> [!NOTE]
-> Before you compile this code, add a reference in your project to System.Configuration.dll.
-
- :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.AppSettingsSection/CS/UsingAppSettingsSection.cs" id="Snippet21":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.AppSettingsSection/VB/AppSettingsSection.vb" id="Snippet21":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.AppSettingsSection/VB/UsingAppSettingsSection.vb" id="Snippet21":::
-
- ]]>
-
+ To be added.
diff --git a/xml/System.Configuration/ApplicationSettingsBase.xml b/xml/System.Configuration/ApplicationSettingsBase.xml
index 71d025cffcb..858efb2bbd9 100644
--- a/xml/System.Configuration/ApplicationSettingsBase.xml
+++ b/xml/System.Configuration/ApplicationSettingsBase.xml
@@ -246,7 +246,7 @@
property to the value of the `settingsKey` parameter. This property is useful in disambiguating different instances of the settings wrapper class in the same application domain.
+ This constructor initializes the property to the value of the `settingsKey` parameter. This property is useful in disambiguating different instances of the settings wrapper class.
For information about how reflection is used during the instantiation of a wrapper class, see the default constructor.
@@ -294,7 +294,7 @@
## Remarks
The object specified by the `owner` parameter acts as the owner of the current instance of this applications settings class. During the initialization of the settings wrapper class derived from , the owner's site is queried for a . If one exists, it is used in preference to native settings provider for all the properties of the wrapper class, as specified by the .
- This constructor initializes the property to the value of the `settingsKey` parameter. This property is useful in disambiguating different instances of the wrapper class in the same application domain.
+ This constructor initializes the property to the value of the `settingsKey` parameter. This property is useful in disambiguating different instances of the wrapper class.
For information about how reflection is used during the instantiation of a wrapper class, see the default constructor.
diff --git a/xml/System.Configuration/ClientSettingsSection.xml b/xml/System.Configuration/ClientSettingsSection.xml
index f9bdd51f346..72f25a9d14d 100644
--- a/xml/System.Configuration/ClientSettingsSection.xml
+++ b/xml/System.Configuration/ClientSettingsSection.xml
@@ -36,11 +36,10 @@
, which stores configuration data to the local file system in files with the extension `.config`. The contents of configuration files are structured as XML documents. User-scoped settings are persisted in a file with the name `username.config`. Within this file, data is stored as elements within a `` section. Each of these sections is represented by a corresponding . Each section object is owned and administered by a configuration section handler, which is an .
- The class represents a simple extension of the class, which is used in the .NET Framework support for general configuration files.
+.NET contains a single default settings provider, , which stores configuration data to the local file system in files with the extension `.config`. The contents of configuration files are structured as XML documents. User-scoped settings are persisted in a file with the name `username.config`. Within this file, data is stored as elements within a `` section. Each of these sections is represented by a corresponding . Each section object is owned and administered by a configuration section handler, which is an .
- For more information about application settings, see the topic [Application Settings for Windows Forms](/dotnet/desktop/winforms/advanced/application-settings-for-windows-forms).
+ The class represents a simple extension of the class, which is used in the .NET support for general configuration files.
]]>
diff --git a/xml/System.Configuration/Configuration.xml b/xml/System.Configuration/Configuration.xml
index 2b790e075d8..bb41eb1bdcf 100644
--- a/xml/System.Configuration/Configuration.xml
+++ b/xml/System.Configuration/Configuration.xml
@@ -43,7 +43,6 @@
You can get a object by using the following classes:
- The class, if your entity is a client application.
-
- The class, if your entity is a Web application.
The names of the methods that return a object begin with "Open".
@@ -51,15 +50,12 @@
You can also generate a configuration file that represents the configuration settings in a object. To do this, use one of the following methods:
- Call the method to create a new configuration file.
-
- Call the method to generate a new configuration file at another location.
The names of the methods that create configuration files begin with "Save".
> [!NOTE]
-> To enable access to configuration settings on a remote computer, use the Aspnet_regiis command-line tool. For information about creating and accessing custom configuration settings other than the intrinsic sections included in the .NET Framework, refer to .
-
-
+> To enable access to configuration settings on a remote computer, use the Aspnet_regiis command-line tool. For information about creating and accessing custom configuration settings other than the intrinsic sections included in .NET, see .
## Examples
The following code example demonstrates how to use the class to access configuration file elements.
@@ -92,7 +88,6 @@ Note: If you use a static method that takes a path
- Configuration Files
@@ -178,7 +173,7 @@ Note: If you use a static method that takes a path
@@ -466,17 +461,9 @@ Note: If you use a static method that takes a path
property also returns `true` when the resource represented by this object inherits settings from a Web.config file.
- The property returns `false` when this object represents a location-specific configuration.
-
-
-
-## Examples
- The following code example demonstrates how to use the property.
+The property returns `false` when this object represents a location-specific configuration.
- :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.Configuration/CS/Configuration.cs" id="Snippet9":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.Configuration/VB/Configuration.vb" id="Snippet9":::
]]>
@@ -1138,7 +1125,7 @@ Note: If you use a static method that takes a path
diff --git a/xml/System.Configuration/ConfigurationCollectionAttribute.xml b/xml/System.Configuration/ConfigurationCollectionAttribute.xml
index ed516ef1090..2a8b3e2cd10 100644
--- a/xml/System.Configuration/ConfigurationCollectionAttribute.xml
+++ b/xml/System.Configuration/ConfigurationCollectionAttribute.xml
@@ -138,9 +138,8 @@
.
diff --git a/xml/System.Configuration/ConfigurationElement.xml b/xml/System.Configuration/ConfigurationElement.xml
index 29b15915036..e0079e66b66 100644
--- a/xml/System.Configuration/ConfigurationElement.xml
+++ b/xml/System.Configuration/ConfigurationElement.xml
@@ -36,52 +36,10 @@
is an abstract class that is used to represent an XML element in a configuration file (such as Web.config). An element in a configuration file can contain zero, one, or more child elements.
- Because the class is defined as abstract, you cannot create an instance of it. You can only derive classes from it. The .NET Framework includes classes that derive from the class in order to represent standard XML configuration elements, such as . You can also extend the class to access custom configuration elements and sections. The example included later in this topic shows how to access custom configuration elements and sections by using custom classes that derive from .
+Because the class is defined as abstract, you cannot create an instance of it. You can only derive classes from it. .NET includes classes that derive from the class to represent standard XML configuration elements, such as . You can also extend the class to access custom configuration elements and sections. The example included later in this topic shows how to access custom configuration elements and sections by using custom classes that derive from .
- You can also extend the standard configuration types such as , , , and . For more information, see the documentation for those classes.
-
- For more information about how to access information in configuration files, see the class and the class.
-
-
-
-## Examples
- The following code example shows how to implement a custom both as an individual element in a custom section and as a collection of elements in a custom section. The example consists of the following files:
-
-- An app.config file that contains a custom section that is named `MyUrls`. This section contains a simple element (it does not contain any other elements) and a collection of elements. The simple element is named `simple` and the collection is named `urls`.
-
-- A console application. The application reads the contents of the app.config file and writes the information to the console. It uses classes that derive from , , and .
-
-- A class named `UrlsSection` that derives from the class. This class is used to access the `MyUrls` section in the configuration file.
-
-- A class named `UrlsCollection` that derives from the class. This class is used to access the `urls` collection in the configuration file.
-
-- A class named `UrlConfigElement` that derives from the class. This class is used to access the `simple` element and the members of the `urls` collection in the configuration file.
-
- To run the example, perform the following steps:
-
-1. Create a solution that has a console application project and a class library project that is named `ConfigurationElement`.
-
-2. Put the three class files in the class library project and put the other files in the console library project.
-
-3. In both projects set a reference to `System.Configuration`.
-
-4. In the console application project set a project reference to the class library project.
-
-
-
- :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/CS/ConfigurationElement.cs" id="Snippet151":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/VB/ConfigurationElement.vb" id="Snippet151":::
-
- :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/CS/CustomSection.cs" id="Snippet71":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/VB/CustomSection.vb" id="Snippet71":::
-
- :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/CS/CustomElementCollection.cs" id="Snippet51":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/VB/CustomElementCollection.vb" id="Snippet51":::
-
- :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/CS/CustomElement.cs" id="Snippet31":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/VB/CustomElement.vb" id="Snippet31":::
+You can also extend the standard configuration types such as , , , and .
]]>
@@ -492,7 +450,7 @@
method and the method call this method in order to transform an assembly name when an earlier version of the .NET Framework is targeted.
+ The method and the method call this method in order to transform an assembly name when an earlier version of .NET is targeted.
]]>
@@ -536,7 +494,7 @@
method and the method call this method in order to transform a type name when an earlier version of the .NET Framework is targeted.
+ The method and the method call this method in order to transform a type name when an earlier version of .NET is targeted.
]]>
diff --git a/xml/System.Configuration/ConfigurationManager.xml b/xml/System.Configuration/ConfigurationManager.xml
index 5deedbe4785..57b1f0547da 100644
--- a/xml/System.Configuration/ConfigurationManager.xml
+++ b/xml/System.Configuration/ConfigurationManager.xml
@@ -36,12 +36,7 @@
class enables you to access machine, application, and user configuration information. This class replaces the class, which is deprecated. For web applications, use the class.
-
- To use the class, your project must reference the `System.Configuration` assembly. By default, some project templates, like Console Application, do not reference this assembly so you must manually reference it.
-
-> [!NOTE]
-> The name and location of the application configuration file depend on the application's host. For more information, see [Configuring Apps by using Configuration Files](/dotnet/framework/configure-apps/).
+ The class enables you to access machine, application, and user configuration information.
You can use the built-in types or derive from them to handle configuration information. By using these types, you can work directly with configuration information and you can extend configuration files to include custom information.
@@ -53,21 +48,15 @@
- Support configuration tasks. The following types are used to support various configuration tasks:
- -
-
- -
-
- -
-
- -
-
- -
+ -
+ -
+ -
+ -
+ -
+ -
+ -
- -
-
- -
-
- In addition to working with existing configuration information, you can create and work with custom configuration elements by extending the built-in configuration types such as the , , , and classes. For an example of how to extend a built-in configuration type programmatically, see . For an example of how to extend a built-in configuration type that uses the attribute-based model, see .
+ In addition to working with existing configuration information, you can create and work with custom configuration elements by extending the built-in configuration types such as the , , , and classes. For an example of how to extend a built-in configuration type programmatically, see . For an example of how to extend a built-in configuration type that uses the attribute-based model, see .
## Examples
The first example shows a simple console application that reads application settings, adds a new setting, and updates an existing setting.
@@ -282,24 +271,13 @@ End Module
]]>
- The class enables programmatic access for editing configuration files. You use one of the Open methods provided by . These methods return a object, which in turn provides the required methods and properties to handle the underlying configuration files. You can access these files for reading or writing.
-
- To read the configuration files, use or . The user or process that reads must have the following permissions:
-
-- Read permission on the configuration file at the current configuration hierarchy level.
-
-- Read permissions on all the parent configuration files.
-
- If your application needs read-only access to its own configuration, we recommend that you use the method. This method provides access to the cached configuration values for the current application, which has better performance than the class.
-
- To write to the configuration files, use one of the methods. The user or process that writes must have the following permissions:
+ The class enables programmatic access for editing configuration files. You use one of the Open methods provided by . These methods return a object, which in turn provides the required methods and properties to handle the underlying configuration files. You can access these files for reading or writing.
-- Write permission on the configuration file and directory at the current configuration hierarchy level.
+ To read the configuration files, use or .
-- Read permissions on all the configuration files.
+ To write to the configuration files, use one of the methods.
- Configuration Files
@@ -644,11 +622,11 @@ End Module
The method accesses run-time configuration information that it cannot change. To change the configuration, you use the method on the configuration file that you obtain by using one of the following methods:
--
+-
--
+-
--
+-
## Examples
The following example shows how to use the method. The example is part of a larger example that is provided for the class.
@@ -830,12 +808,12 @@ Calling this method overload is equivalent to calling the [!NOTE]
-> To obtain the 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.
+> To obtain the 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's not possible to access the Machine.config file for other versions of .NET that might be installed on the computer.
## Examples
The following code example shows how to use the method to obtain all sections that are contained in the configuration file.
@@ -1011,12 +989,12 @@ Calling this method overload is equivalent to calling the [!NOTE]
-> To obtain the 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.
+> To obtain the 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's not possible to access the Machine.config file for other versions of .NET that might be installed on the computer.
## Examples
The following code example shows how to use the method to obtain all sections in the configuration file.
diff --git a/xml/System.Configuration/ConfigurationPermission.xml b/xml/System.Configuration/ConfigurationPermission.xml
index 2a18a43e238..92e1b943c2c 100644
--- a/xml/System.Configuration/ConfigurationPermission.xml
+++ b/xml/System.Configuration/ConfigurationPermission.xml
@@ -48,8 +48,6 @@
[!INCLUDE[cas-deprecated](~/includes/cas-deprecated.md)]
- The class provides a permission structure that allows methods or classes to access configuration files. Also, provides ways to resolve multiple permissions values through such methods as and .
-
]]>
@@ -214,14 +212,7 @@ The attribute for the given The object containing the permissions to perform the intersection with.
Returns the logical intersection between the object and a given object that implements the interface.
The logical intersection between the and a given object that implements .
-
- interface, an exception will be thrown if calling the method on the object referenced by the `target` parameter does not return .
-
- ]]>
-
+ To be added.
is not typed as .
@@ -262,16 +253,7 @@ The attribute for the given object with an object implementing the interface.
if the permission state is equal; otherwise, .
-
- interface, an exception will be thrown if calling the method on the object referenced by the `target` parameter does not return .
-
- If the object referenced by the `target` parameter is `null`, the comparison is done between the permission state of the object and the value of the enumeration.
-
- ]]>
-
+ To be added.
is not typed as .
diff --git a/xml/System.Configuration/ConfigurationPermissionAttribute.xml b/xml/System.Configuration/ConfigurationPermissionAttribute.xml
index 9c8142fa9d8..9f022f187ac 100644
--- a/xml/System.Configuration/ConfigurationPermissionAttribute.xml
+++ b/xml/System.Configuration/ConfigurationPermissionAttribute.xml
@@ -121,14 +121,7 @@
Creates and returns an object that implements the interface.
An object that implements .
-
- object.
-
- ]]>
-
+ To be added.
diff --git a/xml/System.Configuration/ConfigurationProperty.xml b/xml/System.Configuration/ConfigurationProperty.xml
index 695eb867522..018c1d832a4 100644
--- a/xml/System.Configuration/ConfigurationProperty.xml
+++ b/xml/System.Configuration/ConfigurationProperty.xml
@@ -568,7 +568,7 @@
System.Boolean
- Indicates whether the assembly name for the configuration property requires transformation when it is serialized for an earlier version of the .NET Framework.
+ Indicates whether the assembly name for the configuration property requires transformation when it is serialized for an earlier version of .NET.
if the property requires assembly name transformation; otherwise, .
@@ -762,7 +762,7 @@
System.Boolean
- Indicates whether the type name for the configuration property requires transformation when it is serialized for an earlier version of the .NET Framework.
+ Indicates whether the type name for the configuration property requires transformation when it is serialized for an earlier version of .NET.
if the property requires type-name transformation; otherwise, .
@@ -811,9 +811,10 @@
to set this property when you call a constructor that includes a parameter.
+If you're creating a configuration property and the property value should not be serialized to XML when an earlier version of the framework is targeted, set this property to `true`.
+
+Use to set this property when you call a constructor that includes a parameter.
]]>
diff --git a/xml/System.Configuration/ConfigurationSection.xml b/xml/System.Configuration/ConfigurationSection.xml
index f6c6fb3b2ef..7e413864c15 100644
--- a/xml/System.Configuration/ConfigurationSection.xml
+++ b/xml/System.Configuration/ConfigurationSection.xml
@@ -40,9 +40,6 @@
A section registers its handling type with an entry in the `configSections` element. For an example, see the configuration file excerpt shown in the Example section.
-> [!NOTE]
-> In previous versions of the .NET Framework, configuration section handlers were used to make changes to configuration settings programmatically. Now, all the default configuration sections are represented by classes that extend the class.
-
## Examples
The following example shows how to implement a custom section programmatically.
@@ -472,15 +469,15 @@ Note: If you use a static method that takes a
The object that is a candidate for serialization.
The name of the object as it occurs in XML.
- The target version of the .NET Framework.
- Indicates whether the specified element should be serialized when the configuration object hierarchy is serialized for the specified target version of the .NET Framework.
+ The target version of .NET.
+ Indicates whether the specified element should be serialized when the configuration object hierarchy is serialized for the specified target version of .NET.
if the should be serialized; otherwise, .
method that takes a
The object that is a candidate for serialization.
The name of the object as it occurs in XML.
- The target version of the .NET Framework.
+ The target version of .NET.
The parent element of the property.
- Indicates whether the specified property should be serialized when the configuration object hierarchy is serialized for the specified target version of the .NET Framework.
+ Indicates whether the specified property should be serialized when the configuration object hierarchy is serialized for the specified target version of .NET.
if the should be serialized; otherwise, .
method that takes a
- The target version of the .NET Framework.
- Indicates whether the current instance should be serialized when the configuration object hierarchy is serialized for the specified target version of the .NET Framework.
+ The target version of .NET.
+ Indicates whether the current instance should be serialized when the configuration object hierarchy is serialized for the specified target version of .NET.
if the current section should be serialized; otherwise, .
Represents a group of related sections within a configuration file.
-
- class represents the `sectionGroup` XML element that is used to group sections when they are defined in the `configSections` element of a configuration file. Section groups can be nested (a section group can contain other section groups as well as sections). The following example shows a `configSections` element that defines three nested section groups:
-
-```xml
-
-
-
-
-
-
-
-
-
-
-
-
-```
-
- The configuration system loads settings from configuration files into objects. You can use the and properties to access the sections and section groups that are contained in a object.
-
- For more information about how to access information from configuration files, see the class.
-
-
-
-## Examples
- The following example shows how to use the class to retrieve configuration settings. The example is a console application that reads configuration settings and writes information about each configuration section group and the sections in it to the console.
-
- The `Main` method loads the configuration settings into a object, retrieves the collection from the object, and then calls the `ShowSectionGroupCollectionInfo` method to display the section property values.
-
- The `ShowSectionGroupCollectionInfo` method iterates through the section groups and calls the `ShowSectionGroupInfo` method for each one.
-
- The `ShowSectionGroupInfo` method displays the name of the section group, some property values, and the names of the sections that it contains. If the section group contains section groups, this method calls `ShowSectionGroupCollectionInfo` recursively to display those section groups.
-
- The `indentLevel` field is used to add spaces to the left side of displayed lines to show logical groupings. All lines are limited to 79 characters of text to avoid line wrapping, which would make it harder to distinguish the logical groupings.
-
- :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationSectionGroup/CS/ConfigurationSectionGroup.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationSectionGroup/VB/ConfigurationSectionGroup.vb" id="Snippet1":::
-
- ]]>
-
+ To be added.
@@ -572,15 +530,15 @@
- The target version of the .NET Framework.
- Indicates whether the current instance should be serialized when the configuration object hierarchy is serialized for the specified target version of the .NET Framework.
+ The target version of .NET.
+ Indicates whether the current instance should be serialized when the configuration object hierarchy is serialized for the specified target version of .NET.
if the current section group should be serialized; otherwise, .
- Provides runtime versions 1.0 and 1.1 support for reading configuration sections and common configuration settings.
-
- type to read configuration information at run time for version 1.0 and 1.1 applications.
-
-> [!NOTE]
-> The class provides backward compatibility only. For new applications, use the class or class instead. To use these two classes, add a reference in your project to the `System.Configuration` namespace.
-
- ]]>
-
+ Provides legacy support for reading configuration sections and common configuration settings.
+ To be added.
diff --git a/xml/System.Configuration/ExeConfigurationFileMap.xml b/xml/System.Configuration/ExeConfigurationFileMap.xml
index bfc22005f7a..1e62a5a4707 100644
--- a/xml/System.Configuration/ExeConfigurationFileMap.xml
+++ b/xml/System.Configuration/ExeConfigurationFileMap.xml
@@ -46,7 +46,6 @@
]]>
- Configuration Files
@@ -122,11 +121,10 @@
- Configuration Files
diff --git a/xml/System.Configuration/IApplicationSettingsProvider.xml b/xml/System.Configuration/IApplicationSettingsProvider.xml
index 7cbeaa3d869..5dea9349eac 100644
--- a/xml/System.Configuration/IApplicationSettingsProvider.xml
+++ b/xml/System.Configuration/IApplicationSettingsProvider.xml
@@ -192,7 +192,8 @@
method, implemented in a class derived from .
+
+.NET enables side-by-side installation and execution of different versions of the same application. The application settings provider stores the application settings for each version of an application separately to ensure isolation. However, you may want to migrate settings from the previous version of an application to the current one. To provide this migration functionality, use the method, implemented in a class derived from .
You can use the method in conjunction with the method to migrate application settings during or after the installation of a new version of an application.
diff --git a/xml/System.Configuration/IConfigurationSectionHandler.xml b/xml/System.Configuration/IConfigurationSectionHandler.xml
index 9c19027ff73..f68b41b72ce 100644
--- a/xml/System.Configuration/IConfigurationSectionHandler.xml
+++ b/xml/System.Configuration/IConfigurationSectionHandler.xml
@@ -37,7 +37,7 @@
## Remarks
> [!IMPORTANT]
- > is deprecated starting in .NET Framework 2.0. In .NET Framework version 2.0 and later, you must instead derive from the class to implement the related configuration section handler.
+ > is deprecated. Instead, derive from the class to implement the related configuration section handler.
Instances of the class must be thread safe and stateless. The method must be callable from multiple threads simultaneously.
diff --git a/xml/System.Configuration/IdnElement.xml b/xml/System.Configuration/IdnElement.xml
index 3096c7d438d..27693573a55 100644
--- a/xml/System.Configuration/IdnElement.xml
+++ b/xml/System.Configuration/IdnElement.xml
@@ -36,9 +36,8 @@
class has been extended to provide support for International Resource Identifiers (IRI) based on RFC 3987. Users upgrading from .NET Framework 2.0 won't see any change in behavior unless they specifically enable IRI. This ensures application compatibility with prior versions of .NET Framework.
- The configuration setting for the is indirectly controlled by the configuration setting that controls IRI processing in the class. IRI processing must be enabled for IDN processing to be possible. If IRI processing is disabled, then IDN processing will be set to the default setting where the .NET Framework 2.0 behavior is used for compatibility and IDN names are not used.
+ The configuration setting for the is indirectly controlled by the configuration setting that controls IRI processing in the class. IRI processing must be enabled for IDN processing to be possible. If IRI processing is disabled, then IDN processing will be set to the default setting where IDN names are not used.
The Internationalized Domain Name (IDN) attribute only controls IDN processing. All other IRI processing (character normalization, for example) is performed by default.
@@ -133,7 +132,7 @@
## Remarks
The International Domain Name (IDN) attribute only controls IDN processing. All other International Resource Identifiers (IRI) processing (character normalization, for example) is performed by default.
- The configuration setting for the is indirectly controlled by the configuration setting that controls IRI processing in the class. IRI processing must be enabled for IDN processing to be possible. If IRI processing is disabled, then IDN processing will be set to the default setting where the .NET Framework 2.0 behavior is used for compatibility and IDN names are not used.
+ The configuration setting for the is indirectly controlled by the configuration setting that controls IRI processing in the class. IRI processing must be enabled for IDN processing to be possible. If IRI processing is disabled, then IDN processing will be set to the default setting where IDN names are not used.
The configuration setting for the will be read once when the first class is constructed. Changes to configuration settings after that time are ignored.
diff --git a/xml/System.Configuration/IriParsingElement.xml b/xml/System.Configuration/IriParsingElement.xml
index e2c211445d4..0ebef16101e 100644
--- a/xml/System.Configuration/IriParsingElement.xml
+++ b/xml/System.Configuration/IriParsingElement.xml
@@ -36,7 +36,6 @@
class has been extended to provide support for International Resource Identifiers (IRI) based on RFC 3987. Users upgrading from .NET Framework 2.0 won't see any change in behavior unless they specifically enable IRI. This ensures application compatibility with prior versions of the .NET Framework.
The configuration setting for the will be read once when the first class is constructed. Changes to configuration settings after that time are ignored.
@@ -127,7 +126,7 @@
configuration setting controls IRI processing in the class. This setting also indirectly controls International Domain Name (IDN) processing set with the class. IRI processing must be enabled for IDN processing to be possible. If IRI processing is disabled, then IDN processing will be set to the default setting where the .NET Framework 2.0 behavior is used for compatibility and IDN names are not used.
+ The configuration setting controls IRI processing in the class. This setting also indirectly controls International Domain Name (IDN) processing set with the class. IRI processing must be enabled for IDN processing to be possible. If IRI processing is disabled, then IDN processing will be set to the default setting where IDN names are not used.
The configuration setting for the will be read once when the first class is constructed. Changes to configuration settings after that time are ignored.
diff --git a/xml/System.Configuration/LocalFileSettingsProvider.xml b/xml/System.Configuration/LocalFileSettingsProvider.xml
index c8680571eea..85750e7079b 100644
--- a/xml/System.Configuration/LocalFileSettingsProvider.xml
+++ b/xml/System.Configuration/LocalFileSettingsProvider.xml
@@ -40,7 +40,7 @@
, which stores configuration data to the local file system. An application settings property or group of properties are associated to a specific settings provider through the use of the .
+ Setting providers define a mechanism for storing configuration data used in the application settings architecture. .NET contains a single default settings provider, , which stores configuration data to the local file system. An application settings property or group of properties are associated to a specific settings provider through the use of the .
Typically, the client program does not explicitly access this class; rather, the application settings architecture automatically invokes the appropriate settings provider when its services are required. For example, many of the members of delegate their work to the associated settings provider.
diff --git a/xml/System.Configuration/ProtectedConfigurationProviderCollection.xml b/xml/System.Configuration/ProtectedConfigurationProviderCollection.xml
index d8153a23acd..013e7c2403b 100644
--- a/xml/System.Configuration/ProtectedConfigurationProviderCollection.xml
+++ b/xml/System.Configuration/ProtectedConfigurationProviderCollection.xml
@@ -40,7 +40,7 @@
You can encrypt sections of a configuration file to protect sensitive information used by your application. This improves security by making unauthorized access difficult, even if an attacker gains access to your configuration file.
- The .NET Framework includes two protected configuration providers that can be used to encrypt sections of a configuration file: the class, which uses the class to encrypt configuration sections, and the class, which uses the Windows Data Protection API (DPAPI) to encrypt configuration sections.
+.NET includes two protected configuration providers that can be used to encrypt sections of a configuration file: the class, which uses the class to encrypt configuration sections, and the class, which uses the Windows Data Protection API (DPAPI) to encrypt configuration sections.
You might have a requirement to encrypt sensitive information using an algorithm other than the RSA or DPAPI providers. In this case, you can build your own custom protected-configuration provider. The class is an abstract base class that you must inherit from to create your own protected-configuration provider.
diff --git a/xml/System.Configuration/RsaProtectedConfigurationProvider.xml b/xml/System.Configuration/RsaProtectedConfigurationProvider.xml
index 10bfcaa9d66..48222589316 100644
--- a/xml/System.Configuration/RsaProtectedConfigurationProvider.xml
+++ b/xml/System.Configuration/RsaProtectedConfigurationProvider.xml
@@ -35,58 +35,11 @@
class gives you a way to encrypt sensitive information stored in a configuration file, which helps protect it from unauthorized access. You use the built-in instance by declaring the provider and making appropriate settings in the configuration file instead of creating an instance of this class, as shown in the Examples section.
-
- The object uses the cryptography functions provided by class to encrypt and decrypt configuration sections.
-
-> [!NOTE]
-> Before ASP.NET can decrypt encrypted information in your configuration file, the identity of your ASP.NET application must have read access to the encryption key used to encrypt and decrypt the configuration data.
-
> [!NOTE]
-> On .NET Core and .NET 5+, the type is not supported. All APIs throw a at run time.
-
-## Examples
-
-The following example shows how to use the standard to protect or unprotect a configuration section.
-
- :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.RsaProtectedConfigurationProvider/CS/RsaProtectedConfigurationProvider.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.RsaProtectedConfigurationProvider/VB/RsaProtectedConfigurationProvider.vb" id="Snippet1":::
-
- The following example shows an excerpt from a configuration file after encryption.
-
-```xml
-
-
-
-
-
-
-
-
-
- Rsa Key
-
-
- B702tRDVHJjC3CYXt7I0ucCDjdht/Vyk/DdUhwQyt7vepSD85dwCP8ox9Y1BUdjajFeTFfFBsGypbli5HPGRYamQdrVkPo07bBBXNT5H02qxREguGUU4iDtV1Xp8BLVZjQMV4ZgP6Wbctw2xRvPC7GvKHLI4fUN/Je5LmutsijA=
-
-
-
-
- ME+XJA2TAj3QN3yT4pJq3sRArC0i7Cz3Da71BkaRe9QNfuVuUjcv0jeGUN4wDdOAZ7LPq6UpVrpirY3kQcALDvPJ5nKxk++Mw75rjtIO8eh2goTY9rCK6zanfzaDshFy7IqItpvs/y2kmij25nM3ury6uO0hCf0UbEL1mbT2jXDqvcrHZUobO1Ef6bygBZ/8HpU+VfF9CTCob/BBE9zUkK37EQhcduwsnzBvDblYbF/Rd+F4lxAkZnecGLfCZjOzJB4xH1a0vvWtPR7zNwL/7I0uHzQjyMdWrkBnotMjoR70R7NELBotCogWO0MBimncKigdR3dTTdrCd72a7UJ4LMlEQaZXGIJp4PIg6qVDHII=
-
-
-
-
-```
+> The type is not supported. All APIs throw a at run time.
]]>
-
-
-
- Cryptographic Services
@@ -116,14 +69,7 @@ The following example shows how to use the standard
Initializes a new instance of the class.
-
- constructor is not intended to be used directly from your code. It is called by the ASP.NET configuration system.
-
- ]]>
-
+ To be added.
diff --git a/xml/System.Configuration/SchemeSettingElement.xml b/xml/System.Configuration/SchemeSettingElement.xml
index 29263d686d0..5bb2614a389 100644
--- a/xml/System.Configuration/SchemeSettingElement.xml
+++ b/xml/System.Configuration/SchemeSettingElement.xml
@@ -46,7 +46,6 @@
- Network Settings Schema
@@ -132,7 +131,6 @@
- Network Settings Schema
@@ -186,7 +184,6 @@
- Network Settings Schema
diff --git a/xml/System.Configuration/SchemeSettingElementCollection.xml b/xml/System.Configuration/SchemeSettingElementCollection.xml
index 2e35ddce74f..27e05b2f9ef 100644
--- a/xml/System.Configuration/SchemeSettingElementCollection.xml
+++ b/xml/System.Configuration/SchemeSettingElementCollection.xml
@@ -66,7 +66,6 @@
- Network Settings Schema
diff --git a/xml/System.Configuration/SectionInformation.xml b/xml/System.Configuration/SectionInformation.xml
index 987a1eaf29e..0a5a87d30b3 100644
--- a/xml/System.Configuration/SectionInformation.xml
+++ b/xml/System.Configuration/SectionInformation.xml
@@ -337,19 +337,13 @@
A implementation can optionally specify a separate file in which the configuration settings for that section are defined. This can be useful in multiple ways:
- Using include files can result in a more logical and modular structure for configuration files.
-
- File-access security and permissions can be used to restrict access to sections of configuration settings.
-
- Settings in an include file that are not used during application initialization can be modified and reloaded without requiring an application restart.
The following example shows how this attribute is used in a configuration file to specify that the `pages` section is defined in an external include file:
``
- If any of the settings in a configuration include file require the application to restart when they are modified, set the property to `true`.
-
- In ASP.NET applications, at run time you can assign to the property the name of an alternative configuration file. In that case, the contents of the file are overwritten by the default connection string information that is contained in the Web.config file. This occurs also when the alternative file does not exist and it is created at run time. If the Web.config file does not contain any connection string information, an empty section is added to the alternative file.
-
]]>
@@ -1223,53 +1217,9 @@ The following example shows how to get the is set to `true`, the `GetSection` methods are restricted by the trust level setting of the application. This means that methods or properties that allow access to configuration section handlers are restricted by the trust level set for the Web application.
> [!NOTE]
-> Because high and full trust are the only levels that allow access to files outside the current application domain, an application can use configuration section handlers only at these trust levels.
-
- When is set to `false`, the access to the configuration data is not restricted by the application's trust level settings.
-
-> [!NOTE]
-> The appropriate file ACL (Access Control List) permissions are still required, regardless of the setting. ACL permissions determine who can access the configuration file.
-
-
-
-## Examples
- The following example shows two possible trust levels for a Web application when the property of the `appSettings` section is `true`.
-
-```xml
-
- // With the following trust value
- // the code below works.
-
-
-
-
- // With the following trust value
- // the code below does not work.
-
-
-```
-
- The following example shows code that runs without errors when the trust level is set to full. Otherwise, the code results in an error.
-
-```csharp
-AppSettingsSection apSection =
- ConfigurationManager.GetSection("appSettings") as AppSettingsSection;
-
-NameValueCollection apSectionCollection =
- ConfigurationManager.AppSettings;
-```
-
-```vb
-Dim apSection As AppSettingsSection = _
- TryCast(ConfigurationManager.GetSection("appSettings"),
- AppSettingsSection)
-
- Dim apSectionCollection As NameValueCollection = _
- ConfigurationManager.AppSettings
-```
+> The appropriate file ACL (Access Control List) permissions are still required, regardless of the setting. ACL permissions determine who can access the configuration file.
]]>
diff --git a/xml/System.Configuration/SettingsProvider.xml b/xml/System.Configuration/SettingsProvider.xml
index 6fbbe8d6b5b..57178ebb688 100644
--- a/xml/System.Configuration/SettingsProvider.xml
+++ b/xml/System.Configuration/SettingsProvider.xml
@@ -36,21 +36,19 @@
, which stores configuration data to the local file system. However, you can create alternate storage mechanisms by deriving from the abstract class. The provider that a wrapper class uses is determined by decorating the wrapper class with the . If this attribute is not provided, the default, , is used.
+ A settings provider defines the mechanism for storing configuration data used in the application settings architecture. .NET contains a single default settings provider, , which stores configuration data to the local file system. However, you can create alternate storage mechanisms by deriving from the abstract class. The provider that a wrapper class uses is determined by decorating the wrapper class with the . If this attribute is not provided, the default, , is used.
When you create a custom settings provider, at minimum, you must provide implementations for the three methods of this class: , and .
For client applications, you can add more standardized functionality to a custom provider by also implementing the interface. This interface mirrors methods found in the class, which mainly enables versioning support.
- Typically, you should design settings providers to be single-instanced to avoid storage resource contention. Providers should also be thread-safe because they can be called simultaneously from multiple wrapper instances in a single application domain or from multiple applications in different domains.
+ Typically, you should design settings providers to be single-instanced to avoid storage resource contention. Providers should also be thread-safe because they can be called simultaneously from multiple wrapper instances or from multiple applications.
At minimum, a settings provider must recognize three attributes - , , and . For a full listing of attributes that can be applied to application settings, see [Application Settings Attributes](/dotnet/desktop/winforms/advanced/application-settings-attributes). A custom setting provider should resolve attributes applied to settings properties in the following manner:
-1. If the provider can fulfill the request implied by the attribute, obviously it should do so.
-
-2. If the provider cannot fulfill the request, it should ignore it silently.
-
-3. If two or more properties conflict; for example, a property being decorated with both and ; the provider should throw a .
+1. If the provider can fulfill the request implied by the attribute, obviously it should do so.
+2. If the provider cannot fulfill the request, it should ignore it silently.
+3. If two or more properties conflict; for example, a property being decorated with both and ; the provider should throw a .
]]>
@@ -98,9 +96,9 @@
Client code typically does not directly instantiate a settings provider; instead, you use the following procedure to find a settings provider for a particular settings property:
-1. Call the method on the current or to return a reference to the current .
+1. Call the method on the current or to return a reference to the current .
-2. Call the method of the retrieved in the first step to return the settings provider.
+2. Call the method of the retrieved in the first step to return the settings provider.
]]>
@@ -242,12 +240,6 @@
## Remarks
contains the method, which is called to persist the values of all of its settings properties. This method enumerates through all the settings providers associated with its settings properties, and calls the method for each to perform the actual serialization operation.
- The method should be implemented with security in mind:
-
-- Only fully trusted code should be allowed to update application settings. Partially trusted code should be allowed to update only user application settings. Untrusted code is not typically allowed to update application settings.
-
-- Usage quotas should be considered to guard against resource attacks by partially trusted applications.
-
]]>
diff --git a/xml/System.Configuration/SettingsSerializeAsAttribute.xml b/xml/System.Configuration/SettingsSerializeAsAttribute.xml
index 49f5baad2ab..221734bd45a 100644
--- a/xml/System.Configuration/SettingsSerializeAsAttribute.xml
+++ b/xml/System.Configuration/SettingsSerializeAsAttribute.xml
@@ -42,7 +42,7 @@
enumeration, and include plain text, XML, and binary serialization. In addition, a provider may optionally support a custom serialization scheme.
+ A settings provider often supports more than one of the standard .NET serialization schemes. These schemes are outlined by the enumeration, and include plain text, XML, and binary serialization. In addition, a provider may optionally support a custom serialization scheme.
With the , you can specify which serialization mechanism should be used for a given application settings class or property. This attribute is considered a request to the settings provider. It may be ignored or cause an error if the provider or the individual property type does not support the specified serialization scheme. If this attribute is not present, the provider will usually provide a default serialization mechanism, most commonly plain text.
diff --git a/xml/System.Configuration/UriSection.xml b/xml/System.Configuration/UriSection.xml
index a35db088c77..0beb82652e1 100644
--- a/xml/System.Configuration/UriSection.xml
+++ b/xml/System.Configuration/UriSection.xml
@@ -37,13 +37,11 @@
class has been extended to provide support for International Resource Identifiers (IRI) and Internationalized Domain Names. Users upgrading from .NET Framework 2.0 won't see any change in behavior unless they specifically enable IRI and IDN. This ensures application compatibility with prior versions of the .NET Framework.
- The configuration settings for IRI and IDN can be retrieved using the class.
+The configuration settings for IRI and IDN can be retrieved using the class.
]]>
- Network Settings Schema
@@ -77,7 +75,6 @@
class has been extended to provide support for International Resource Identifiers (IRI) and Internationalized Domain Names. Users upgrading from .NET Framework 2.0 won't see any change in behavior unless they specifically enable IRI and IDN. This ensures application compatibility with prior versions of the .NET Framework.
The configuration settings for IRI and IDN can be retrieved using the class.
@@ -128,11 +125,10 @@
class has been extended to provide support for International Resource Identifiers (IRI) and Internationalized Domain Names. Users upgrading from .NET Framework 2.0 won't see any change in behavior unless they specifically enable IRI and IDN. This ensures application compatibility with prior versions of the .NET Framework.
The configuration settings for IRI and IDN can be retrieved using the class. The property returns the configuration setting for IDN processing in the class.
- IRI processing must be enabled for IDN processing to be possible. If IRI processing is disabled, then IDN processing will be set to the default setting where the .NET Framework 2.0 behavior is used for compatibility and IDN names are not used.
+ IRI processing must be enabled for IDN processing to be possible. If IRI processing is disabled, then IDN processing will be set to the default setting where IDN names are not used.
The Internationalized Domain Name (IDN) attribute only controls IDN processing. All other IRI processing (character normalization, for example) is performed by default.
@@ -145,7 +141,6 @@
- Network Settings Schema
@@ -189,11 +184,10 @@
class has been extended to provide support for International Resource Identifiers (IRI) and Internationalized Domain Names. Users upgrading from .NET Framework 2.0 won't see any change in behavior unless they specifically enable IRI and IDN. This ensures application compatibility with prior versions of the .NET Framework.
The configuration settings for IRI and IDN can be retrieved using the class. The property returns the configuration setting for IRI parsing in the class.
- IRI processing must be enabled for IDN processing to be possible. If IRI processing is disabled, then IDN processing will be set to the default setting where the .NET Framework 2.0 behavior is used for compatibility and IDN names are not used.
+ IRI processing must be enabled for IDN processing to be possible. If IRI processing is disabled, then IDN processing will be set to the default setting where IDN names are not used.
The Internationalized Domain Name (IDN) attribute only controls IDN processing. All other IRI processing (character normalization, for example) is performed by default.
@@ -206,7 +200,6 @@
- Network Settings Schema
@@ -293,7 +286,6 @@
- Network Settings Schema
diff --git a/xml/System.Diagnostics.Contracts/Contract.xml b/xml/System.Diagnostics.Contracts/Contract.xml
index 0a14e7c567a..f9167cef0c9 100644
--- a/xml/System.Diagnostics.Contracts/Contract.xml
+++ b/xml/System.Diagnostics.Contracts/Contract.xml
@@ -409,7 +409,7 @@
## Remarks
The event information for this event is supplied by the object that is passed to the event handler. This event notifies a managed application environment such as an interactive interpreter or a Web browser host that a contract has failed. Before doing so, it will raise an event that an application can handle as it sees fit. For example, if code is being run in a testing framework, you can log a test failure and then end the test.
- The default implementation of the method in the .NET Framework class library is to call each handler that is registered with the event. Exceptions thrown by handlers are ignored, but each handler can indicate whether the failure is handled by calling the method for the event arguments. If any handler sets the failure as handled, the method returns `null` and no further action is taken. Alternatively, handlers can call the method to instruct the code to unwind. In that case, an exception is thrown after all handlers have executed.
+ The default implementation of the method is to call each handler that is registered with the event. Exceptions thrown by handlers are ignored, but each handler can indicate whether the failure is handled by calling the method for the event arguments. If any handler sets the failure as handled, the method returns `null` and no further action is taken. Alternatively, handlers can call the method to instruct the code to unwind. In that case, an exception is thrown after all handlers have executed.
]]>
diff --git a/xml/System.Diagnostics.Contracts/ContractFailedEventArgs.xml b/xml/System.Diagnostics.Contracts/ContractFailedEventArgs.xml
index 6909de5d01e..e2ae606fa9e 100644
--- a/xml/System.Diagnostics.Contracts/ContractFailedEventArgs.xml
+++ b/xml/System.Diagnostics.Contracts/ContractFailedEventArgs.xml
@@ -53,7 +53,7 @@
object is passed to the event when a contract fails. The event enables a managed application environment such as an interactive interpreter, a Web browser host, a test harness, or a logging infrastructure to be notified of contract failures. The event requires full trust.
+ A object is passed to the event when a contract fails. The event enables a managed application environment such as an interactive interpreter, a Web browser host, a test harness, or a logging infrastructure to be notified of contract failures.
]]>
diff --git a/xml/System.Diagnostics.PerformanceData/CounterData.xml b/xml/System.Diagnostics.PerformanceData/CounterData.xml
index 11eb3056db1..5b2bae231fa 100644
--- a/xml/System.Diagnostics.PerformanceData/CounterData.xml
+++ b/xml/System.Diagnostics.PerformanceData/CounterData.xml
@@ -255,14 +255,9 @@
## Remarks
This property provides safe access to the counter data for multi-threaded applications. If performance is of primary concern, use the property; however, the property is not thread safe.
- Note that the property is not thread safe in .NET Framework 3.5.
-
To increment the counter value, consider using the or method.
-
-
-## Examples
- For an example, see .
+For an example, see .
]]>
diff --git a/xml/System.Diagnostics.Tracing/EventListener.xml b/xml/System.Diagnostics.Tracing/EventListener.xml
index f44784e07ca..8b4329fab5a 100644
--- a/xml/System.Diagnostics.Tracing/EventListener.xml
+++ b/xml/System.Diagnostics.Tracing/EventListener.xml
@@ -61,16 +61,16 @@
object) implementations in the current application domain. When a new event listener is created, it is logically attached to all event sources in that application domain.
+ An event listener represents the target for all events generated by event source ( object) implementations. When a new event listener is created, it is logically attached to all event sources.
> [!NOTE]
-> This type implements the interface. When you have finished using the type, you must dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic.
+> This type implements the interface. When you have finished using the type, you must dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` in C#.
An event listener can enable or disable on a per-current event source basis by using event levels () and event keywords () to further restrict the set of events to be sent to the listener. The listener can also send arbitrary commands to a specific current event source by using the method. The meanings of the commands are specific to the implementation of the event source.
- Multiple event listeners can be defined in a single application domain. Each listener is logically independent of the other listeners so that events that are enabled or disabled by one listener affect only that listener. It is possible for commands sent with the method to do a semantic operation (such as a garbage collection or flushing data) that affects the other listeners, but this is the exception rather than the rule.
+ Multiple event listeners can be defined. Each listener is logically independent of the other listeners so that events that are enabled or disabled by one listener affect only that listener. It is possible for commands sent with the method to do a semantic operation (such as a garbage collection or flushing data) that affects the other listeners, but this is the exception rather than the rule.
- Each event source keeps a list of event listeners that it sends events to. A set of filtering criteria is associated with each event source-listener pair. These criteria determine the events that listener will receive for the current event source. Listeners receive the events on their method. Therefore, subclasses of must override this method to do something useful with the data.
+ Each event source keeps a list of event listeners that it sends events to. A set of filtering criteria is associated with each event source-listener pair. These criteria determine the events that listener will receive for the current event source. Listeners receive the events on their method. Therefore, subclasses of must override this method to do something useful with the data.
When a new event source is created, the method is called. Every current event listener gets exactly one call for every current event source that can send it log messages. When an event listener is created, a series of calls are made to notify the new listener of all the event sources that existed before the listener was created.
@@ -489,7 +489,7 @@
identifies an event source that is suitable for indexing an array. This integer is unique within the application domain. An event listener might find it useful to store additional information about each event source that is connected to it. The value returned by allows this extra information to be efficiently stored in an expandable array such as `List`.
+ The value returned by identifies an event source that is suitable for indexing an array. An event listener might find it useful to store additional information about each event source that is connected to it. The value returned by allows this extra information to be efficiently stored in an expandable array such as `List`.
]]>
diff --git a/xml/System.Diagnostics.Tracing/EventWrittenEventArgs.xml b/xml/System.Diagnostics.Tracing/EventWrittenEventArgs.xml
index e42588c70e8..818b48b7dce 100644
--- a/xml/System.Diagnostics.Tracing/EventWrittenEventArgs.xml
+++ b/xml/System.Diagnostics.Tracing/EventWrittenEventArgs.xml
@@ -469,7 +469,7 @@
System.Int64
- Gets the thread identifier for the OS thread that wrote the event. (.NET Core 2.2 and later only.)
+ Gets the thread identifier for the OS thread that wrote the event.
The thread identifier for the OS thread that wrote the event.
To be added.
@@ -723,7 +723,7 @@
System.DateTime
- Gets the time that the event was originally generated as a timestamp. (.NET Core 2.2 and later only.)
+ Gets the time that the event was originally generated as a timestamp.
The date and time when the event was logged. The system tries to be as precise as possible.
To be added.
diff --git a/xml/System.Diagnostics/BooleanSwitch.xml b/xml/System.Diagnostics/BooleanSwitch.xml
index e79a9d83eaf..dcea3c2b319 100644
--- a/xml/System.Diagnostics/BooleanSwitch.xml
+++ b/xml/System.Diagnostics/BooleanSwitch.xml
@@ -64,40 +64,17 @@
You can create a in your code and set the property directly to instrument a specific section of code.
-For .NET Framework apps only, you can also enable or disable a through the application configuration file and then use the configured value in your application. To configure a , edit the configuration file that corresponds to the name of your application. Within this file, you can add or remove a switch, set a switch's value, or clear all the switches previously set by the application. The configuration file should be formatted like the following example.
+The property of the new switch is set to `false` by default.
-```xml
-
-
-
-
-
-
-
-```
-
- This example configuration section defines a with the property set to `mySwitch` and the value set to `true`. Within your .NET Framework application, you can use the configured switch value by creating a with the same name, as shown in the following code example.
-
- :::code language="csharp" source="~/snippets/csharp/System.Diagnostics/BooleanSwitch/Overview/remarks.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/System.Diagnostics/BooleanSwitch/Overview/remarks.vb" id="Snippet2":::
-
-For .NET Core and .NET 5+ apps, the property of the new switch is set to `false` by default.
-
-For .NET Framework apps, the property is set using the value specified in the configuration file. Configure the switch with a value of 0 to set the property to `false`; configure the switch with a nonzero value to set the property to `true`. If the constructor cannot find initial switch settings in the configuration file, the property of the new switch is set to `false`.
-
- You must enable tracing or debugging to use a switch. The following syntax is compiler specific. If you use compilers other than C# or Visual Basic, refer to the documentation for your compiler.
-
-- To enable debugging in C#, add the `/d:DEBUG` flag to the compiler command line when you compile your code, or you can add `#define DEBUG` to the top of your file. In Visual Basic, add the `/d:DEBUG=True` flag to the compiler command line.
-
-- To enable tracing in C#, add the `/d:TRACE` flag to the compiler command line when you compile your code, or add `#define TRACE` to the top of your file. In Visual Basic, add the `/d:TRACE=True` flag to the compiler command line.
+ You must enable tracing or debugging to use a switch.
> [!NOTE]
-> These debug and trace compiler switches are not required when using the class in isolation. They are only required in conjunction with or methods that are conditionally compiled.
+> These debug and trace compiler switches are not required when using the class in isolation. They are only required in conjunction with or methods that are conditionally compiled.
- For more information on instrumenting your application, see and . For more information about configuring and using trace switches, see [Trace Switches](/dotnet/framework/debug-trace-profile/trace-switches).
+ For more information on instrumenting your application, see and
> [!NOTE]
-> To improve performance, you can make members `static` in your class.
+> To improve performance, you can make members `static` in your class.
## Examples
The following example creates a and uses the switch to determine whether to print an error message. You create the switch at the class level. The `Main` method passes its location to `MyMethod`, which prints an error message and where the error occurred.
@@ -177,25 +154,7 @@ For .NET Framework apps, the pro
, the `displayName` parameter is used to find the initial switch settings for .NET Framework apps in the application configuration file. If the constructor cannot find initial settings, or for .NET Core and .NET 5+ apps, the property is set to `false` (disabled).
-
- To set the level of your in a .NET Framework app, edit the configuration file corresponding to the name of your application. Within this file, you can add a switch and set its value, remove a switch, or clear all switches previously set by the application. The configuration file should be formatted like the following example:
-
-```xml
-
-
-
-
-
-
-
-
-
-
-```
-
-> [!NOTE]
-> The switches you created should be `static`.
+ When you create a , the property is set to `false` (disabled).
## Examples
The following example creates a and uses the switch to determine whether to print an error message. The switch is created at the class level. The `Main` method passes its location to `MyMethod`, which prints an error message and where the error occurred.
diff --git a/xml/System.Diagnostics/ConsoleTraceListener.xml b/xml/System.Diagnostics/ConsoleTraceListener.xml
index 4a880da2ff9..a539d5b9ac0 100644
--- a/xml/System.Diagnostics/ConsoleTraceListener.xml
+++ b/xml/System.Diagnostics/ConsoleTraceListener.xml
@@ -35,7 +35,7 @@
Use the class to write trace and debugging messages to the console. You can initialize a object to write trace messages to the stream or to the stream.
> [!IMPORTANT]
-> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a`try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic.
+> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a`try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` in C#.
When trace and debugging output is enabled, the messages are written to the specified stream, which is similar to the way messages are written with the or methods. In a console application, the output and error streams write messages to the existing console window, or you can redirect the streams to write to a instance.
@@ -47,32 +47,10 @@
> [!NOTE]
> The and classes share the same collection, accessed through their respective `Listeners` properties. If you add a object to the collection using one of these classes, the other class automatically uses the same listener.
- Most compilers enable trace and debug output through conditional compilation flags. If you do not enable tracing or debugging, the messages written through the and classes are effectively ignored. The syntax to enable trace and debug output is compiler specific; if you use compilers other than C# or Visual Basic, refer to the documentation for your compiler.
-
-- To enable debugging in C#, add the **/d:DEBUG**flag to the compiler command line when you compile your code, or you can add **#define DEBUG** to the top of your file. In Visual Basic, add the **/d:DEBUG=True** flag to the compiler command line.
-
-- To enable tracing in C#, add the **/d:TRACE** flag to the compiler command line when you compile your code, or add **#define TRACE** to the top of your file. In Visual Basic, add the **/d:TRACE=True** flag to the compiler command line.
-
- You can add a object to the collection in your code. Or, for .NET Framework apps, you can add a object to the collection through the application configuration file. Add the object in your code to write messages for a specific code section or execution path. Add the object in your application configuration file to direct all trace and debug messages to the console while the application executes.
+ Most compilers enable trace and debug output through conditional compilation flags. If you do not enable tracing or debugging, the messages written through the and classes are effectively ignored.
To write trace and debug messages to the console for a specific section of code, initialize a object and add it to the collection. Instrument the section of code that contains messages using the or classes. At the end of the code section, remove the object from the collection, and call the method on the .
-For .NET Framework apps, to direct all trace and debug messages to the console while the application executes, add a object to the application configuration file. The following example adds a object named `configConsoleListener` to the collection.
-
-```xml
-
-
-
-
-
-
-
-
-
-```
-
- For details about adding trace listeners in the application configuration file, see [\](/dotnet/framework/configure-apps/file-schema/trace-debug/listeners-element-for-trace).
-
## Examples
The following code example implements a console application consisting of a class with two public methods.
diff --git a/xml/System.Diagnostics/Debug.xml b/xml/System.Diagnostics/Debug.xml
index 145341facbe..a08d66a28fb 100644
--- a/xml/System.Diagnostics/Debug.xml
+++ b/xml/System.Diagnostics/Debug.xml
@@ -77,7 +77,7 @@ To make your code more robust without impacting the performance and code size of
-
-
- The and classes provide means to dynamically control the tracing output. For .NET Framework apps, you can modify the values of these switches without recompiling your application. For information on using the configuration file to set a switch in .NET Framework apps, see the class and the [Trace Switches](/dotnet/framework/debug-trace-profile/trace-switches) article.
+ The and classes provide means to dynamically control the tracing output.
You can customize the tracing output's target by adding instances to or removing instances from the collection. The collection is shared by both the and the classes; adding a trace listener to either class adds the listener to both. By default, the class emits trace output.
@@ -86,16 +86,6 @@ To make your code more robust without impacting the performance and code size of
You can modify the level of indentation using the method or the property. To modify the indent spacing, use the property. You can specify whether to automatically flush the output buffer after each write by setting the property to `true`.
-For .NET Framework apps, you can set the and for by editing your app's configuration file. The configuration file should be formatted as shown in the following example.
-
-```xml
-
-
-
-
-
-```
-
The attribute is applied to the methods of . Compilers that support ignore calls to these methods unless `DEBUG` is defined as a conditional compilation symbol. Refer to a compiler's documentation to determine whether is supported and the syntax for defining a conditional compilation symbol.
> [!NOTE]
@@ -211,20 +201,7 @@ The following example uses to indicate the begin
When the application runs in user interface mode, it displays a message box that shows the call stack with file and line numbers. The message box contains three buttons: **Abort**, **Retry**, and **Ignore**. Clicking the **Abort** button terminates the application. Clicking **Retry** sends you to the code in the debugger if your application is running in a debugger, or offers to open a debugger if it is not. Clicking **Ignore** continues with the next instruction in the code.
> [!NOTE]
-> Windows 8.x apps do not support modal dialog boxes, so they behave the same in user interface mode and non-user interface mode. The message is written to the active trace listeners in debugging mode, or no message is written in release mode.
-
-> [!NOTE]
-> The display of the message box depends on the presence of the . If the is not in the collection, the message box is not displayed. The can be removed by calling the method on the property (`System.Diagnostics.Trace.Listeners.Clear()`). For .NET Framework apps, you can also use the [\ element](/dotnet/framework/configure-apps/file-schema/trace-debug/clear-element-for-listeners-for-trace) and the [\ element](/dotnet/framework/configure-apps/file-schema/trace-debug/remove-element-for-listeners-for-trace) in your app's configuration file.
-
-For .NET Framework apps, you can change the behavior of the in the configuration file that corresponds to the name of your application. In this file, you can enable and disable the assert message box or set the property. The configuration file should be formatted as follows:
-
-```xml
-
-
-
-
-
-```
+> The display of the message box depends on the presence of the . If the is not in the collection, the message box is not displayed. The can be removed by calling the method on the property (`System.Diagnostics.Trace.Listeners.Clear()`).
## Examples
@@ -313,17 +290,8 @@ This overload was introduced in .NET 6 to improve performance. In comparison to
When the application runs in user interface mode, it displays a message box that shows the call stack with file and line numbers. The message box contains three buttons: **Abort**, **Retry**, and **Ignore**. Clicking the **Abort** button terminates the application. Clicking **Retry** sends you to the code in the debugger if your application is running in a debugger, or offers to open a debugger if it is not. Clicking **Ignore** continues with the next instruction in the code.
> [!NOTE]
-> The display of the message box depends on the presence of the . If the is not in the collection, the message box is not displayed. The can be removed by calling the method on the property (`System.Diagnostics.Trace.Listeners.Clear()`). For .NET Framework apps, you can also use the [\ element](/dotnet/framework/configure-apps/file-schema/trace-debug/clear-element-for-listeners-for-trace) and the [\ element](/dotnet/framework/configure-apps/file-schema/trace-debug/remove-element-for-listeners-for-trace) in your app's configuration file.
+> The display of the message box depends on the presence of the . If the is not in the collection, the message box is not displayed. The can be removed by calling the method on the property (`System.Diagnostics.Trace.Listeners.Clear()`).
-For .NET Framework apps, you can change the behavior of the in the configuration file that corresponds to the name of your application. In this file, you can enable and disable the assert message box or set the property. The configuration file should be formatted as follows:
-
-```xml
-
-
-
-
-
-```
]]>
@@ -419,17 +387,7 @@ For .NET Framework apps, you can change the behavior of the [!NOTE]
-> The display of the message box depends on the presence of the . If the is not in the collection, the message box is not displayed. The can be removed by calling the method on the property (`System.Diagnostics.Trace.Listeners.Clear()`). For .NET Framework apps, you can also use the [\ element](/dotnet/framework/configure-apps/file-schema/trace-debug/clear-element-for-listeners-for-trace) and the [\ element](/dotnet/framework/configure-apps/file-schema/trace-debug/remove-element-for-listeners-for-trace) in your app's configuration file.
-
-For .NET Framework apps, you can change the behavior of the in the configuration file that corresponds to the name of your application. In this file, you can enable and disable the assert message box or set the property. The configuration file should be formatted as follows:
-
-```xml
-
-
-
-
-
-```
+> The display of the message box depends on the presence of the . If the is not in the collection, the message box is not displayed. The can be removed by calling the method on the property (`System.Diagnostics.Trace.Listeners.Clear()`).
## Examples
@@ -527,17 +485,8 @@ This overload was introduced in .NET 6 to improve performance. In comparison to
When the application runs in user interface mode, it displays a message box that shows the call stack with file and line numbers. The message box contains three buttons: **Abort**, **Retry**, and **Ignore**. Clicking the **Abort** button terminates the application. Clicking **Retry** sends you to the code in the debugger if your application is running in a debugger, or offers to open a debugger if it is not. Clicking **Ignore** continues with the next instruction in the code.
> [!NOTE]
-> The display of the message box depends on the presence of the . If the is not in the collection, the message box is not displayed. The can be removed by calling the method on the property (`System.Diagnostics.Trace.Listeners.Clear()`). For .NET Framework apps, you can also use the [\ element](/dotnet/framework/configure-apps/file-schema/trace-debug/clear-element-for-listeners-for-trace) and the [\ element](/dotnet/framework/configure-apps/file-schema/trace-debug/remove-element-for-listeners-for-trace) in your app's configuration file.
-
-For .NET Framework apps, you can change the behavior of the in the configuration file that corresponds to the name of your application. In this file, you can enable and disable the assert message box or set the property. The configuration file should be formatted as follows:
+> The display of the message box depends on the presence of the . If the is not in the collection, the message box is not displayed. The can be removed by calling the method on the property (`System.Diagnostics.Trace.Listeners.Clear()`).
-```xml
-
-
-
-
-
-```
]]>
@@ -625,17 +574,7 @@ For .NET Framework apps, you can change the behavior of the [!NOTE]
-> The display of the message box depends on the presence of the . If the is not in the collection, the message box is not displayed. The can be removed by calling the method on the property (`System.Diagnostics.Trace.Listeners.Clear()`). For .NET Framework apps, you can also use the [\ element](/dotnet/framework/configure-apps/file-schema/trace-debug/clear-element-for-listeners-for-trace) and the [\ element](/dotnet/framework/configure-apps/file-schema/trace-debug/remove-element-for-listeners-for-trace) in your app's configuration file.
-
-For .NET Framework apps, you can change the behavior of the in the configuration file that corresponds to the name of your application. In this file, you can enable and disable the assert message box or set the property. The configuration file should be formatted as follows:
-
-```xml
-
-
-
-
-
-```
+> The display of the message box depends on the presence of the . If the is not in the collection, the message box is not displayed. The can be removed by calling the method on the property (`System.Diagnostics.Trace.Listeners.Clear()`).
## Examples
@@ -758,17 +697,7 @@ The following example checks whether the `type` parameter is valid. If `type` is
When the application runs in user interface mode, it displays a message box that shows the call stack with file and line numbers. The message box contains three buttons: **Abort**, **Retry**, and **Ignore**. Clicking the **Abort** button terminates the application. Clicking **Retry** sends you to the code in the debugger if your application is running in a debugger, or offers to open a debugger if it is not. Clicking **Ignore** continues with the next instruction in the code.
> [!NOTE]
-> The display of the message box is dependent on the presence of the . If the is not in the collection, the message box is not displayed. The can be removed by calling the method on the property (`System.Diagnostics.Trace.Listeners.Clear()`). For .NET Framework apps, you can also use the [\ element](/dotnet/framework/configure-apps/file-schema/trace-debug/clear-element-for-listeners-for-trace) and the [\ element](/dotnet/framework/configure-apps/file-schema/trace-debug/remove-element-for-listeners-for-trace) in your app's configuration file.
-
-For .NET Framework apps, you can change the behavior of the in the configuration file that corresponds to the name of your application. In this file, you can enable and disable the assert message box or set the property. The configuration file should be formatted as follows:
-
-```xml
-
-
-
-
-
-```
+> The display of the message box is dependent on the presence of the . If the is not in the collection, the message box is not displayed. The can be removed by calling the method on the property (`System.Diagnostics.Trace.Listeners.Clear()`).
]]>
@@ -825,16 +754,6 @@ For .NET Framework apps, you can change the behavior of the or . Setting to `true` means that data will be flushed from the buffer to the stream, but the encoder state will not be flushed. This allows the encoder to keep its state (partial characters) so that it can encode the next block of characters correctly. This scenario affects UTF8 and UTF7 where certain characters can only be encoded after the encoder receives the adjacent character or characters.
-For .NET Framework apps, you can also set the and properties for by editing the configuration file corresponding to the name of your application. The configuration file should be formatted as shown in the following example.
-
-```xml
-
-
-
-
-
-```
-
]]>
@@ -996,12 +915,10 @@ The following example creates a outputs the message to a message box when the application is running in user interface mode and to the instances in the collection.
> [!NOTE]
-> The display of the message box is dependent on the presence of the . If the is not in the collection, the message box is not displayed. The can be removed by the [<clear>](/dotnet/framework/configure-apps/file-schema/trace-debug/clear-element-for-listeners-for-trace), the [<remove>](/dotnet/framework/configure-apps/file-schema/trace-debug/remove-element-for-listeners-for-trace), or by calling the method on the property (`System.Diagnostics.Trace.Listeners.Clear()`).
+> The display of the message box is dependent on the presence of the . If the is not in the collection, the message box is not displayed. The can be removed by calling the method on the property (`System.Diagnostics.Trace.Listeners.Clear()`).
You can customize this behavior by adding a to, or removing one from, the collection.
-
-
## Examples
The following example uses the method to print a message during exception handling.
@@ -1092,12 +1009,10 @@ The following example uses the method to p
The default behavior is that the outputs the message to a message box when the application is running in user interface mode and to the instances in the collection.
> [!NOTE]
-> The display of the message box is dependent on the presence of the . If the is not in the collection, the message box is not displayed. The can be removed by the [<clear>](/dotnet/framework/configure-apps/file-schema/trace-debug/clear-element-for-listeners-for-trace), the [<remove>](/dotnet/framework/configure-apps/file-schema/trace-debug/remove-element-for-listeners-for-trace), or by calling the method on the property (`System.Diagnostics.Trace.Listeners.Clear()`).
+> The display of the message box is dependent on the presence of the . If the is not in the collection, the message box is not displayed. The can be removed by calling the method on the property (`System.Diagnostics.Trace.Listeners.Clear()`).
You can customize this behavior by adding a to, or removing one from, the collection.
-
-
## Examples
The following example uses the method to print a message during exception handling.
@@ -1397,16 +1312,6 @@ End of list of errors
## Remarks
A interprets this number as spaces. An ignores this value.
-For .NET Framework apps, you can also set the and properties for by editing the configuration file corresponding to the name of your application. The configuration file should be formatted as shown in the following example.
-
-```xml
-
-
-
-
-
-```
-
]]>
diff --git a/xml/System.Diagnostics/DebuggableAttribute+DebuggingModes.xml b/xml/System.Diagnostics/DebuggableAttribute+DebuggingModes.xml
index 082c2a6af74..24308f1a122 100644
--- a/xml/System.Diagnostics/DebuggableAttribute+DebuggingModes.xml
+++ b/xml/System.Diagnostics/DebuggableAttribute+DebuggingModes.xml
@@ -54,23 +54,23 @@
Specifies the debugging mode for the just-in-time (JIT) compiler.
- enumeration specifies how the runtime is to track information important to the debugger during code generation. This information helps the debugger provide a rich debugging experience. Unlike the .NET Framework version 1.1, versions 2.0 or later do not allow you to turn off tracking by the just-in-time (JIT) compiler. JIT tracking is always enabled for debuggable files. In version 2.0 and later, the enumeration values have the following effect.
-
-|Debugging mode|Result|
-|--------------------|------------|
-|None|Tracking on, JIT optimizations enabled|
-|Default|Tracking on, JIT optimizations enabled|
-|DisableOptimizations|Tracking on, JIT optimizations enabled|
-|Default | DisableOptimizations|Tracking on, JIT optimizations disabled|
-
- Sequence points are used to indicate locations in the Microsoft intermediate language (MSIL) code that a debugger user expects to be able to refer to uniquely, such as for setting a breakpoint. The JIT compiler ensures it does not compile the MSIL at two different sequence points into a single native instruction. By default, the JIT compiler examines the symbol store in the program database (PDB) file for a list of additional sequence points. However, loading the PDB file requires that the file be available and has a negative performance impact. Starting with version 2.0, compilers can emit "implicit sequence points" in the MSIL code stream through the use of MSIL "`nop"` instructions. Such compilers should set the `IgnoreSymbolStoreSequencePoints` flag to notify the common language runtime to not load the PDB file.
-
+ enumeration specifies how the runtime is to track information important to the debugger during code generation. This information helps the debugger provide a rich debugging experience. You can't turn off tracking by the just-in-time (JIT) compiler. JIT tracking is always enabled for debuggable files. The enumeration values have the following effects:
+
+| Debugging mode | Result |
+|---------------------------------------|-----------------------------------------|
+| `None` | Tracking on, JIT optimizations enabled |
+| `Default` | Tracking on, JIT optimizations enabled |
+| `DisableOptimizations` | Tracking on, JIT optimizations enabled |
+| `Default | DisableOptimizations` | Tracking on, JIT optimizations disabled |
+
+ Sequence points are used to indicate locations in the Microsoft intermediate language (MSIL) code that a debugger user expects to be able to refer to uniquely, such as for setting a breakpoint. The JIT compiler ensures it does not compile the MSIL at two different sequence points into a single native instruction. By default, the JIT compiler examines the symbol store in the program database (PDB) file for a list of additional sequence points. However, loading the PDB file requires that the file be available and has a negative performance impact. Starting with version 2.0, compilers can emit "implicit sequence points" in the MSIL code stream through the use of MSIL "`nop"` instructions. Such compilers should set the `IgnoreSymbolStoreSequencePoints` flag to notify the common language runtime to not load the PDB file.
+
> [!NOTE]
-> This enumeration is primarily used by language developers. It is generally not used in application development. Development environments use based on compiler parameters such as **/debug** and **/optimize**.
-
+> This enumeration is primarily used by language developers. It is generally not used in application development. Development environments use based on compiler parameters such as **/debug** and **/optimize**.
+
]]>
@@ -113,7 +113,7 @@
1
- Instructs the just-in-time (JIT) compiler to use its default behavior, which includes enabling optimizations, disabling Edit and Continue support, and using symbol store sequence points if present. Starting with the .NET Framework version 2.0, JIT tracking information, the Microsoft intermediate language (MSIL) offset to the native-code offset within a method, is always generated.
+ Instructs the just-in-time (JIT) compiler to use its default behavior, which includes enabling optimizations, disabling Edit and Continue support, and using symbol store sequence points if present. JIT tracking information is always generated.
@@ -277,9 +277,9 @@
0
- Starting with the .NET Framework version 2.0, JIT tracking information is always generated, and this flag has the same effect as , except that it sets the property to . However, because JIT tracking is always enabled, the property value is ignored in version 2.0 or later.
-
- Note that, unlike the flag, the flag cannot be used to disable JIT optimizations.
+ JIT tracking information is always generated, so this flag has the same effect as , except that it sets the property to . However, because JIT tracking is always enabled, the property value is ignored.
+
+Unlike the flag, the flag cannot be used to disable JIT optimizations.
diff --git a/xml/System.Diagnostics/DebuggableAttribute.xml b/xml/System.Diagnostics/DebuggableAttribute.xml
index 66c93f8928c..551c4d454dd 100644
--- a/xml/System.Diagnostics/DebuggableAttribute.xml
+++ b/xml/System.Diagnostics/DebuggableAttribute.xml
@@ -182,7 +182,7 @@
## Remarks
This constructor sets the properties and .
- An `isJITTrackingEnabled` parameter value of `true` causes the runtime to track information important to the debugger during code generation; a value of `false` results in no tracking, but does not prevent debugging. This parameter has no effect in the .NET Framework version 2.0. In version 2.0, JIT tracking information, the Microsoft intermediate language (MSIL) offset to the native-code offset within a method, is always generated.
+The `isJITTrackingEnabled` parameter has no effect. JIT tracking information, that is, the Microsoft intermediate language (MSIL) offset to the native-code offset within a method, is always generated.
An `isJITOptimizerDisabled` parameter value of `true` optimizes for debugging; a value of `false` optimizes for execution.
@@ -328,19 +328,7 @@
Gets a value that indicates whether the runtime will track information during code generation for the debugger.
if the runtime will track information during code generation for the debugger; otherwise, .
-
- controls whether the runtime tracks information important to the debugger during code generation. This information helps the debugger provide a rich debugging experience.
-
- Starting in .NET Framework 2.0, JIT tracking information is always enabled during debugging, and this property value is ignored.
-
-> [!NOTE]
-> This property does not control the ability to debug, but tells the just-in-time (JIT) compiler to generate tracking information. Specifically, the compiler tracks the Microsoft Intermediate Language (MSIL)-offset to the native-code offset within a method.
-
- ]]>
-
+ JIT tracking information is always enabled during debugging, and this property value is ignored.
diff --git a/xml/System.Diagnostics/Debugger.xml b/xml/System.Diagnostics/Debugger.xml
index 6f29a31d91e..26c1c4e28d5 100644
--- a/xml/System.Diagnostics/Debugger.xml
+++ b/xml/System.Diagnostics/Debugger.xml
@@ -114,15 +114,14 @@
[!WARNING]
-> Starting with .NET Framework 4, the runtime no longer exercises tight control of launching the debugger for the method, but instead reports an error to the Windows Error Reporting (WER) subsystem. WER provides many settings to customize the problem reporting experience, so a lot of factors will influence the way WER responds to an error such as operating system version, process, session, user, machine and domain. If you're having unexpected results when calling the method, check the WER settings on your machine. For more information on how to customize WER, see [WER Settings](/windows/win32/wer/wer-settings). If you want to ensure the debugger is launched regardless of the WER settings, be sure to call the method instead.
-
+ If no debugger is attached, users are asked if they want to attach a debugger. If they choose yes, the debugger is started. If a debugger is attached, the debugger is signaled with a user breakpoint event, and the debugger suspends execution of the process just as if a debugger breakpoint had been hit.
+> [!TIP]
+> On Windows, the runtime reports an error to the Windows Error Reporting (WER) subsystem when this method is called. WER provides many settings to customize the problem reporting experience, so a lot of factors will influence the way WER responds to an error, such as operating system version, process, session, user, machine, and domain. If you're having unexpected results when calling the method, check the [WER settings](/windows/win32/wer/wer-settings). If you want to ensure the debugger is launched regardless of the WER settings, call the method instead.
## Examples
- The following code example demonstrates how to stop the debugger at the call to .
+
+The following code example demonstrates how to stop the debugger at the call to .
```vb
Debugger.Break()
diff --git a/xml/System.Diagnostics/DebuggerBrowsableAttribute.xml b/xml/System.Diagnostics/DebuggerBrowsableAttribute.xml
index 2d60201de80..82f867a348b 100644
--- a/xml/System.Diagnostics/DebuggerBrowsableAttribute.xml
+++ b/xml/System.Diagnostics/DebuggerBrowsableAttribute.xml
@@ -67,18 +67,13 @@
## Remarks
-> [!NOTE]
-> In .NET Framework version 2.0, the class is not supported by Visual Basic. Using C#, you can add expansions for custom data using the , , and . Visual Basic supports the attribute but not the attribute.
+This attribute can be applied only as a single instance to properties and fields. It cannot be applied to assemblies.
- This attribute can be applied only as a single instance to properties and fields. It cannot be applied to assemblies.
+The constructor for this attribute takes one of the enumeration values, which specifies one of the following states:
- The constructor for this attribute takes one of the enumeration values, which specifies one of the following states:
-
-- indicates that the member is not displayed in the data window. For example, using this value for the on a field removes the field from the hierarchy; the field is not displayed when you expand the enclosing type by clicking the plus sign (+) for the type instance.
-
-- indicates that the member is displayed but not expanded by default. This is the default behavior.
-
-- indicates that the member itself is not shown, but its constituent objects are displayed if it is an array or collection.
+- indicates that the member is not displayed in the data window. For example, using this value for the on a field removes the field from the hierarchy; the field is not displayed when you expand the enclosing type by clicking the plus sign (+) for the type instance.
+- indicates that the member is displayed but not expanded by default. This is the default behavior.
+- indicates that the member itself is not shown, but its constituent objects are displayed if it is an array or collection.
For an example of the use of this attribute and the and attributes, see the example provided for the class.
diff --git a/xml/System.Diagnostics/DefaultTraceListener.xml b/xml/System.Diagnostics/DefaultTraceListener.xml
index cfc4ddbbb4a..ae7c1f60484 100644
--- a/xml/System.Diagnostics/DefaultTraceListener.xml
+++ b/xml/System.Diagnostics/DefaultTraceListener.xml
@@ -63,28 +63,9 @@
The method, by default, displays a message box when the application is running in a user interface mode; it also emits the message using .
> [!NOTE]
-> The display of the message box for and method calls depends on the presence of the . If the is not in the collection, the message box is not displayed. The can be removed by calling the method on the property (`System.Diagnostics.Trace.Listeners.Clear()`). For .NET Framework apps, you can also use the [\ element](/dotnet/framework/configure-apps/file-schema/trace-debug/clear-element-for-listeners-for-trace) and the [\ element](/dotnet/framework/configure-apps/file-schema/trace-debug/remove-element-for-listeners-for-trace) in your app's configuration file.
+> The display of the message box for and method calls depends on the presence of the . If the is not in the collection, the message box is not displayed. The can be removed by calling the method on the property (`System.Diagnostics.Trace.Listeners.Clear()`).
- You must enable tracing or debugging to use a trace listener. The following syntax is compiler specific. If you use compilers other than C# or Visual Basic, refer to the documentation for your compiler.
-
-- To enable debugging in C#, add the `/d:DEBUG` flag to the compiler command line when you compile your code, or add `#define DEBUG` to the top of your file. In Visual Basic, add the `/d:DEBUG=True` flag to the compiler command line.
-
-- To enable tracing in C#, add the `/d:TRACE` flag to the compiler command line when you compile your code, or add `#define TRACE` to the top of your file. In Visual Basic, add the `/d:TRACE=True` flag to the compiler command line.
-
-For .NET Framework apps, you can add a trace listener by editing the configuration file that corresponds to the name of your application. Within this file, you can add a listener, set its type and set its parameters, remove a listener, or clear all the listeners previously set by the application. The configuration file should be formatted similar to the following example:
-
-```xml
-
-
-
-
-
-
-
-
-
-
-```
+ You must enable tracing or debugging to use a trace listener.
## Examples
The following code example calculates binomial coefficients, which are values used in probability and statistics. This example uses a to trace results and log errors. It creates a new , adds it to the collection, and sets the property to the log file specified in the command-line arguments.
diff --git a/xml/System.Diagnostics/DelimitedListTraceListener.xml b/xml/System.Diagnostics/DelimitedListTraceListener.xml
index 2baa3af3ec1..2f76a8b3e15 100644
--- a/xml/System.Diagnostics/DelimitedListTraceListener.xml
+++ b/xml/System.Diagnostics/DelimitedListTraceListener.xml
@@ -58,31 +58,11 @@
The trace output is in a delimited text format that uses the delimiter specified by the property. The delimiter is used to terminate each field in a line of output. For example, to display the trace output in a Microsoft Excel spreadsheet, you might specify a comma (",") as a delimiter and create a comma-separated value (CSV) file.
> [!IMPORTANT]
-> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a`try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic.
-
-You can create a in your code. Alternatively, in .NET Framework apps only, you can enable or disable a through the application configuration file and then use the configured in your application.
+> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface docs.
> [!NOTE]
> The delimits only text that is emitted by using the methods that have names starting with the word `Trace`, such as or . Trace data that is emitted by using the and methods is not delimited.
-To configure a in a .NET Framework app, edit the configuration file that corresponds to the name of your application. In this file, you can add a listener, set the properties for a listener, or remove a listener. The configuration file should be formatted as shown in the following example:
-
-```xml
-
-
-
-
-
-
-
-
-
-```
-
> [!NOTE]
> If you try to write to a file that is in use or unavailable, the file name is automatically prefixed by a GUID.
@@ -487,35 +467,7 @@ To configure a in a .NET Fr
Gets or sets the delimiter for the delimited list.
The delimiter for the delimited list.
-
- property using the `delimiter` attribute in a configuration file for a .NET Framework app:
-
-```xml
-
-
-
-
-
-
-
-
-
-
-
-```
-
- ]]>
-
+ The default delimiter is ";" (semicolon).
is set to .
@@ -564,27 +516,7 @@ The following configuration file example shows how to set the
is used to set the property.
-
-The following .NET Framework application configuration file example shows the use of the `delimiter` attribute to set the property:
-
-```xml
-
-
-
-
-
-
-
-
-
-
-```
+A custom attribute is an attribute that is not inherited from the base class that can be used to set a property for the class. The custom attribute for is used to set the property.
]]>
diff --git a/xml/System.Diagnostics/EventLog.xml b/xml/System.Diagnostics/EventLog.xml
index de57ab20c38..4d77ccefa9d 100644
--- a/xml/System.Diagnostics/EventLog.xml
+++ b/xml/System.Diagnostics/EventLog.xml
@@ -54,15 +54,13 @@
lets you access or customize Windows event logs, which record information about important software or hardware events. Using , you can read from existing logs, write entries to logs, create or delete event sources, delete logs, and respond to log entries. You can also create new logs when creating an event source.
> [!IMPORTANT]
-> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic.
+> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic.
In addition to providing access to individual event logs and their entries, the class lets you access the collection of all event logs. You can use the `static` members of to delete logs, get log lists, create or delete a source, or determine if a computer already contains a particular source.
There are three default event logs: Application, System, and Security. A Security log is read-only. Other applications and services you install, such as Active Directory, might have additional event logs.
- There are security considerations when using the class. requires permissions for specific actions. We recommend that not be granted to partially trusted code. You should never pass any event log object, including and objects, to less trusted code. For example, creating an object, writing an entry, and then passing the object to partially trusted code can create a security issue, because the ability to read and write to the event log allows code to perform actions such as issuing event log messages in the name of another application.
-
- Starting with Windows Vista, User Account Control (UAC) determines the credentials of a user. If you are a member of the Built-in Administrators group, you are assigned two run-time access tokens: a standard user access token and an administrator access token. By default, you are in the standard user role. To run the code that accesses the Security log, you must first elevate your credentials from standard user to administrator. You can do this when you start an application by opening the shortcut menu for the application (if you're using a mouse, right-click the application icon) and indicating that you want to run as an administrator.
+On Windows, User Account Control (UAC) determines the credentials of a user. If you are a member of the Built-in Administrators group, you are assigned two run-time access tokens: a standard user access token and an administrator access token. By default, you are in the standard user role. To run the code that accesses the Security log, you must first elevate your credentials from standard user to administrator. You can do this when you start an application by opening the shortcut menu for the application (if you're using a mouse, right-click the application icon) and indicating that you want to run as an administrator.
You can use to create custom event logs that you can view through the server's Event Viewer. Use the method to display a localized name for your event log in the Event Viewer. Use the method to configure the behavior of your event log when it reaches its maximum log size.
@@ -72,15 +70,15 @@
If the event source for the event log associated with the instance doesn't exist, a new event source is created. To create an event source in Windows Vista and later or Windows Server 2003, you must have administrative credentials.
- This requirement is because all event logs, including Security logs, must be searched to determine whether the event source is unique. Starting with Windows Vista, users do not have permission to access the Security log; therefore, a is thrown.
+ This requirement is because all event logs, including Security logs, must be searched to determine whether the event source is unique. Users don't have permission to access the Security log; therefore, a is thrown.
> [!IMPORTANT]
-> Creating or deleting an event source requires synchronization of the underlying code by using a named mutex. If a highly privileged application locks the named mutex, trying to create or delete an event source causes the application to stop responding until the lock is released. To help prevent this problem, never grant permission to untrusted code. In addition, permission potentially allows other permissions to be bypassed and should only be granted to highly trusted code.
+> Creating or deleting an event source requires synchronization of the underlying code by using a named mutex. If a highly privileged application locks the named mutex, trying to create or delete an event source causes the application to stop responding until the lock is released. To help prevent this problem, never grant permission to untrusted code. In addition, permission potentially allows other permissions to be bypassed and should only be granted to highly trusted code.
Applications and services should write to the Application log or to a custom log. Device drivers should write to the System log. If you do not explicitly set the property, the event log defaults to the Application log.
> [!NOTE]
-> There is nothing to protect an application from writing as any registered source. If an application is granted permission, it can write events for any valid source registered on the computer.
+> There is nothing to protect an application from writing as any registered source. If an application is granted permission, it can write events for any valid source registered on the computer.
Use the and methods to write events to an event log. You must specify an event source to write events; you must create and configure the event source before writing the first entry with the source.
@@ -95,18 +93,14 @@
When writing events, you must at least specify either a message string or the resource identifier for a message string. Other event properties are optional. Examples of optional event settings include the following:
- You can set the to specify the icon that the Event Viewer displays for the entry.
-
- You can specify a category identifier for the event, if your application uses categories for filtering the events.
-
- You can attach binary data to your event entry if you want to associate additional information with a given event.
> [!IMPORTANT]
-> Event logging consumes disk space, processor time, and other system resources. It is important to log only essential information. We recommend that you place event log calls in an error path, rather than in the main code path, so they don't adversely affect performance.
+> Event logging consumes disk space, processor time, and other system resources. It is important to log only essential information. We recommend that you place event log calls in an error path, rather than in the main code path, so they don't adversely affect performance.
For a list of initial property values for an instance of , see the constructor.
-
-
## Examples
The following example creates the event source `MySource` if it doesn't already exist, and writes an entry to the event log `MyNewLog`.
@@ -167,7 +161,7 @@
Before calling , specify the property of the instance. If you are only reading from the log, you can alternatively specify only the and properties.
> [!NOTE]
-> If you do not specify a , the local computer (".") is assumed.
+> If you do not specify a , the local computer (".") is assumed.
The following table shows initial property values for an instance of .
@@ -235,7 +229,7 @@
This overload sets the property to the `logName` parameter. Before calling , specify the property of the instance. If you are only reading from the log, you can alternatively specify only the and properties.
> [!NOTE]
-> If you do not specify a , the local computer (".") is assumed. This overload of the constructor specifies the property, but you can change this before reading the property.
+> If you do not specify a , the local computer (".") is assumed. This overload of the constructor specifies the property, but you can change this before reading the property.
If the source you specify in the property is unique from other sources on the computer, a subsequent call to creates a log with the specified name, if it does not already exist.
@@ -309,7 +303,7 @@
This overload sets the property to the `logName` parameter and the property to the `machineName` parameter. Before calling , specify the property of the . If you are only reading from the log, you can alternatively specify only the and properties.
> [!NOTE]
-> This overload of the constructor specifies the and properties, but you can change either before reading the property.
+> This overload of the constructor specifies the and properties, but you can change either before reading the property.
The following table shows initial property values for an instance of .
@@ -513,7 +507,7 @@
The following example clears an event log.
> [!CAUTION]
-> Because Application, System, Security, and other non-custom logs can contain crucial information; be sure to specify a custom log before executing this example code. This example deletes the custom log `myNewLog`.
+> Because Application, System, Security, and other non-custom logs can contain crucial information; be sure to specify a custom log before executing this example code. This example deletes the custom log `myNewLog`.
:::code language="csharp" source="~/snippets/csharp/System.Diagnostics/EventLog/Clear/source.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/System.Diagnostics/EventLog/Clear/source.vb" id="Snippet1":::
@@ -628,11 +622,11 @@
The method uses the input `sourceData` , and properties to create registry values on the target computer for the new source and its associated event log. A new source name cannot match an existing source name or an existing event log name on the target computer. If the property is not set, the source is registered for the Application event log. If the is not set, the source is registered on the local computer.
> [!NOTE]
-> To create an event source in Windows Vista and later or Windows Server 2003, you must have administrative privileges.
+> To create an event source in Windows Vista and later or Windows Server 2003, you must have administrative privileges.
>
-> The reason for this requirement is that all event logs, including security, must be searched to determine whether the event source is unique. Starting with Windows Vista, users do not have permission to access the security log; therefore, a is thrown.
+> The reason for this requirement is that all event logs, including security, must be searched to determine whether the event source is unique. Starting with Windows Vista, users do not have permission to access the security log; therefore, a is thrown.
>
-> Starting with Windows Vista, User Account Control (UAC) determines the privileges of a user. If you are a member of the Built-in Administrators group, you are assigned two run-time access tokens: a standard user access token and an administrator access token. By default, you are in the standard user role. To execute the code that accesses the security log, you must first elevate your privileges from standard user to administrator. You can do this when you start an application by right-clicking the application icon and indicating that you want to run as an administrator.
+> Starting with Windows Vista, User Account Control (UAC) determines the privileges of a user. If you are a member of the Built-in Administrators group, you are assigned two run-time access tokens: a standard user access token and an administrator access token. By default, you are in the standard user role. To execute the code that accesses the security log, you must first elevate your privileges from standard user to administrator. You can do this when you start an application by right-clicking the application icon and indicating that you want to run as an administrator.
Use and to write events to an event log. You must specify an event source to write events; you must create and configure the event source before writing the first entry with the source.
@@ -651,7 +645,7 @@
To change the configuration details of an existing source, you must delete the source and then create it with the new configuration. If other applications or components use the existing source, create a new source with the updated configuration rather than deleting the existing source.
> [!NOTE]
-> If a source is configured for an event log, and you reconfigure it for another event log, you must restart the computer for the changes to take effect.
+> If a source is configured for an event log, and you reconfigure it for another event log, you must restart the computer for the changes to take effect.
@@ -864,16 +858,16 @@ SVC_UPDATE.EXE
If `logName` is `null` or an empty string ("") when you call , the log defaults to the Application log. If the log does not exist on the local computer, the system creates a custom log and registers your application as a for that log.
> [!NOTE]
-> To create an event source in Windows Vista and later or Windows Server 2003, you must have administrative privileges.
+> To create an event source in Windows Vista and later or Windows Server 2003, you must have administrative privileges.
>
-> The reason for this requirement is that all event logs, including security, must be searched to determine whether the event source is unique. Starting with Windows Vista, users do not have permission to access the security log; therefore, a is thrown.
+> The reason for this requirement is that all event logs, including security, must be searched to determine whether the event source is unique. Starting with Windows Vista, users do not have permission to access the security log; therefore, a is thrown.
>
-> In Windows Vista and later, User Account Control (UAC) determines the privileges of a user. If you are a member of the Built-in Administrators group, you are assigned two run-time access tokens: a standard user access token and an administrator access token. By default, you are in the standard user role. To execute the code that accesses the security log, you must first elevate your privileges from standard user to administrator. You can do this when you start an application by right-clicking the application icon and indicating that you want to run as an administrator.
+> In Windows Vista and later, User Account Control (UAC) determines the privileges of a user. If you are a member of the Built-in Administrators group, you are assigned two run-time access tokens: a standard user access token and an administrator access token. By default, you are in the standard user role. To execute the code that accesses the security log, you must first elevate your privileges from standard user to administrator. You can do this when you start an application by right-clicking the application icon and indicating that you want to run as an administrator.
You only need to create an event source if you are writing to the event log. Before writing an entry to an event log, you must register the event source with the event log as a valid source of events. When you write a log entry, the system uses the to find the appropriate log in which to place your entry. If you are reading the event log, you can either specify the , or a and .
> [!NOTE]
-> You are not required to specify the if you are connecting to a log on the local computer. If you do not specify the when reading from a log, the local computer (".") is assumed.
+> You are not required to specify the if you are connecting to a log on the local computer. If you do not specify the when reading from a log, the local computer (".") is assumed.
Use and to write events to an event log. You must specify an event source to write events; you must create and configure the event source before writing the first entry with the source.
@@ -890,7 +884,7 @@ SVC_UPDATE.EXE
To change the configuration details of an existing source, you must delete the source and then create it with the new configuration. If other applications or components use the existing source, create a new source with the updated configuration rather than deleting the existing source.
> [!NOTE]
-> If a source has already been mapped to a log and you remap it to a new log, you must restart the computer for the changes to take effect.
+> If a source has already been mapped to a log and you remap it to a new log, you must restart the computer for the changes to take effect.
@@ -972,8 +966,8 @@ SVC_UPDATE.EXE
[<System.Obsolete("EventLog.CreateEventSource has been deprecated. Use System.Diagnostics.EventLog.CreateEventSource(EventSourceCreationData sourceData) instead.")>]
- [System.Obsolete("This method has been deprecated. Please use System.Diagnostics.EventLog.CreateEventSource(EventSourceCreationData sourceData) instead. https://go.microsoft.com/fwlink/?linkid=14202")]
- [<System.Obsolete("This method has been deprecated. Please use System.Diagnostics.EventLog.CreateEventSource(EventSourceCreationData sourceData) instead. https://go.microsoft.com/fwlink/?linkid=14202")>]
+ [System.Obsolete("This method has been deprecated. Please use System.Diagnostics.EventLog.CreateEventSource(EventSourceCreationData sourceData) instead. https://go.microsoft.com/fwlink/?linkid=14202")]
+ [<System.Obsolete("This method has been deprecated. Please use System.Diagnostics.EventLog.CreateEventSource(EventSourceCreationData sourceData) instead. https://go.microsoft.com/fwlink/?linkid=14202")>]
@@ -1000,11 +994,11 @@ SVC_UPDATE.EXE
You only need to create an event source if you are writing to the event log. Before writing an entry to an event log, you must register the event source with the event log as a valid source of events. When you write a log entry, the system uses the to find the appropriate log in which to place your entry. If you are reading the event log, you can either specify the , or a and .
> [!NOTE]
-> To create an event source in Windows Vista and later or Windows Server 2003, you must have administrative privileges.
+> To create an event source in Windows Vista and later or Windows Server 2003, you must have administrative privileges.
>
-> The reason for this requirement is that all event logs, including security, must be searched to determine whether the event source is unique. In Windows Vista and later, users do not have permission to access the security log; therefore, a is thrown.
+> The reason for this requirement is that all event logs, including security, must be searched to determine whether the event source is unique. In Windows Vista and later, users do not have permission to access the security log; therefore, a is thrown.
>
-> In Windows Vista and later, User Account Control (UAC) determines the privileges of a user. If you are a member of the Built-in Administrators group, you are assigned two run-time access tokens: a standard user access token and an administrator access token. By default, you are in the standard user role. To execute the code that accesses the security log, you must first elevate your privileges from standard user to administrator. You can do this when you start an application by right-clicking the application icon and indicating that you want to run as an administrator.
+> In Windows Vista and later, User Account Control (UAC) determines the privileges of a user. If you are a member of the Built-in Administrators group, you are assigned two run-time access tokens: a standard user access token and an administrator access token. By default, you are in the standard user role. To execute the code that accesses the security log, you must first elevate your privileges from standard user to administrator. You can do this when you start an application by right-clicking the application icon and indicating that you want to run as an administrator.
Use and to write events to an event log. You must specify an event source to write events; you must create and configure the event source before writing the first entry with the source.
@@ -1122,7 +1116,7 @@ SVC_UPDATE.EXE
The method first deletes the file that holds the contents of the log. It then accesses the registry and removes all the event sources registered for that log. If you recreate the log at a later point, you should register the event sources again, if they are to be reused. If you do not register the event sources and other users write to an event source without specifying a log name, the event source will be created in the Application event log. Therefore, applications that previously were able to write entries to the log you deleted and recreated will write to the Application log instead, because it now contains the event source.
> [!NOTE]
-> Recreating an event log can be a difficult process. Avoid deleting any of the system-created event logs, such as the Application log.
+> Recreating an event log can be a difficult process. Avoid deleting any of the system-created event logs, such as the Application log.
Deleting a log through a call to automatically deletes the sources registered to that log. This can make other applications using that log inoperative.
@@ -1132,7 +1126,7 @@ SVC_UPDATE.EXE
The following example deletes a log from the local computer. The example determines the log from its source.
> [!NOTE]
-> More than one source might write to an event log. Before deleting a custom log, make sure there are no other sources writing to that log.
+> More than one source might write to an event log. Before deleting a custom log, make sure there are no other sources writing to that log.
:::code language="csharp" source="~/snippets/csharp/System.Diagnostics/EventLog/Delete/source1.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/System.Diagnostics/EventLog/Delete/source1.vb" id="Snippet1":::
@@ -1205,7 +1199,7 @@ SVC_UPDATE.EXE
This method first deletes the file that holds the contents of the log. It then accesses the registry and removes all the event sources registered for that log. If you recreate the log at a later point, you should register the event sources again, if they are to be reused. If you do not register the event sources and other users write to an event source without specifying a log name, the event source will be created in the Application event log. Therefore, applications that previously were able to write entries to the log you deleted and recreated will write to the Application log instead, because it now contains the event source.
> [!NOTE]
-> Recreating an event log can be a difficult process. Avoid deleting any of the system-created event logs, such as the Application log.
+> Recreating an event log can be a difficult process. Avoid deleting any of the system-created event logs, such as the Application log.
Deleting a log through a call to automatically deletes the sources registered to that log. This can make other applications using that log inoperative.
@@ -1215,7 +1209,7 @@ SVC_UPDATE.EXE
The following example deletes a log from the specified computer. The example determines the log from its source.
> [!NOTE]
-> More than one source might write to an event log. Before deleting a custom log, make sure there are no other sources writing to that log.
+> More than one source might write to an event log. Before deleting a custom log, make sure there are no other sources writing to that log.
:::code language="csharp" source="~/snippets/csharp/System.Diagnostics/EventLog/Delete/source.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/System.Diagnostics/EventLog/Delete/source.vb" id="Snippet1":::
@@ -1302,7 +1296,7 @@ SVC_UPDATE.EXE
Deleting a log through a call to automatically deletes the sources registered to that log. This can make other applications using that log inoperative.
> [!NOTE]
-> If a source has already been mapped to a log and you remap it to a new log, you must restart the computer for the changes to take effect.
+> If a source has already been mapped to a log and you remap it to a new log, you must restart the computer for the changes to take effect.
@@ -1310,7 +1304,7 @@ SVC_UPDATE.EXE
The following example deletes a source from the local computer. The example determines the log from its source, and then deletes the log.
> [!NOTE]
-> More than one source might write to an event log. Before deleting a custom log, make sure there are no other sources writing to that log.
+> More than one source might write to an event log. Before deleting a custom log, make sure there are no other sources writing to that log.
:::code language="csharp" source="~/snippets/csharp/System.Diagnostics/EventLog/Delete/source1.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/System.Diagnostics/EventLog/Delete/source1.vb" id="Snippet1":::
@@ -1379,7 +1373,7 @@ SVC_UPDATE.EXE
Deleting a log through a call to automatically deletes the sources registered to that log. This can make other applications using that log inoperative.
> [!NOTE]
-> If a source has already been mapped to a log and you remap it to a new log, you must restart the computer for the changes to take effect.
+> If a source has already been mapped to a log and you remap it to a new log, you must restart the computer for the changes to take effect.
@@ -1387,7 +1381,7 @@ SVC_UPDATE.EXE
The following example deletes a source from the specified computer. The example determines the log from its source, and then deletes the log.
> [!NOTE]
-> More than one source might write to an event log. Before deleting a custom log, make sure there are no other sources writing to that log.
+> More than one source might write to an event log. Before deleting a custom log, make sure there are no other sources writing to that log.
:::code language="csharp" source="~/snippets/csharp/System.Diagnostics/EventLog/Delete/source.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/System.Diagnostics/EventLog/Delete/source.vb" id="Snippet1":::
@@ -1517,7 +1511,7 @@ SVC_UPDATE.EXE
The property determines whether the raises events when entries are written to the log. When the property is `true`, components that receive the event will receive notification any time an entry is written to the log that is specified in the property. If is `false`, no events are raised.
> [!NOTE]
-> You can receive event notifications only when entries are written on the local computer. You cannot receive notifications for entries written on remote computers.
+> You can receive event notifications only when entries are written on the local computer. You cannot receive notifications for entries written on remote computers.
@@ -1634,7 +1628,7 @@ SVC_UPDATE.EXE
An important distinction between reading and writing log entries is that it is not necessary to explicitly call a read method. After the and are specified, the property is automatically populated. If you change the value of the or property, the property is repopulated the next time you read it.
> [!NOTE]
-> You are not required to specify the if you are connecting to a log. If you do not specify the , the local computer, ".", is assumed.
+> You are not required to specify the if you are connecting to a log. If you do not specify the , the local computer, ".", is assumed.
@@ -2060,12 +2054,12 @@ SVC_UPDATE.EXE
Three log files exist by default on the server: Application, System, and Security. Applications and services use the Application log file. Device drivers use the System log file. The system generates success and failure audit events in the Security log when auditing is turned on. If you have other applications installed, like Active Directory on Windows servers, there might be other default log files. In addition, you can create custom log files on a local or remote computer. Custom logs help organize your entries in a more detailed way than is allowed when your components write events to the default Application log.
> [!NOTE]
-> Log names are limited to eight characters. According to the system, MyLogSample1 and MyLogSample2 are the same log.
+> Log names are limited to eight characters. According to the system, MyLogSample1 and MyLogSample2 are the same log.
If you write to an event log, it is not enough to specify the property. You must associate a property with your event log resource to connect it to a particular log. It is not necessary to specify a when only reading from a log, but an event source must be associated with the event log resource in the server's registry. You can specify only the name and (server computer name) to read from it.
> [!NOTE]
-> You are not required to specify the if you are connecting to a log. If you do not specify the , the local computer (".") is assumed.
+> You are not required to specify the if you are connecting to a log. If you do not specify the , the local computer (".") is assumed.
If the property has not been specified, a call to returns an empty string if has not been explicitly set (by setting the property, or through the constructor). If the has been specified, returns the name of the log to which that source was registered.
@@ -2078,7 +2072,7 @@ SVC_UPDATE.EXE
If the value changes, the event log is closed and all event handles are released.
> [!CAUTION]
-> If you set the property to the name of a log that does not exist, the system attaches the to the Application log, but does not warn you that it is using a log other than the one you specified.
+> If you set the property to the name of a log that does not exist, the system attaches the to the Application log, but does not warn you that it is using a log other than the one you specified.
@@ -2148,9 +2142,9 @@ SVC_UPDATE.EXE
## Remarks
> [!NOTE]
-> In Windows Vista and later, users do not have permission to access the security log. If you are running Windows Vista or later as a user, you will get a when you attempt to access the display name for an event in the security log.
+> In Windows Vista and later, users do not have permission to access the security log. If you are running Windows Vista or later as a user, you will get a when you attempt to access the display name for an event in the security log.
>
-> In Windows Vista and later, User Account Control (UAC) determines the privileges of a user. If you are a member of the Built-in Administrators group, you are assigned two run-time access tokens: a standard user access token and an administrator access token. By default, you are in the standard user role. To execute the code that accesses the security log, you must first elevate your privileges from standard user to administrator. You can do this when you start an application by right-clicking the application icon and indicating that you want to run as an administrator.
+> In Windows Vista and later, User Account Control (UAC) determines the privileges of a user. If you are a member of the Built-in Administrators group, you are assigned two run-time access tokens: a standard user access token and an administrator access token. By default, you are in the standard user role. To execute the code that accesses the security log, you must first elevate your privileges from standard user to administrator. You can do this when you start an application by right-clicking the application icon and indicating that you want to run as an administrator.
@@ -2218,7 +2212,7 @@ SVC_UPDATE.EXE
The following example deletes a source from the local computer. The example determines the log from its source, and then deletes the log.
> [!NOTE]
-> More than one source might write to an event log. Before deleting a custom log, make sure there are no other sources writing to that log.
+> More than one source might write to an event log. Before deleting a custom log, make sure there are no other sources writing to that log.
:::code language="csharp" source="~/snippets/csharp/System.Diagnostics/EventLog/Delete/source1.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/System.Diagnostics/EventLog/Delete/source1.vb" id="Snippet1":::
@@ -2284,7 +2278,7 @@ SVC_UPDATE.EXE
If you write to an event log, you must associate a with your event log object to connect it to a particular log. It is not necessary to specify the property when only reading from a log. You can specify only the name and (server computer name).
> [!NOTE]
-> You need not specify the if you are connecting to a log. If you do not specify the , the local computer (".") is assumed.
+> You need not specify the if you are connecting to a log. If you do not specify the , the local computer (".") is assumed.
A source can only be registered to one log at a time. If the property was set for an instance of , you cannot change the property for that without changing the value of or calling first. If you change the property, the closes all handles and reattaches to the log and source on the new computer.
@@ -2359,7 +2353,7 @@ SVC_UPDATE.EXE
The property represents the size limit of the event log file. When the event log reaches the size limit, the configured value determines whether new entries are discarded, or whether new entries overwrite older entries.
> [!NOTE]
-> This property represents a configuration setting for the event log represented by this instance. When the event log reaches its maximum size, this property specifies how the operating system handles new entries written by all event sources registered for the event log.
+> This property represents a configuration setting for the event log represented by this instance. When the event log reaches its maximum size, this property specifies how the operating system handles new entries written by all event sources registered for the event log.
@@ -2568,7 +2562,7 @@ SVC_UPDATE.EXE
Use the property value to examine the configured overflow behavior for an event log at its maximum size. Use the method to change the overflow behavior for an event log.
> [!NOTE]
-> The overflow behavior takes effect only when an event log reaches its maximum file size. The overflow behavior does not affect writing a new entry to a log that can accommodate additional event log entries.
+> The overflow behavior takes effect only when an event log reaches its maximum file size. The overflow behavior does not affect writing a new entry to a log that can accommodate additional event log entries.
@@ -2633,7 +2627,7 @@ SVC_UPDATE.EXE
If the Event Viewer cannot load the localized string from the resource file, or if no display name was registered for the event log, then the Event Viewer displays the event log name defined in .
> [!NOTE]
-> You do not need to register a display name for the pre-defined event logs. The operating system registers the localized display names for the Application, System, and Security event logs.
+> You do not need to register a display name for the pre-defined event logs. The operating system registers the localized display names for the Application, System, and Security event logs.
@@ -2823,7 +2817,7 @@ SVC_UPDATE.EXE
You only need to specify an event source if you are writing to an event log. Before writing an entry to an event log, you must register the event source with the event log as a valid source of events. When you write a log entry, the system uses the property to find the appropriate log in which to place your entry. If you are reading the event log, you can either specify the , or a and .
> [!NOTE]
-> You are not required to specify the if you are connecting to a log on the local computer. If you do not specify the , the local computer (".") is assumed.
+> You are not required to specify the if you are connecting to a log on the local computer. If you do not specify the , the local computer (".") is assumed.
Use and to write events to an event log. You must specify an event source to write events; you must create and configure the event source before writing the first entry with the source.
@@ -2840,7 +2834,7 @@ SVC_UPDATE.EXE
To change the configuration details of an existing source, you must delete the source and then create it with the new configuration. If other applications or components use the existing source, create a new source with the updated configuration rather than deleting the existing source.
> [!NOTE]
-> If a source has already been mapped to a log and you remap it to a new log, you must restart the computer for the changes to take effect.
+> If a source has already been mapped to a log and you remap it to a new log, you must restart the computer for the changes to take effect.
@@ -2923,14 +2917,14 @@ SVC_UPDATE.EXE
Because this method accesses the registry, you must have the appropriate registry permissions on the local computer; otherwise, a will be thrown.
> [!NOTE]
-> To search for an event source in Windows Vista and later or Windows Server 2003, you must have administrative privileges.
+> To search for an event source in Windows Vista and later or Windows Server 2003, you must have administrative privileges.
>
-> The reason for this requirement is that all event logs, including security, must be searched to determine whether the event source is unique. Starting with Windows Vista, users do not have permission to access the security log; therefore, a is thrown.
+> The reason for this requirement is that all event logs, including security, must be searched to determine whether the event source is unique. Starting with Windows Vista, users do not have permission to access the security log; therefore, a