Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates around config files #7994

Merged
merged 1 commit into from
Apr 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions xml/Microsoft.CSharp/CSharpCodeProvider.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,18 +114,14 @@
<Parameter Name="providerOptions" Type="System.Collections.Generic.IDictionary&lt;System.String,System.String&gt;" Index="0" FrameworkAlternate="dotnet-plat-ext-2.1;dotnet-plat-ext-2.2;dotnet-plat-ext-3.0;dotnet-plat-ext-3.1;dotnet-plat-ext-5.0;dotnet-plat-ext-6.0;dotnet-plat-ext-7.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0;windowsdesktop-6.0;windowsdesktop-7.0;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="providerOptions">A <see cref="T:System.Collections.Generic.IDictionary`2" /> object that contains the provider options from the configuration file.</param>
<param name="providerOptions">A <see cref="T:System.Collections.Generic.IDictionary`2" /> object that contains the provider options.</param>
<summary>Initializes a new instance of the <see cref="T:Microsoft.CSharp.CSharpCodeProvider" /> class by using the specified provider options.</summary>
<remarks>
<format type="text/markdown"><![CDATA[

## Remarks
The value for `providerOptions` is obtained from the [\<providerOption>](/dotnet/framework/configure-apps/file-schema/compiler/provideroption-element) element in the configuration file. You can identify the version of the <xref:Microsoft.CSharp.CSharpCodeProvider> you want to use by specifying the `<providerOption>` element, supplying "CompilerVersion" as the option name, and supplying the version number (for example, "v3.5") as the option value. You must precede the version number with a lower case "v".



## Examples
The following configuration file example demonstrates how to specify that version 3.5 of the C# code provider should be used.

In .NET Framework apps, you can obtain the value for `providerOptions` from the [\<providerOption>](/dotnet/framework/configure-apps/file-schema/compiler/provideroption-element) element in the configuration file. You can identify the version of the <xref:Microsoft.CSharp.CSharpCodeProvider> you want to use by specifying the `<providerOption>` element, supplying "CompilerVersion" as the option name, and supplying the version number (for example, "v3.5") as the option value. You must precede the version number with a lower case "v". The following configuration file example demonstrates how to specify that version 3.5 of the C# code provider should be used.

```xml
<configuration>
Expand All @@ -148,7 +144,9 @@
</system.codedom>
</configuration>
```


## Examples

The following example shows how to specify the compiler version when you create a new instance of the <xref:Microsoft.CSharp.CSharpCodeProvider> class.

:::code language="csharp" source="~/snippets/csharp/Microsoft.CSharp/CSharpCodeProvider/.ctor/program.cs" id="Snippet1":::
Expand Down
10 changes: 5 additions & 5 deletions xml/Microsoft.VisualBasic.Logging/FileLogTraceListener.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
## Remarks
The <xref:Microsoft.VisualBasic.Logging.FileLogTraceListener> class provides automated maintenance capabilities to archive log files as needed, on a daily or per-application basis. This automatic archival functionality helps reduce the maintenance responsibilities of developers and administrators.

An instance of <xref:Microsoft.VisualBasic.Logging.FileLogTraceListener> can be added to the <xref:System.Diagnostics.Debug.Listeners%2A?displayProperty=nameWithType> or <xref:System.Diagnostics.Trace.Listeners%2A?displayProperty=nameWithType> collections to redirect output from logging to a text file. Instances of this class can also be added to `My.Application.Log` or `My.Log` (for Web applications) in Visual Basic applications. For more information, see [Walkthrough: Changing Where My.Application.Log Writes Information](/dotnet/visual-basic/developing-apps/programming/log-info/walkthrough-changing-where-my-application-log-writes-information)`.`
An instance of <xref:Microsoft.VisualBasic.Logging.FileLogTraceListener> can be added to the <xref:System.Diagnostics.Debug.Listeners%2A?displayProperty=nameWithType> or <xref:System.Diagnostics.Trace.Listeners%2A?displayProperty=nameWithType> collections to redirect output from logging to a text file. Instances of this class can also be added to `My.Application.Log` or `My.Log` (for Web applications) in Visual Basic applications. For more information, see [Walkthrough: Changing Where My.Application.Log Writes Information](/dotnet/visual-basic/developing-apps/programming/log-info/walkthrough-changing-where-my-application-log-writes-information).

The main features of this class are:

Expand Down Expand Up @@ -102,9 +102,7 @@

- 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.

To set the level of your listener, edit the configuration file for 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 like the following example.

For this example to run, you must provide the fully qualified assembly name. For information about how to obtain the fully qualified assembly name, see [Assembly Names](/dotnet/standard/assembly/names).
In .NET Framework apps, you can set the level of your listener by editing the configuration file for 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 like the following example.

```xml
<configuration>
Expand All @@ -119,7 +117,9 @@
</sharedListeners>
</system.diagnostics>
</configuration>
```
```

For this example to run, you must provide the fully qualified assembly name. For information about how to obtain the fully qualified assembly name, see [Assembly Names](/dotnet/standard/assembly/names).

]]></format>
</remarks>
Expand Down
16 changes: 7 additions & 9 deletions xml/Microsoft.VisualBasic/VBCodeProvider.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,18 +114,14 @@
<Parameter Name="providerOptions" Type="System.Collections.Generic.IDictionary&lt;System.String,System.String&gt;" Index="0" FrameworkAlternate="dotnet-plat-ext-2.1;dotnet-plat-ext-2.2;dotnet-plat-ext-3.0;dotnet-plat-ext-3.1;dotnet-plat-ext-5.0;dotnet-plat-ext-6.0;dotnet-plat-ext-7.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0;windowsdesktop-6.0;windowsdesktop-7.0;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="providerOptions">A <see cref="T:System.Collections.Generic.IDictionary`2" /> object that contains the provider options from the configuration file.</param>
<param name="providerOptions">A <see cref="T:System.Collections.Generic.IDictionary`2" /> object that contains the provider options.</param>
<summary>Initializes a new instance of the <see cref="T:Microsoft.VisualBasic.VBCodeProvider" /> class by using the specified provider options.</summary>
<remarks>
<format type="text/markdown"><![CDATA[

## Remarks
The value for `providerOptions` is obtained from the [&lt;providerOption&gt;](/dotnet/framework/configure-apps/file-schema/compiler/provideroption-element) element in the configuration file. You can identify the version of the <xref:Microsoft.VisualBasic.VBCodeProvider> you want to use by specifying the `<providerOption>` element, supplying "CompilerVersion" as the option name, and supplying the version number (for example, "v3.5") as the option value. You must precede the version number with a lower case "v".



## Examples
The following configuration file example demonstrates how to specify that version 3.5 of the Visual Basic code provider should be used.
## Remarks

In .NET Framework apps, you can obtain the value for `providerOptions` from the [\<providerOptions>](/dotnet/framework/configure-apps/file-schema/compiler/provideroption-element) element in the configuration file. You can identify the version of the <xref:Microsoft.VisualBasic.VBCodeProvider> you want to use by specifying the `<providerOption>` element, supplying "CompilerVersion" as the option name, and supplying the version number (for example, "v3.5") as the option value. You must precede the version number with a lower case "v". The following configuration file example demonstrates how to specify that version 3.5 of the Visual Basic code provider should be used.

```xml
<configuration>
Expand All @@ -148,7 +144,9 @@
</system.codedom>
</configuration>
```


## Examples

The following example shows how to specify the compiler version when creating a new instance of the <xref:Microsoft.VisualBasic.VBCodeProvider> class.

:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/vbprovider.provideroptions/vb/program.vb" id="Snippet1":::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ In .NET Framework 4.7.2 and earlier versions, when using a custom <xref:System.C

Without this setting, this property returns `null` with .NET Framework October 2019 Preview of Quality Rollup or later versions.

In .NET Framework 4.8 version prior to the October 2019 update, this property returns member name without the configuration setting. If you change your *web.config* file as shown in the previous example, the property returns `null`.
In .NET Framework 4.8 version prior to the October 2019 update, this property returns member name without the configuration setting. If you change your *web.config* file as shown in the previous example, the property returns `null`.

]]></format>
</remarks>
Expand Down
8 changes: 3 additions & 5 deletions xml/System.ComponentModel/TypeConverter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2401,7 +2401,7 @@ Note: Your derived type might be marked as <see langword="internal" /> or <see l
## Remarks
Starting in .NET Framework 4, the <xref:System.ComponentModel.TypeConverter.IsValid%2A> method catches exceptions from the <xref:System.ComponentModel.TypeConverter.CanConvertFrom%2A> and <xref:System.ComponentModel.TypeConverter.ConvertFrom%2A> methods. If the input value type causes <xref:System.ComponentModel.TypeConverter.CanConvertFrom%2A> to return `false`, or if the input value causes <xref:System.ComponentModel.TypeConverter.ConvertFrom%2A> to raise an exception, the <xref:System.ComponentModel.TypeConverter.IsValid%2A> method returns `false`.

To enable the legacy behavior, insert the following lines into the configuration file of the application, for example, application1.exe.config.
To enable the legacy behavior, insert the following lines into the configuration file of your .NET Framework application.

```xml
<configuration>
Expand Down Expand Up @@ -2475,17 +2475,15 @@ Note: Your derived type might be marked as <see langword="internal" /> or <see l

Starting in .NET Framework 4, the <xref:System.ComponentModel.TypeConverter.IsValid%2A> method catches exceptions from the <xref:System.ComponentModel.TypeConverter.CanConvertFrom%2A> and <xref:System.ComponentModel.TypeConverter.ConvertFrom%2A> methods. If the input value type causes <xref:System.ComponentModel.TypeConverter.CanConvertFrom%2A> to return `false`, or if the input value causes <xref:System.ComponentModel.TypeConverter.ConvertFrom%2A> to raise an exception, the <xref:System.ComponentModel.TypeConverter.IsValid%2A> method returns `false`.

To enable the legacy behavior, insert the following lines into the configuration file of the application, for example, application1.exe.config.
To enable the legacy behavior, insert the following lines into the configuration file of your .NET Framework application.

```xml
<configuration>
<appSettings>
<add key="UseCompatibleTypeConverterBehavior" value="true" />
</appSettings>
</configuration>
```


```

## Examples
For an example of this function, see the <xref:System.ComponentModel.TypeConverter> class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
## Examples
The following example shows how to use the <xref:System.Configuration.ConfigurationCollectionAttribute>.

This example consists of three classes: `UrlsSection`, `UrlsCollection` and `UrlConfigElement`. The `UrlsSection` class uses the <xref:System.Configuration.ConfigurationCollectionAttribute> to define a custom configuration section. This section contains a URL collection (defined by the `UrlsCollection` class) of URL elements (defined by the `UrlConfigElement` class). When you run the example, an instance of the `UrlsSection` class is created and the following configuration elements are generated in the application configuration file:
This example consists of three classes: `UrlsSection`, `UrlsCollection`, and `UrlConfigElement`. The `UrlsSection` class uses the <xref:System.Configuration.ConfigurationCollectionAttribute> to define a custom configuration section. This section contains a URL collection (defined by the `UrlsCollection` class) of URL elements (defined by the `UrlConfigElement` class). When you run the example, an instance of the `UrlsSection` class is created and the following configuration elements are generated in the application configuration file:

```xml
<configuration>
Expand Down
Loading