diff --git a/docs/fsharp/language-reference/xml-documentation.md b/docs/fsharp/language-reference/xml-documentation.md index 1dbf384215a13..b234a8f94b431 100644 --- a/docs/fsharp/language-reference/xml-documentation.md +++ b/docs/fsharp/language-reference/xml-documentation.md @@ -90,7 +90,7 @@ The following table describes the tags for use inside description sections: ### User-defined tags The previous tags represent those that are recognized by the F# compiler and typical F# editor tooling. However, a user is free to define their own tags. -Tools like fsdocs bring support for extra tags like [\](https://github.com/fsharp/fslang-design/blob/main/tooling/FST-1031-xmldoc-extensions.md). +Tools like fsdocs bring support for extra tags like [``](https://github.com/fsharp/fslang-design/blob/main/tooling/FST-1031-xmldoc-extensions.md). Custom or in-house documentation generation tools can also be used with the standard tags and multiple output formats from HTML to PDF can be supported. ## Compile-time checking diff --git a/docs/fundamentals/code-analysis/configuration-options.md b/docs/fundamentals/code-analysis/configuration-options.md index 662aac41be0bd..4f4dea4cc960f 100644 --- a/docs/fundamentals/code-analysis/configuration-options.md +++ b/docs/fundamentals/code-analysis/configuration-options.md @@ -30,7 +30,7 @@ For additional options, see [Code analysis properties](../../core/project-sdk/ms ### Analysis mode -While the .NET SDK includes all code analysis rules, only some of them are [enabled by default](https://github.com/dotnet/roslyn-analyzers/blob/main/src/NetAnalyzers/Core/AnalyzerReleases.Shipped.md). The *analysis mode* determines which, if any, set of rules to enable. You can choose a more aggressive analysis mode where most or all rules are enabled. Or you can choose a more conservative analysis mode where most or all rules are disabled, and you can then opt-in to specific rules as needed. Set your analysis mode by adding the [\](../../core/project-sdk/msbuild-props.md#analysismode) MSBuild property to your project file. +While the .NET SDK includes all code analysis rules, only some of them are [enabled by default](https://github.com/dotnet/roslyn-analyzers/blob/main/src/NetAnalyzers/Core/AnalyzerReleases.Shipped.md). The *analysis mode* determines which, if any, set of rules to enable. You can choose a more aggressive analysis mode where most or all rules are enabled. Or you can choose a more conservative analysis mode where most or all rules are disabled, and you can then opt-in to specific rules as needed. Set your analysis mode by adding the [``](../../core/project-sdk/msbuild-props.md#analysismode) MSBuild property to your project file. ```xml @@ -116,7 +116,7 @@ The following table shows the different rule severities that you can configure f ``` > [!IMPORTANT] -> When you configure the severity level for multiple rules with a single entry, either for a *category* of rules or for *all* rules, the severity only applies to rules that are [enabled by default](https://github.com/dotnet/roslyn-analyzers/blob/main/src/NetAnalyzers/Core/AnalyzerReleases.Shipped.md). And if you enable all rules by using the MSBuild properties [\](../../core/project-sdk/msbuild-props.md#analysismode) or [\](../../core/project-sdk/msbuild-props.md#analysislevel), any bulk `dotnet_analyzer_diagnostic` options are ignored. For this reason, it's better to enable a category of rules by setting [\>](../../core/project-sdk/msbuild-props.md#analysismodecategory) to `All`. +> When you configure the severity level for multiple rules with a single entry, either for a *category* of rules or for *all* rules, the severity only applies to rules that are [enabled by default](https://github.com/dotnet/roslyn-analyzers/blob/main/src/NetAnalyzers/Core/AnalyzerReleases.Shipped.md). And if you enable all rules by using the MSBuild properties [``](../../core/project-sdk/msbuild-props.md#analysismode) or [``](../../core/project-sdk/msbuild-props.md#analysislevel), any bulk `dotnet_analyzer_diagnostic` options are ignored. For this reason, it's better to enable a category of rules by setting [\>](../../core/project-sdk/msbuild-props.md#analysismodecategory) to `All`. > [!NOTE] > The prefix for setting severity for a single rule, `dotnet_diagnostic`, is slightly different than the prefix for configuring severity via category or for all rules, `dotnet_analyzer_diagnostic`. diff --git a/docs/fundamentals/code-analysis/style-rules/language-rules.md b/docs/fundamentals/code-analysis/style-rules/language-rules.md index 6ca1f966d419c..5c79b335515a6 100644 --- a/docs/fundamentals/code-analysis/style-rules/language-rules.md +++ b/docs/fundamentals/code-analysis/style-rules/language-rules.md @@ -46,7 +46,7 @@ or If you're using the .NET 8 SDK or an earlier version and you want the severity to be respected at build time, you can do so in one of two ways: - - Set the [\](../../../core/project-sdk/msbuild-props.md#analysislevel) or `` property to `9.0` or higher, or to `preview`. + - Set the [``](../../../core/project-sdk/msbuild-props.md#analysislevel) or `` property to `9.0` or higher, or to `preview`. - Set the severity by using the rule ID-based severity configuration syntax for analyzers instead. The syntax takes the form `dotnet_diagnostic..severity = `, for example, `dotnet_diagnostic.IDE0040.severity = warning`. For more information, see [severity level](../configuration-options.md#severity-level). > [!TIP] diff --git a/docs/fundamentals/code-analysis/style-rules/naming-rules.md b/docs/fundamentals/code-analysis/style-rules/naming-rules.md index 5f392c2412d9d..6990ce5609044 100644 --- a/docs/fundamentals/code-analysis/style-rules/naming-rules.md +++ b/docs/fundamentals/code-analysis/style-rules/naming-rules.md @@ -40,17 +40,17 @@ Each property should only be set once, but some settings allow multiple, comma-s The order of the properties is not important. -## \ values +## `` values **\** specifies which kind of entity is being defined—naming rule, symbol group, or naming style—and must be one of the following: -| To set a property for | Use the \ value | Example | +| To set a property for | Use the `` value | Example | | --- | --- | -- | | Naming rule | `dotnet_naming_rule` | `dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion` | | Symbol group | `dotnet_naming_symbols` | `dotnet_naming_symbols.interface.applicable_kinds = interface` | | Naming style | `dotnet_naming_style` | `dotnet_naming_style.pascal_case.capitalization = pascal_case` | -## \ +## `` **\** is a descriptive name you choose that associates multiple property settings into a single definition. For example, the following properties produce two symbol group definitions, `interface` and `types`, each of which has two properties set on it. @@ -62,7 +62,7 @@ dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum, d dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected ``` -## \ and \ +## `` and `` Each kind of entity—[naming rule](#naming-rule-properties), [symbol group](#symbol-group-properties), or [naming style](#naming-style-properties)—has its own supported properties, as described in the following sections. diff --git a/docs/fundamentals/runtime-libraries/system-appcontext.md b/docs/fundamentals/runtime-libraries/system-appcontext.md index 52e213a3e4a14..643607ce24129 100644 --- a/docs/fundamentals/runtime-libraries/system-appcontext.md +++ b/docs/fundamentals/runtime-libraries/system-appcontext.md @@ -26,7 +26,7 @@ It's beneficial to use a consistent format for switch names, since they're a for - *Switch*.*namespace*.*switchname* - *Switch*.*library*.*switchname* -Once you define and document the switch, callers can use it by calling the method programmatically. .NET Framework apps can also use the switch by adding an [\](../../framework/configure-apps/file-schema/runtime/appcontextswitchoverrides-element.md) element to their application configuration file or by using the registry. For more information about how callers use and set the value of configuration switches, see the [AppContext for library consumers](#appcontext-for-library-consumers) section. +Once you define and document the switch, callers can use it by calling the method programmatically. .NET Framework apps can also use the switch by adding an [``](../../framework/configure-apps/file-schema/runtime/appcontextswitchoverrides-element.md) element to their application configuration file or by using the registry. For more information about how callers use and set the value of configuration switches, see the [AppContext for library consumers](#appcontext-for-library-consumers) section. In .NET Framework, when the common language runtime runs an application, it automatically reads the registry's compatibility settings and loads the application configuration file to populate the application's instance. Because the instance is populated either programmatically by the caller or by the runtime, .NET Framework apps don't have to take any action, such as calling the method, to configure the instance. @@ -90,9 +90,9 @@ You can set the value of a switch by calling the ` element to the [\](../../framework/configure-apps/file-schema/runtime/runtime-element.md) section of the app.config file. The switch has a single attribute, `value`, whose value is a string that represents a key/value pair containing both the switch name and its value. +- By adding an `` element to the [``](../../framework/configure-apps/file-schema/runtime/runtime-element.md) section of the app.config file. The switch has a single attribute, `value`, whose value is a string that represents a key/value pair containing both the switch name and its value. - To define multiple switches, separate each switch's key/value pair in the [\](../../framework/configure-apps/file-schema/runtime/appcontextswitchoverrides-element.md) element's `value` attribute with a semicolon. In that case, the `` element has the following format: + To define multiple switches, separate each switch's key/value pair in the [``](../../framework/configure-apps/file-schema/runtime/appcontextswitchoverrides-element.md) element's `value` attribute with a semicolon. In that case, the `` element has the following format: ```xml @@ -101,7 +101,7 @@ You can set the value of a switch by calling the ` element to define a configuration setting has application scope; that is, it affects only the application. > [!NOTE] - > For information on the switches defined by .NET Framework, see [\ element](../../framework/configure-apps/file-schema/runtime/appcontextswitchoverrides-element.md). + > For information on the switches defined by .NET Framework, see [`` element](../../framework/configure-apps/file-schema/runtime/appcontextswitchoverrides-element.md). - By adding an entry to the registry. Add a new string value to the **HKLM\SOFTWARE\Microsoft\\.NETFramework\AppContext** subkey. Set the name of the entry to the name of the switch. Set its value to one of the following options: `True`, `true`, `False`, or `false`. If the runtime encounters any other value, it ignores the switch. @@ -109,7 +109,7 @@ You can set the value of a switch by calling the switch has machine scope; that is, it affects every application running on the machine. -For ASP.NET and ASP.NET Core applications, you set a switch by adding an [\](../../framework/configure-apps/file-schema/appsettings/add-element-for-appsettings.md) element to the [\](../../framework/configure-apps/file-schema/appsettings/index.md) section of the web.config file. For example: +For ASP.NET and ASP.NET Core applications, you set a switch by adding an [``](../../framework/configure-apps/file-schema/appsettings/add-element-for-appsettings.md) element to the [``](../../framework/configure-apps/file-schema/appsettings/index.md) section of the web.config file. For example: ```xml diff --git a/docs/fundamentals/runtime-libraries/system-resources-resourcemanager.md b/docs/fundamentals/runtime-libraries/system-resources-resourcemanager.md index 9ffc3aae85cdf..78a7e5451ca3d 100644 --- a/docs/fundamentals/runtime-libraries/system-resources-resourcemanager.md +++ b/docs/fundamentals/runtime-libraries/system-resources-resourcemanager.md @@ -196,7 +196,7 @@ Because the main assembly that contains an app's default resources is separate f For more information about versioning support for satellite assemblies, see the article [Retrieving Resources](/dotnet/framework/resources/retrieving-resources-in-desktop-apps). -### \ configuration file node +### `` configuration file node > [!NOTE] > This section is specific to .NET Framework apps. diff --git a/docs/fundamentals/runtime-libraries/system-resources-satellitecontractversionattribute.md b/docs/fundamentals/runtime-libraries/system-resources-satellitecontractversionattribute.md index 9c36e7512992d..2766876648f52 100644 --- a/docs/fundamentals/runtime-libraries/system-resources-satellitecontractversionattribute.md +++ b/docs/fundamentals/runtime-libraries/system-resources-satellitecontractversionattribute.md @@ -13,7 +13,7 @@ When you update the main assembly, you increment its assembly version number. Ho If you want to revise a satellite assembly but not the main assembly, increment the version number on your satellite. In this case, ship a publisher policy assembly along with your satellite assembly stating that your new satellite assembly has backward compatibility with your old satellite assembly. The resource manager will still use the old contract number written into your main assembly based on the attribute; however, the loader will bind to the satellite assembly version that is specified by the policy assembly. -A vendor of a shared component uses a publisher policy assembly to make a compatibility statement about a particular version of a released assembly. A publisher policy assembly is a strongly named assembly that has a name in the format `policy...`, and is registered in the [Global Assembly Cache (GAC)](../../framework/app-domains/gac.md). The publisher policy is generated from an XML configuration file (see the [\ Element](../../framework/configure-apps/file-schema/runtime/bindingredirect-element.md)) by using the [Al.exe (Assembly Linker)](../../framework/tools/al-exe-assembly-linker.md) tool. The Assembly Linker is used with the `/link` option to link the XML configuration file to a manifest assembly, which is then stored in the global assembly cache. The publisher policy assemblies can be used when a vendor ships a maintenance release (service pack) that contains bug fixes. +A vendor of a shared component uses a publisher policy assembly to make a compatibility statement about a particular version of a released assembly. A publisher policy assembly is a strongly named assembly that has a name in the format `policy...`, and is registered in the [Global Assembly Cache (GAC)](../../framework/app-domains/gac.md). The publisher policy is generated from an XML configuration file (see the [`` Element](../../framework/configure-apps/file-schema/runtime/bindingredirect-element.md)) by using the [Al.exe (Assembly Linker)](../../framework/tools/al-exe-assembly-linker.md) tool. The Assembly Linker is used with the `/link` option to link the XML configuration file to a manifest assembly, which is then stored in the global assembly cache. The publisher policy assemblies can be used when a vendor ships a maintenance release (service pack) that contains bug fixes. ## Windows 8.x Store apps diff --git a/docs/fundamentals/runtime-libraries/system-xml-schema-xmlschemaset.md b/docs/fundamentals/runtime-libraries/system-xml-schema-xmlschemaset.md index 0e573dfe7a37b..83327f11acfdf 100644 --- a/docs/fundamentals/runtime-libraries/system-xml-schema-xmlschemaset.md +++ b/docs/fundamentals/runtime-libraries/system-xml-schema-xmlschemaset.md @@ -31,9 +31,9 @@ dev_langs: The following example validates an XML file using schemas stored in the . The namespace in the XML file, `urn:bookstore-schema`, identifies which schema in the to use for validation. Output from the example shows that the XML file has two schema violations: -- The first \ element contains an \ element but no \ or \<price> element. +- The first `<book>` element contains an `<author>` element but no `<title>` or `<price>` element. -- The \<author> element in the last \<book> element is missing a \<first-name> and \<last-name> element and instead has an invalid \<name> element. +- The `<author>` element in the last `<book>` element is missing a `<first-name>` and `<last-name>` element and instead has an invalid `<name>` element. :::code language="csharp" source="./snippets/System.Xml/XmlReaderSettings/ValidationType/csharp/validschemaset.cs" id="Snippet1"::: :::code language="vb" source="./snippets/System.Xml.Schema/XmlSchemaSet/Overview/vb/validschemaset.vb" id="Snippet1"::: diff --git a/docs/standard/analyzers/platform-compat-analyzer.md b/docs/standard/analyzers/platform-compat-analyzer.md index 875bba35e5625..fbe380085633d 100644 --- a/docs/standard/analyzers/platform-compat-analyzer.md +++ b/docs/standard/analyzers/platform-compat-analyzer.md @@ -37,7 +37,7 @@ The platform compatibility analyzer is one of the Roslyn code quality analyzers. - If the platform is a [subset of another platform](#platform-inclusion), the attribute implies that the superset platform is also unsupported. For example, `[UnsupportedOSPlatform("iOS")]` implies that the API is unsupported on `iOS` and also on its superset platform, `MacCatalyst`. - The analyzer produces a **warning** only if the `platform` is effective for the call site: - **Warns** if the project targets the platform that's attributed as unsupported (for example, if the API is attributed with `[UnsupportedOSPlatform("windows")]` and the call site targets `<TargetFramework>net5.0-windows</TargetFramework>`). - - **Warns** if the project is multi-targeted and the `platform` is included in the default [MSBuild `<SupportedPlatform>`](https://github.com/dotnet/sdk/blob/main/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.SupportedPlatforms.props) items group, or the `platform` is manually included within the `MSBuild` \<SupportedPlatform> items group: + - **Warns** if the project is multi-targeted and the `platform` is included in the default [MSBuild `<SupportedPlatform>`](https://github.com/dotnet/sdk/blob/main/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.SupportedPlatforms.props) items group, or the `platform` is manually included within the `MSBuild` `<SupportedPlatform>` items group: ```xml <ItemGroup> diff --git a/docs/standard/assembly/disable-strong-name-bypass-feature.md b/docs/standard/assembly/disable-strong-name-bypass-feature.md index 36636d28ae758..82029c24aedcb 100644 --- a/docs/standard/assembly/disable-strong-name-bypass-feature.md +++ b/docs/standard/assembly/disable-strong-name-bypass-feature.md @@ -2,53 +2,53 @@ title: "How to: Disable the strong-name bypass feature" description: Strong-name bypass skips signature validation in fully trusted domains in .NET. You can override this feature for a single application or all applications. ms.date: "08/20/2019" -helpviewer_keywords: +helpviewer_keywords: - "strong-name bypass feature" - "strong-named assemblies, loading into trusted application domains" ms.topic: how-to --- # How to: Disable the strong-name bypass feature -Starting with the .NET Framework version 3.5 Service Pack 1 (SP1), strong-name signatures are not validated when an assembly is loaded into a full-trust <xref:System.AppDomain> object, such as the default <xref:System.AppDomain> for the `MyComputer` zone. This is referred to as the strong-name bypass feature. In a full-trust environment, demands for <xref:System.Security.Permissions.StrongNameIdentityPermission> always succeed for signed, full-trust assemblies regardless of their signature. The only restriction is that the assembly must be fully trusted because its zone is fully trusted. Because the strong name is not a determining factor under these conditions, there is no reason for it to be validated. Bypassing the validation of strong-name signatures provides significant performance improvements. - - The bypass feature applies to any full-trust assembly that is not delay-signed and that is loaded into any full-trust <xref:System.AppDomain> from the directory specified by its <xref:System.AppDomainSetup.ApplicationBase%2A> property. - - You can override the bypass feature for all applications on a computer by setting a registry key value. You can override the setting for a single application by using an application configuration file. You cannot reinstate the bypass feature for a single application if it has been disabled by the registry key. - - When you override the bypass feature, the strong name is validated only for correctness; it is not checked for a <xref:System.Security.Permissions.StrongNameIdentityPermission>. If you want to confirm a specific strong name, you have to perform that check separately. - +Starting with the .NET Framework version 3.5 Service Pack 1 (SP1), strong-name signatures are not validated when an assembly is loaded into a full-trust <xref:System.AppDomain> object, such as the default <xref:System.AppDomain> for the `MyComputer` zone. This is referred to as the strong-name bypass feature. In a full-trust environment, demands for <xref:System.Security.Permissions.StrongNameIdentityPermission> always succeed for signed, full-trust assemblies regardless of their signature. The only restriction is that the assembly must be fully trusted because its zone is fully trusted. Because the strong name is not a determining factor under these conditions, there is no reason for it to be validated. Bypassing the validation of strong-name signatures provides significant performance improvements. + + The bypass feature applies to any full-trust assembly that is not delay-signed and that is loaded into any full-trust <xref:System.AppDomain> from the directory specified by its <xref:System.AppDomainSetup.ApplicationBase%2A> property. + + You can override the bypass feature for all applications on a computer by setting a registry key value. You can override the setting for a single application by using an application configuration file. You cannot reinstate the bypass feature for a single application if it has been disabled by the registry key. + + When you override the bypass feature, the strong name is validated only for correctness; it is not checked for a <xref:System.Security.Permissions.StrongNameIdentityPermission>. If you want to confirm a specific strong name, you have to perform that check separately. + > [!IMPORTANT] -> The ability to force strong-name validation depends on a registry key, as described in the following procedure. If an application is running under an account that does not have access control list (ACL) permission to access that registry key, the setting is ineffective. You must ensure that ACL rights are configured for this key so that it can be read for all assemblies. - -## Disable the strong-name bypass feature for all applications - -- On 32-bit computers, in the system registry, create a DWORD entry with a value of 0 named `AllowStrongNameBypass` under the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\\.NETFramework key. - -- On 64-bit computers, in the system registry, create a DWORD entry with a value of 0 named `AllowStrongNameBypass` under the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\\.NETFramework and HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\\.NETFramework keys. - -## Disable the strong-name bypass feature for a single application - -1. Open or create the application configuration file. - - For more information about this file, see the Application Configuration Files section in [Configure apps](../../framework/configure-apps/index.md). - -2. Add the following entry: - - ```xml - <configuration> - <runtime> - <bypassTrustedAppStrongNames enabled="false" /> - </runtime> - </configuration> - ``` - - You can restore the bypass feature for the application by removing the configuration file setting or by setting the attribute to `true`. - +> The ability to force strong-name validation depends on a registry key, as described in the following procedure. If an application is running under an account that does not have access control list (ACL) permission to access that registry key, the setting is ineffective. You must ensure that ACL rights are configured for this key so that it can be read for all assemblies. + +## Disable the strong-name bypass feature for all applications + +- On 32-bit computers, in the system registry, create a DWORD entry with a value of 0 named `AllowStrongNameBypass` under the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\\.NETFramework key. + +- On 64-bit computers, in the system registry, create a DWORD entry with a value of 0 named `AllowStrongNameBypass` under the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\\.NETFramework and HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\\.NETFramework keys. + +## Disable the strong-name bypass feature for a single application + +1. Open or create the application configuration file. + + For more information about this file, see the Application Configuration Files section in [Configure apps](../../framework/configure-apps/index.md). + +2. Add the following entry: + + ```xml + <configuration> + <runtime> + <bypassTrustedAppStrongNames enabled="false" /> + </runtime> + </configuration> + ``` + + You can restore the bypass feature for the application by removing the configuration file setting or by setting the attribute to `true`. + > [!NOTE] -> You can turn strong-name validation on and off for an application only if the bypass feature is enabled for the computer. If the bypass feature has been turned off for the computer, strong names are validated for all applications and you cannot bypass validation for a single application. - +> You can turn strong-name validation on and off for an application only if the bypass feature is enabled for the computer. If the bypass feature has been turned off for the computer, strong names are validated for all applications and you cannot bypass validation for a single application. + ## See also - [Sn.exe (Strong Name Tool)](../../framework/tools/sn-exe-strong-name-tool.md) -- [\<bypassTrustedAppStrongNames> element](../../framework/configure-apps/file-schema/runtime/bypasstrustedappstrongnames-element.md) +- [`<bypassTrustedAppStrongNames>` element](../../framework/configure-apps/file-schema/runtime/bypasstrustedappstrongnames-element.md) - [Create and use strong-named assemblies](create-use-strong-named.md) diff --git a/docs/standard/assembly/index.md b/docs/standard/assembly/index.md index 8b90636687084..59f180512dcc2 100644 --- a/docs/standard/assembly/index.md +++ b/docs/standard/assembly/index.md @@ -85,7 +85,7 @@ To use an assembly in an application, you must add a reference to it. When an as > [!NOTE] > Most assemblies from the .NET Class Library are referenced automatically. If a system assembly isn't automatically referenced, add a reference in one of the following ways: > -> - For .NET and .NET Core, add a reference to the NuGet package that contains the assembly. Either use the NuGet Package Manager in Visual Studio or add a [\<PackageReference>](../../core/tools/dependencies.md#the-packagereference-element) element for the assembly to the *.csproj* or *.vbproj* project. +> - For .NET and .NET Core, add a reference to the NuGet package that contains the assembly. Either use the NuGet Package Manager in Visual Studio or add a [`<PackageReference>`](../../core/tools/dependencies.md#the-packagereference-element) element for the assembly to the *.csproj* or *.vbproj* project. > - For .NET Framework, add a reference to the assembly using the **Add Reference** dialog in Visual Studio or the `-reference` command line option for the [C#](../../csharp/language-reference/compiler-options/inputs.md#references) or [Visual Basic](../../visual-basic/reference/command-line-compiler/reference.md) compilers. In C#, you can use two versions of the same assembly in a single application. For more information, see [extern alias](../../csharp/language-reference/keywords/extern-alias.md). diff --git a/docs/standard/garbage-collection/app-domain-resource-monitoring.md b/docs/standard/garbage-collection/app-domain-resource-monitoring.md index 96155cd900fdf..c2f7429689566 100644 --- a/docs/standard/garbage-collection/app-domain-resource-monitoring.md +++ b/docs/standard/garbage-collection/app-domain-resource-monitoring.md @@ -23,7 +23,7 @@ ARM can be enabled in four ways: by supplying a configuration file when the comm As soon as ARM is enabled, it begins collecting data on all application domains in the process.If an application domain was created before ARM is enabled, cumulative data starts when ARM is enabled, not when the application domain was created.Once it is enabled, ARM cannot be disabled. -- You can enable ARM at CLR startup by adding the [\<appDomainResourceMonitoring>](../../framework/configure-apps/file-schema/runtime/appdomainresourcemonitoring-element.md) element to the configuration file, and setting the `enabled` attribute to `true`. A value of `false` (the default) means only that ARM is not enabled at startup; you can activate it later by using one of the other activation mechanisms. +- You can enable ARM at CLR startup by adding the [`<appDomainResourceMonitoring>`](../../framework/configure-apps/file-schema/runtime/appdomainresourcemonitoring-element.md) element to the configuration file, and setting the `enabled` attribute to `true`. A value of `false` (the default) means only that ARM is not enabled at startup; you can activate it later by using one of the other activation mechanisms. - The host can enable ARM by requesting the [ICLRAppDomainResourceMonitor](../../framework/unmanaged-api/hosting/iclrappdomainresourcemonitor-interface.md) hosting interface. Once this interface is successfully obtained, ARM is enabled. @@ -85,5 +85,5 @@ If you use the unmanaged hosting API, your host must pass the CLR an implementat - <xref:System.AppDomain.MonitoringIsEnabled%2A?displayProperty=nameWithType> - [ICLRAppDomainResourceMonitor Interface](../../framework/unmanaged-api/hosting/iclrappdomainresourcemonitor-interface.md) -- [\<appDomainResourceMonitoring>](../../framework/configure-apps/file-schema/runtime/appdomainresourcemonitoring-element.md) +- [`<appDomainResourceMonitoring>`](../../framework/configure-apps/file-schema/runtime/appdomainresourcemonitoring-element.md) - [CLR ETW Events](../../framework/performance/clr-etw-events.md) diff --git a/docs/standard/garbage-collection/notifications.md b/docs/standard/garbage-collection/notifications.md index acc46095c52a2..6a11b4752f13a 100644 --- a/docs/standard/garbage-collection/notifications.md +++ b/docs/standard/garbage-collection/notifications.md @@ -15,7 +15,7 @@ There are situations in which a full garbage collection (that is, a generation 2 The <xref:System.GC.RegisterForFullGCNotification%2A> method registers for a notification to be raised when the runtime senses that a full garbage collection is approaching. There are two parts to this notification: when the full garbage collection is approaching and when the full garbage collection has completed. > [!WARNING] -> When the [\<gcConcurrent>](../../framework/configure-apps/file-schema/runtime/gcconcurrent-element.md) configuration element is enabled, <xref:System.GC.WaitForFullGCComplete%2A> may return `NotApplicable` <xref:System.GCNotificationStatus> if the full GC was done as a background GC. +> When the [`<gcConcurrent>`](../../framework/configure-apps/file-schema/runtime/gcconcurrent-element.md) configuration element is enabled, <xref:System.GC.WaitForFullGCComplete%2A> may return `NotApplicable` <xref:System.GCNotificationStatus> if the full GC was done as a background GC. To determine when a notification has been raised, use the <xref:System.GC.WaitForFullGCApproach%2A> and <xref:System.GC.WaitForFullGCComplete%2A> methods. Typically, you use these methods in a `while` loop to continually obtain a <xref:System.GCNotificationStatus> enumeration that shows the status of the notification. If that value is <xref:System.GCNotificationStatus.Succeeded>, you can do the following: diff --git a/docs/standard/security/security-and-user-input.md b/docs/standard/security/security-and-user-input.md index 0c80704adc184..9847ea5bdc780 100644 --- a/docs/standard/security/security-and-user-input.md +++ b/docs/standard/security/security-and-user-input.md @@ -17,7 +17,7 @@ These are among the subtlest and hardest security bugs to find because, although Some important considerations involving user data include the following: -- Any user data in a server response runs in the context of the server's site on the client. If your Web server takes user data and inserts it into the returned Web page, it might, for example, include a **\<script>** tag and run as if from the server. +- Any user data in a server response runs in the context of the server's site on the client. If your Web server takes user data and inserts it into the returned Web page, it might, for example, include a `<script>` tag and run as if from the server. - Remember that the client can request any URL. diff --git a/docs/standard/serialization/add-element-for-schemaimporterextensions.md b/docs/standard/serialization/add-element-for-schemaimporterextensions.md index 18e2594bd64ba..a6e46e804b113 100644 --- a/docs/standard/serialization/add-element-for-schemaimporterextensions.md +++ b/docs/standard/serialization/add-element-for-schemaimporterextensions.md @@ -1,66 +1,66 @@ --- title: "<add> Element for <schemaImporterExtensions>" -description: The <add> element adds types used by the XmlSchemaImporter class for mapping XSD types to .NET types. +description: The <add> element adds types used by the XmlSchemaImporter class for mapping XSD types to .NET types. ms.date: "03/30/2017" -helpviewer_keywords: +helpviewer_keywords: - "XML serialization, configuration" - "<add> element for <schemaImporterExtensions> element" ms.topic: reference --- -# \<add> Element for \<schemaImporterExtensions> - -Adds types used by the <xref:System.Xml.Serialization.XmlSchemaImporter> for mapping XSD types to .NET types. For more information about configuration files, see [Configuration File Schema](../../framework/configure-apps/file-schema/index.md). - -\<configuration> -\<system.xml.serialization> -\<schemaImporterExtensions> -\<add> - -## Syntax - -```xml -<add name = "typeName" type="fully qualified type [,Version=version number] [,Culture=culture] [,PublicKeyToken= token]"/> -``` - -## Attributes and Elements - - The following sections describe attributes, child elements, and parent elements. - -### Attributes - -|Attribute|Description| -|---------------|-----------------| -|**name**|A simple name that is used to find the instance.| -|**type**|Required. Specifies the schema extension class to add. The **type** attribute value must be on one line, and include the fully qualified type name. When the assembly is placed in the Global Assembly Cache (GAC), it must also include the version, culture, and public key token of the signed assembly.| - -### Child Elements - - None. - -### Parent Elements - -|Element|Description| -|-------------|-----------------| -|\<schemaImporterExtensions>|Contains the types that are used by the <xref:System.Xml.Serialization.XmlSchemaImporter>.| - -## Example - - The following code example adds an extension type that the XmlSchemaImporter can use when mapping types. - -```xml -<configuration> - <system.xml.serialization> - <schemaImporterExtensions> +# `<add>` Element for `<schemaImporterExtensions>` + +Adds types used by the <xref:System.Xml.Serialization.XmlSchemaImporter> for mapping XSD types to .NET types. For more information about configuration files, see [Configuration File Schema](../../framework/configure-apps/file-schema/index.md). + +\<configuration> +\<system.xml.serialization> +\<schemaImporterExtensions> +\<add> + +## Syntax + +```xml +<add name = "typeName" type="fully qualified type [,Version=version number] [,Culture=culture] [,PublicKeyToken= token]"/> +``` + +## Attributes and Elements + + The following sections describe attributes, child elements, and parent elements. + +### Attributes + +|Attribute|Description| +|---------------|-----------------| +|**name**|A simple name that is used to find the instance.| +|**type**|Required. Specifies the schema extension class to add. The **type** attribute value must be on one line, and include the fully qualified type name. When the assembly is placed in the Global Assembly Cache (GAC), it must also include the version, culture, and public key token of the signed assembly.| + +### Child Elements + + None. + +### Parent Elements + +|Element|Description| +|-------------|-----------------| +|\<schemaImporterExtensions>|Contains the types that are used by the <xref:System.Xml.Serialization.XmlSchemaImporter>.| + +## Example + + The following code example adds an extension type that the XmlSchemaImporter can use when mapping types. + +```xml +<configuration> + <system.xml.serialization> + <schemaImporterExtensions> <add name="contoso" type="System.Web.Mobile.MobileCapabilities, System.Web.Mobile, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> - </schemaImporterExtensions> - </system.xml.serialization> -</configuration> -``` - + </schemaImporterExtensions> + </system.xml.serialization> +</configuration> +``` + ## See also - <xref:System.Xml.Serialization.XmlSchemaImporter> -- [\<system.xml.serialization> Element](system-xml-serialization-element.md) -- [\<schemaImporterExtensions> Element](schemaimporterextensions-element.md) +- [`<system.xml.serialization>` Element](system-xml-serialization-element.md) +- [`<schemaImporterExtensions>` Element](schemaimporterextensions-element.md) diff --git a/docs/standard/serialization/datetimeserialization-element.md b/docs/standard/serialization/datetimeserialization-element.md index 89aa16cee5a20..fed1e5ecd7bb3 100644 --- a/docs/standard/serialization/datetimeserialization-element.md +++ b/docs/standard/serialization/datetimeserialization-element.md @@ -2,59 +2,59 @@ title: "<dateTimeSerialization> Element" description: This article describes the <dateTimeSerialization> element, which determines the serialization mode of DateTime objects. ms.date: "03/30/2017" -helpviewer_keywords: +helpviewer_keywords: - "dateTimeSerialization element" - "XML serialization, configuration" - "<dateTimeSerialization> element" ms.topic: reference --- -# \<dateTimeSerialization> Element - -Determines the serialization mode of <xref:System.DateTime> objects. - - \<configuration> -\<dateTimeSerialization> - -## Syntax - -```xml -<dateTimeSerialization - mode = "Roundtrip|Local" -/> -``` - -## Attributes and Elements - - The following sections describe attributes, child elements, and parent elements. - -### Attributes - -|Attributes|Description| -|----------------|-----------------| -|`mode`|Optional. Specifies the serialization mode. Set to one of the <xref:System.Xml.Serialization.Configuration.DateTimeSerializationSection.DateTimeSerializationMode> values. The default is **RoundTrip**.| - -### Child Elements - - None. - -### Parent Elements - -|Element|Description| -|-------------|-----------------| -|system.xml.serialization|The top-level element for controlling XML serialization.| - -## Remarks +# `<dateTimeSerialization>` Element + +Determines the serialization mode of <xref:System.DateTime> objects. + + `<configuration>` +`<dateTimeSerialization>` + +## Syntax + +```xml +<dateTimeSerialization + mode = "Roundtrip|Local" +/> +``` + +## Attributes and Elements + + The following sections describe attributes, child elements, and parent elements. + +### Attributes + +|Attributes|Description| +|----------------|-----------------| +|`mode`|Optional. Specifies the serialization mode. Set to one of the <xref:System.Xml.Serialization.Configuration.DateTimeSerializationSection.DateTimeSerializationMode> values. The default is **RoundTrip**.| + +### Child Elements + + None. + +### Parent Elements + +|Element|Description| +|-------------|-----------------| +|system.xml.serialization|The top-level element for controlling XML serialization.| + +## Remarks When this property is set to **Local**, <xref:System.DateTime> objects are always formatted as the local time. That is, local time zone information is always included with the serialized data. - -When this property is set to **Roundtrip**, <xref:System.DateTime> objects are examined to determine whether they are in the local, UTC, or an unspecified time zone. The <xref:System.DateTime> objects are then serialized in such a way that this information is preserved. This is the default behavior and is the recommended behavior for all new applications that do not communicate with older versions of the framework. - + +When this property is set to **Roundtrip**, <xref:System.DateTime> objects are examined to determine whether they are in the local, UTC, or an unspecified time zone. The <xref:System.DateTime> objects are then serialized in such a way that this information is preserved. This is the default behavior and is the recommended behavior for all new applications that do not communicate with older versions of the framework. + ## See also - <xref:System.DateTime> - <xref:System.Xml.Serialization.XmlSchemaImporter> - <xref:System.Xml.Serialization.Configuration.DateTimeSerializationSection.DateTimeSerializationMode> - [Configuration File Schema](../../framework/configure-apps/file-schema/index.md) -- [\<schemaImporterExtensions> Element](schemaimporterextensions-element.md) -- [\<add> Element for \<schemaImporterExtensions>](add-element-for-schemaimporterextensions.md) -- [\<system.xml.serialization> Element](system-xml-serialization-element.md) +- [`<schemaImporterExtensions>` Element](schemaimporterextensions-element.md) +- [`<add>` Element for `<schemaImporterExtensions>`](add-element-for-schemaimporterextensions.md) +- [`<system.xml.serialization>` Element](system-xml-serialization-element.md) diff --git a/docs/standard/serialization/how-to-specify-an-alternate-element-name-for-an-xml-stream.md b/docs/standard/serialization/how-to-specify-an-alternate-element-name-for-an-xml-stream.md index b9a583abde069..8223b0cc7b865 100644 --- a/docs/standard/serialization/how-to-specify-an-alternate-element-name-for-an-xml-stream.md +++ b/docs/standard/serialization/how-to-specify-an-alternate-element-name-for-an-xml-stream.md @@ -2,10 +2,10 @@ title: "How to: Specify an Alternate Element Name for an XML Stream" description: Learn how to create an XML stream with an alternate element name, for instance, for XML Web services that require the same information with slight differences. ms.date: "03/30/2017" -dev_langs: +dev_langs: - "csharp" - "vb" -helpviewer_keywords: +helpviewer_keywords: - "XML serialization, overriding" - "serialization, overriding" - "XML stream, specifying alternate element name for" @@ -15,77 +15,77 @@ helpviewer_keywords: ms.assetid: 5cc1c0b0-f94b-4525-9a41-88a582cd6668 --- # How to: Specify an Alternate Element Name for an XML Stream - -Using the <xref:System.Xml.Serialization.XmlSerializer>, you can generate more than one XML stream with the same set of classes. You might want to do this because two different XML Web services require the same basic information, with only slight differences. For example, imagine two XML Web services that process orders for books, and thus both require ISBN numbers. One service uses the tag \<ISBN> while the second uses the tag \<BookID>. You have a class named `Book` that contains a field named `ISBN`. When an instance of the `Book` class is serialized, it will, by default, use the member name (ISBN) as the tag element name. For the first XML Web service, this is as expected. But to send the XML stream to the second XML Web service, you must override the serialization so that the tag's element name is `BookID`. - -## To create an XML stream with an alternate element name - -1. Create an instance of the <xref:System.Xml.Serialization.XmlElementAttribute> class. - -2. Set the <xref:System.Xml.Serialization.XmlElementAttribute.ElementName%2A> of the <xref:System.Xml.Serialization.XmlElementAttribute> to "BookID". - -3. Create an instance of the <xref:System.Xml.Serialization.XmlAttributes> class. - -4. Add the `XmlElementAttribute` object to the collection accessed through the <xref:System.Xml.Serialization.XmlAttributes.XmlElements%2A> property of <xref:System.Xml.Serialization.XmlAttributes> . - -5. Create an instance of the <xref:System.Xml.Serialization.XmlAttributeOverrides> class. - -6. Add the `XmlAttributes` to the <xref:System.Xml.Serialization.XmlAttributeOverrides>, passing the type of the object to override and the name of the member being overridden. - -7. Create an instance of the `XmlSerializer` class with `XmlAttributeOverrides`. - -8. Create an instance of the `Book` class, and serialize or deserialize it. - -## Example - -```vb -Public Function SerializeOverride() - ' Creates an XmlElementAttribute with the alternate name. - Dim myElementAttribute As XmlElementAttribute = _ - New XmlElementAttribute() - myElementAttribute.ElementName = "BookID" - Dim myAttributes As XmlAttributes = New XmlAttributes() - myAttributes.XmlElements.Add(myElementAttribute) - Dim myOverrides As XmlAttributeOverrides = New XmlAttributeOverrides() - myOverrides.Add(typeof(Book), "ISBN", myAttributes) - Dim mySerializer As XmlSerializer = _ - New XmlSerializer(GetType(Book), myOverrides) - Dim b As Book = New Book() - b.ISBN = "123456789" - ' Creates a StreamWriter to write the XML stream to. - Dim writer As StreamWriter = New StreamWriter("Book.xml") - mySerializer.Serialize(writer, b); -End Class -``` - -```csharp -public void SerializeOverride() -{ - // Creates an XmlElementAttribute with the alternate name. - XmlElementAttribute myElementAttribute = new XmlElementAttribute(); - myElementAttribute.ElementName = "BookID"; - XmlAttributes myAttributes = new XmlAttributes(); - myAttributes.XmlElements.Add(myElementAttribute); - XmlAttributeOverrides myOverrides = new XmlAttributeOverrides(); - myOverrides.Add(typeof(Book), "ISBN", myAttributes); + +Using the <xref:System.Xml.Serialization.XmlSerializer>, you can generate more than one XML stream with the same set of classes. You might want to do this because two different XML Web services require the same basic information, with only slight differences. For example, imagine two XML Web services that process orders for books, and thus both require ISBN numbers. One service uses the tag `<ISBN>` while the second uses the tag `<BookID>`. You have a class named `Book` that contains a field named `ISBN`. When an instance of the `Book` class is serialized, it will, by default, use the member name (ISBN) as the tag element name. For the first XML Web service, this is as expected. But to send the XML stream to the second XML Web service, you must override the serialization so that the tag's element name is `BookID`. + +## To create an XML stream with an alternate element name + +1. Create an instance of the <xref:System.Xml.Serialization.XmlElementAttribute> class. + +2. Set the <xref:System.Xml.Serialization.XmlElementAttribute.ElementName%2A> of the <xref:System.Xml.Serialization.XmlElementAttribute> to "BookID". + +3. Create an instance of the <xref:System.Xml.Serialization.XmlAttributes> class. + +4. Add the `XmlElementAttribute` object to the collection accessed through the <xref:System.Xml.Serialization.XmlAttributes.XmlElements%2A> property of <xref:System.Xml.Serialization.XmlAttributes> . + +5. Create an instance of the <xref:System.Xml.Serialization.XmlAttributeOverrides> class. + +6. Add the `XmlAttributes` to the <xref:System.Xml.Serialization.XmlAttributeOverrides>, passing the type of the object to override and the name of the member being overridden. + +7. Create an instance of the `XmlSerializer` class with `XmlAttributeOverrides`. + +8. Create an instance of the `Book` class, and serialize or deserialize it. + +## Example + +```vb +Public Function SerializeOverride() + ' Creates an XmlElementAttribute with the alternate name. + Dim myElementAttribute As XmlElementAttribute = _ + New XmlElementAttribute() + myElementAttribute.ElementName = "BookID" + Dim myAttributes As XmlAttributes = New XmlAttributes() + myAttributes.XmlElements.Add(myElementAttribute) + Dim myOverrides As XmlAttributeOverrides = New XmlAttributeOverrides() + myOverrides.Add(typeof(Book), "ISBN", myAttributes) + Dim mySerializer As XmlSerializer = _ + New XmlSerializer(GetType(Book), myOverrides) + Dim b As Book = New Book() + b.ISBN = "123456789" + ' Creates a StreamWriter to write the XML stream to. + Dim writer As StreamWriter = New StreamWriter("Book.xml") + mySerializer.Serialize(writer, b); +End Class +``` + +```csharp +public void SerializeOverride() +{ + // Creates an XmlElementAttribute with the alternate name. + XmlElementAttribute myElementAttribute = new XmlElementAttribute(); + myElementAttribute.ElementName = "BookID"; + XmlAttributes myAttributes = new XmlAttributes(); + myAttributes.XmlElements.Add(myElementAttribute); + XmlAttributeOverrides myOverrides = new XmlAttributeOverrides(); + myOverrides.Add(typeof(Book), "ISBN", myAttributes); XmlSerializer mySerializer = new XmlSerializer(typeof(Book), myOverrides); - Book b = new Book(); + Book b = new Book(); b.ISBN = "123456789"; - // Creates a StreamWriter to write the XML stream to. - StreamWriter writer = new StreamWriter("Book.xml"); - mySerializer.Serialize(writer, b); -} -``` - - The XML stream might resemble the following. - -```xml -<Book> - <BookID>123456789</BookID> -</Book> -``` - + // Creates a StreamWriter to write the XML stream to. + StreamWriter writer = new StreamWriter("Book.xml"); + mySerializer.Serialize(writer, b); +} +``` + + The XML stream might resemble the following. + +```xml +<Book> + <BookID>123456789</BookID> +</Book> +``` + ## See also - <xref:System.Xml.Serialization.XmlElementAttribute> diff --git a/docs/standard/serialization/schemaimporterextensions-element.md b/docs/standard/serialization/schemaimporterextensions-element.md index 065343f816c32..a908758eee013 100644 --- a/docs/standard/serialization/schemaimporterextensions-element.md +++ b/docs/standard/serialization/schemaimporterextensions-element.md @@ -2,56 +2,56 @@ title: "<schemaImporterExtensions> Element" description: The <schemaImporterExtensions> element contains types that are used by the XmlSchemaImporter for mapping of XSD types to .NET types. ms.date: "03/30/2017" -helpviewer_keywords: +helpviewer_keywords: - "XML serialization, configuration" - "schemaImporterExtensions element" - "<schemaImporterExtensions> element" ms.topic: reference --- -# \<schemaImporterExtensions> element - -Contains types that are used by the <xref:System.Xml.Serialization.XmlSchemaImporter> for mapping of XSD types to .NET types. For more information about configuration files, see [Configuration File Schema](../../framework/configure-apps/file-schema/index.md). - -## Syntax - -```xml -<schemaImporterExtensions> - <!-- Add types --> -</schemaImporterExtensions> -``` - -## Child Elements - -|Element|Description| -|-------------|-----------------| -|[\<add> Element for \<schemaImporterExtensions>](add-element-for-schemaimporterextensions.md)|Adds types that are used by the <xref:System.Xml.Serialization.XmlSchemaImporter> to create mappings.| - -## Parent Elements - -|Element|Description| -|-------------|-----------------| -|[\<system.xml.serialization> Element](system-xml-serialization-element.md)|The top-level element for controlling XML serialization.| - -## Example - - The following code example illustrates how to add types that are used by the <xref:System.Xml.Serialization.XmlSchemaImporter> when mapping XSD types to .NET types. - -```xml -<system.xml.serialization> - <schemaImporterExtensions> +# `<schemaImporterExtensions>` element + +Contains types that are used by the <xref:System.Xml.Serialization.XmlSchemaImporter> for mapping of XSD types to .NET types. For more information about configuration files, see [Configuration File Schema](../../framework/configure-apps/file-schema/index.md). + +## Syntax + +```xml +<schemaImporterExtensions> + <!-- Add types --> +</schemaImporterExtensions> +``` + +## Child Elements + +|Element|Description| +|-------------|-----------------| +|[\<add> Element for `<schemaImporterExtensions>`](add-element-for-schemaimporterextensions.md)|Adds types that are used by the <xref:System.Xml.Serialization.XmlSchemaImporter> to create mappings.| + +## Parent Elements + +|Element|Description| +|-------------|-----------------| +|[\<system.xml.serialization> Element](system-xml-serialization-element.md)|The top-level element for controlling XML serialization.| + +## Example + + The following code example illustrates how to add types that are used by the <xref:System.Xml.Serialization.XmlSchemaImporter> when mapping XSD types to .NET types. + +```xml +<system.xml.serialization> + <schemaImporterExtensions> <add name = "MobileCapabilities" type = "System.Web.Mobile.MobileCapabilities, System.Web.Mobile, Version - 2.0.0.0, Culture = neutral, - PublicKeyToken = b03f5f6f11d40a3a" /> - </schemaImporterExtensions> -</system.xml.serialization> -``` - + PublicKeyToken = b03f5f6f11d40a3a" /> + </schemaImporterExtensions> +</system.xml.serialization> +``` + ## See also - <xref:System.Xml.Serialization.XmlSchemaImporter> - <xref:System.Xml.Serialization.Configuration.DateTimeSerializationSection.DateTimeSerializationMode> - [Configuration File Schema](../../framework/configure-apps/file-schema/index.md) -- [\<dateTimeSerialization> Element](datetimeserialization-element.md) -- [\<add> Element for \<schemaImporterExtensions>](add-element-for-schemaimporterextensions.md) -- [\<system.xml.serialization> Element](system-xml-serialization-element.md) +- [`<dateTimeSerialization>` Element](datetimeserialization-element.md) +- [`<add>` Element for `<schemaImporterExtensions>`](add-element-for-schemaimporterextensions.md) +- [`<system.xml.serialization>` Element](system-xml-serialization-element.md) diff --git a/docs/standard/serialization/system-xml-serialization-element.md b/docs/standard/serialization/system-xml-serialization-element.md index 5345a1dd595a1..6a9f42337d6a7 100644 --- a/docs/standard/serialization/system-xml-serialization-element.md +++ b/docs/standard/serialization/system-xml-serialization-element.md @@ -8,7 +8,7 @@ helpviewer_keywords: - "<system.xml.serialization> element" ms.topic: reference --- -# \<system.xml.serialization> Element +# `<system.xml.serialization>` Element The top-level element for controlling XML serialization. For more information about configuration files, see [Configuration File Schema](../../framework/configure-apps/file-schema/index.md). @@ -66,6 +66,6 @@ The following code example illustrates how to specify the serialization mode of - <xref:System.Xml.Serialization.XmlSchemaImporter> - <xref:System.Xml.Serialization.Configuration.DateTimeSerializationSection.DateTimeSerializationMode> - [Configuration File Schema](../../framework/configure-apps/file-schema/index.md) -- [\<dateTimeSerialization> Element](datetimeserialization-element.md) -- [\<schemaImporterExtensions> Element](schemaimporterextensions-element.md) -- [\<add> Element for \<schemaImporterExtensions>](add-element-for-schemaimporterextensions.md) +- [`<dateTimeSerialization>` Element](datetimeserialization-element.md) +- [`<schemaImporterExtensions>` Element](schemaimporterextensions-element.md) +- [`<add>` Element for `<schemaImporterExtensions>`](add-element-for-schemaimporterextensions.md) diff --git a/docs/standard/serialization/xml-schema-definition-tool-xsd-exe.md b/docs/standard/serialization/xml-schema-definition-tool-xsd-exe.md index b445e4a1d1b4d..d0973f7248e76 100644 --- a/docs/standard/serialization/xml-schema-definition-tool-xsd-exe.md +++ b/docs/standard/serialization/xml-schema-definition-tool-xsd-exe.md @@ -24,7 +24,7 @@ xsd file.xsd {/classes | /dataset} [/element:element] [/parameters:file.xml] xsd {file.dll | file.exe} [-outputdir:directory] [/type:typename [...]][/parameters:file.xml] ``` - + > [!TIP] > For .NET Framework tools to function properly, you must set your `Path`, `Include`, and `Lib` environment variables correctly. Set these environment variables by running SDKVars.bat, which is located in the \<SDK>\\\<version>\Bin directory. SDKVars.bat must be executed in every command shell. @@ -148,7 +148,7 @@ To generate a code file, use the `<generateClasses>` element. The following exam |-------------|-----------------| |\<element>|Specifies an element in the .xsd file to generate code for.| |\<schemaImporterExtensions>|Specifies a type derived from the <xref:System.Xml.Serialization.Advanced.SchemaImporterExtension> class.| -|\<schema>|Specifies a XML Schema file to generate code for. Multiple XML Schema files can be specified using multiple \<schema> elements.| +|\<schema>|Specifies a XML Schema file to generate code for. Multiple XML Schema files can be specified using multiple `<schema>` elements.| The following table shows the attributes that can also be used with the `<generateClasses>` element. @@ -171,7 +171,7 @@ Options you can set for the `<generateDataSet>` element include the following. |Element|Description| |-------------|-----------------| -|\<schema>|Specifies an XML Schema file to generate code for. Multiple XML Schema files can be specified using multiple \<schema> elements.| +|\<schema>|Specifies an XML Schema file to generate code for. Multiple XML Schema files can be specified using multiple `<schema>` elements.| The following table shows the attributes that can be used with the `<generateDataSet>` element. diff --git a/docs/standard/serialization/xmlserializer-element.md b/docs/standard/serialization/xmlserializer-element.md index 048d98b298645..904470b9c6fe2 100644 --- a/docs/standard/serialization/xmlserializer-element.md +++ b/docs/standard/serialization/xmlserializer-element.md @@ -2,66 +2,66 @@ title: "<xmlSerializer> Element" description: The <xmlSerializer> element specifies whether an additional check of progress of the XmlSerializer is done. ms.date: "03/30/2017" -helpviewer_keywords: +helpviewer_keywords: - "<xmlSerializer> element" - "XML serialization, configuration" - "xmlSerializer element" ms.topic: reference --- -# \<xmlSerializer> Element - -Specifies whether an additional check of progress of the <xref:System.Xml.Serialization.XmlSerializer> is done. - - \<configuration> -\<system.xml.serialization> - -## Syntax - -```xml -<xmlSerializer checkDeserializerAdvance = "true|false" /> -``` - -## Attributes and Elements - - The following sections describe attributes, child elements, and parent elements. - -### Attributes - -|Attribute|Description| -|---------------|-----------------| -|**checkDeserializeAdvances**|Specifies whether the progress of the <xref:System.Xml.Serialization.XmlSerializer> is checked. Set the attribute to "true" or "false". The default is "true".| -|**useLegacySerializationGeneration**|Specifies whether the <xref:System.Xml.Serialization.XmlSerializer> uses legacy serialization generation which generates assemblies by writing C# code to a file and then compiling it to an assembly. The default is **false**.| - -### Child Elements - - None. - -### Parent Elements - -|Element|Description| -|-------------|-----------------| -|[\<system.xml.serialization> Element](system-xml-serialization-element.md)|Contains configuration settings for the <xref:System.Xml.Serialization.XmlSerializer> and <xref:System.Xml.Serialization.XmlSchemaImporter> classes.| - -## Remarks - - By default, the <xref:System.Xml.Serialization.XmlSerializer> provides an additional layer of security against potential denial of service attacks when deserializing untrusted data. It does so by attempting to detect infinite loops during deserialization. If such a condition is detected, an exception is thrown with the following message: "Internal error: deserialization failed to advance over underlying stream." - - Receiving this message does not necessarily indicate that a denial of service attack is in progress. In some rare circumstances, the infinite loop detection mechanism produces a false positive and the exception is thrown for a legitimate incoming message. If you find that in your particular application legitimate messages are being rejected by this extra layer of protection, set **checkDeserializeAdvances** attribute to "false". - -## Example - - The following code example sets the **checkDeserializeAdvances** attribute to "false". - -```xml -<configuration> - <system.xml.serialization> - <xmlSerializer checkDeserializeAdvances="false" /> - </system.xml.serialization> -</configuration> -``` - +# `<xmlSerializer>` Element + +Specifies whether an additional check of progress of the <xref:System.Xml.Serialization.XmlSerializer> is done. + + `<configuration>` + `<system.xml.serialization>` + +## Syntax + +```xml +<xmlSerializer checkDeserializerAdvance = "true|false" /> +``` + +## Attributes and Elements + + The following sections describe attributes, child elements, and parent elements. + +### Attributes + +|Attribute|Description| +|---------------|-----------------| +|**checkDeserializeAdvances**|Specifies whether the progress of the <xref:System.Xml.Serialization.XmlSerializer> is checked. Set the attribute to "true" or "false". The default is "true".| +|**useLegacySerializationGeneration**|Specifies whether the <xref:System.Xml.Serialization.XmlSerializer> uses legacy serialization generation which generates assemblies by writing C# code to a file and then compiling it to an assembly. The default is **false**.| + +### Child Elements + + None. + +### Parent Elements + +|Element|Description| +|-------------|-----------------| +|[\<system.xml.serialization> Element](system-xml-serialization-element.md)|Contains configuration settings for the <xref:System.Xml.Serialization.XmlSerializer> and <xref:System.Xml.Serialization.XmlSchemaImporter> classes.| + +## Remarks + + By default, the <xref:System.Xml.Serialization.XmlSerializer> provides an additional layer of security against potential denial of service attacks when deserializing untrusted data. It does so by attempting to detect infinite loops during deserialization. If such a condition is detected, an exception is thrown with the following message: "Internal error: deserialization failed to advance over underlying stream." + + Receiving this message does not necessarily indicate that a denial of service attack is in progress. In some rare circumstances, the infinite loop detection mechanism produces a false positive and the exception is thrown for a legitimate incoming message. If you find that in your particular application legitimate messages are being rejected by this extra layer of protection, set **checkDeserializeAdvances** attribute to "false". + +## Example + + The following code example sets the **checkDeserializeAdvances** attribute to "false". + +```xml +<configuration> + <system.xml.serialization> + <xmlSerializer checkDeserializeAdvances="false" /> + </system.xml.serialization> +</configuration> +``` + ## See also - <xref:System.Xml.Serialization.XmlSerializer> -- [\<system.xml.serialization> Element](system-xml-serialization-element.md) +- [`<system.xml.serialization>` Element](system-xml-serialization-element.md) - [XML and SOAP Serialization](xml-and-soap-serialization.md) diff --git a/docs/visual-basic/developing-apps/customizing-extending-my/packaging-and-deploying-custom-my-extensions.md b/docs/visual-basic/developing-apps/customizing-extending-my/packaging-and-deploying-custom-my-extensions.md index ecc9768b7b029..b648e644ff81a 100644 --- a/docs/visual-basic/developing-apps/customizing-extending-my/packaging-and-deploying-custom-my-extensions.md +++ b/docs/visual-basic/developing-apps/customizing-extending-my/packaging-and-deploying-custom-my-extensions.md @@ -59,7 +59,7 @@ The CustomData file contains a <`VBMyExtensionTemplate>` element that has attrib |`Version`|Required. A version number for the item template.| |`AssemblyFullName`|Optional. An assembly name. When a reference to this assembly is added to the project, the user will be prompted to add the `My` extension from this item template.| -### Add the \<CustomDataSignature> element to the .vstemplate file +### Add the `<CustomDataSignature>` element to the .vstemplate file To identify your Visual Studio item template as a `My` namespace extension, you must also modify the .vstemplate file for your item template. You must add a `<CustomDataSignature>` element to the `<TemplateData>` element. The `<CustomDataSignature>` element must contain the text `Microsoft.VisualBasic.MyExtension`, as shown in the following example. diff --git a/docs/visual-basic/developing-apps/programming/log-info/how-to-write-event-information-to-a-text-file.md b/docs/visual-basic/developing-apps/programming/log-info/how-to-write-event-information-to-a-text-file.md index 692888206d8b1..c9b3a738c1c49 100644 --- a/docs/visual-basic/developing-apps/programming/log-info/how-to-write-event-information-to-a-text-file.md +++ b/docs/visual-basic/developing-apps/programming/log-info/how-to-write-event-information-to-a-text-file.md @@ -28,7 +28,7 @@ You can use the `My.Application.Log` and `My.Log` objects to log information abo 2. Locate the `<listeners>` section in the application configuration file. - You will find the \<listeners> section in the \<source> section with the name attribute "DefaultSource", which is nested under the \<system.diagnostics> section, which is nested under the top-level \<configuration> section. + You will find the `<listeners>` section in the `<source>` section with the name attribute "DefaultSource", which is nested under the `<system.diagnostics>` section, which is nested under the top-level `<configuration>` section. 3. Add this element to that `<listeners>` section: diff --git a/docs/visual-basic/programming-guide/language-features/xml/how-to-modify-xml-literals.md b/docs/visual-basic/programming-guide/language-features/xml/how-to-modify-xml-literals.md index 19e2308f262bd..c03679304e0ba 100644 --- a/docs/visual-basic/programming-guide/language-features/xml/how-to-modify-xml-literals.md +++ b/docs/visual-basic/programming-guide/language-features/xml/how-to-modify-xml-literals.md @@ -17,7 +17,7 @@ Visual Basic provides convenient ways to modify XML literals. You can add or del 1. To modify the value of an XML literal, obtain a reference to the XML literal and set the `Value` property to the desired value. - The following code example updates the value of all the \<Price> elements in an XML document. + The following code example updates the value of all the `<Price>` elements in an XML document. [!code-vb[VbXmlSamples2#4](~/samples/snippets/visualbasic/VS_Snippets_VBCSharp/VbXmlSamples2/VB/Module2.vb#4)] @@ -214,7 +214,7 @@ Visual Basic provides convenient ways to modify XML literals. You can add or del If the element that you are replacing has sub-elements that must be preserved, set the value of the new <xref:System.Xml.Linq.XElement> object to the <xref:System.Xml.Linq.XContainer.Nodes%2A> property of the existing element. This will set the value of the new element to the inner XML of the existing element. Otherwise, you can set the value of the new element to the `Value` property of the existing element. - The following code example replaces all \<Description> elements with an \<Abstract> element. The content of the \<Description> element is preserved in the new \<Abstract> element by using the <xref:System.Xml.Linq.XContainer.Nodes%2A> property of the \<Description> <xref:System.Xml.Linq.XElement> object. + The following code example replaces all `<Description>` elements with an `<Abstract>` element. The content of the `<Description>` element is preserved in the new `<Abstract>` element by using the <xref:System.Xml.Linq.XContainer.Nodes%2A> property of the `<Description>` <xref:System.Xml.Linq.XElement> object. [!code-vb[VbXmlSamples2#8](~/samples/snippets/visualbasic/VS_Snippets_VBCSharp/VbXmlSamples2/VB/Module2.vb#8)] diff --git a/docs/visual-basic/programming-guide/language-features/xml/how-to-transform-xml-by-using-linq.md b/docs/visual-basic/programming-guide/language-features/xml/how-to-transform-xml-by-using-linq.md index 83e0dda309f47..152765392a407 100644 --- a/docs/visual-basic/programming-guide/language-features/xml/how-to-transform-xml-by-using-linq.md +++ b/docs/visual-basic/programming-guide/language-features/xml/how-to-transform-xml-by-using-linq.md @@ -55,7 +55,7 @@ The example in this topic transforms content from an XML source document to HTML [How to: Load XML from a File, String, or Stream](how-to-load-xml-from-a-file-string-or-stream.md). -3. After the code to create the source XML document, add the following code to retrieve all the \<Book> elements from the object and transform them into an HTML document. The list of \<Book> elements is created by using a LINQ query that returns a collection of <xref:System.Xml.Linq.XElement> objects that contain the transformed HTML. You can use embedded expressions to put the values from the source document in the new XML format. +3. After the code to create the source XML document, add the following code to retrieve all the `<Book>` elements from the object and transform them into an HTML document. The list of `<Book>` elements is created by using a LINQ query that returns a collection of <xref:System.Xml.Linq.XElement> objects that contain the transformed HTML. You can use embedded expressions to put the values from the source document in the new XML format. The resulting HTML document is written to a file by using the <xref:System.Xml.Linq.XElement.Save%2A> method. @@ -78,9 +78,9 @@ The example in this topic transforms content from an XML source document to HTML htmlOutput.Save("BookDescription.html") ``` -4. After `Sub Main` of `Module1`, add a new method (`Sub`) to transform a \<Description> node into the specified HTML format. This method is called by the code in the previous step and is used to preserve the format of the \<Description> elements. +4. After `Sub Main` of `Module1`, add a new method (`Sub`) to transform a `<Description>` node into the specified HTML format. This method is called by the code in the previous step and is used to preserve the format of the `<Description>` elements. - This method replaces sub-elements of the \<Description> element with HTML. The `ReplaceWith` method is used to preserve the location of the sub-elements. The transformed content of the \<Description> element is included in an HTML paragraph (\<p>) element. The <xref:System.Xml.Linq.XContainer.Nodes%2A> property is used to retrieve the transformed content of the \<Description> element. This ensures that sub-elements are included in the transformed content. + This method replaces sub-elements of the `<Description>` element with HTML. The `ReplaceWith` method is used to preserve the location of the sub-elements. The transformed content of the `<Description>` element is included in an HTML paragraph (\<p>) element. The <xref:System.Xml.Linq.XContainer.Nodes%2A> property is used to retrieve the transformed content of the `<Description>` element. This ensures that sub-elements are included in the transformed content. Add the following code after `Sub Main` of `Module1`. diff --git a/docs/visual-basic/programming-guide/program-structure/documenting-your-code-with-xml.md b/docs/visual-basic/programming-guide/program-structure/documenting-your-code-with-xml.md index 734a2223bcdfa..58096fc228d8b 100644 --- a/docs/visual-basic/programming-guide/program-structure/documenting-your-code-with-xml.md +++ b/docs/visual-basic/programming-guide/program-structure/documenting-your-code-with-xml.md @@ -24,11 +24,11 @@ XML documentation starts with `'''`. The processing of these comments has some r - Developers are free to create their own set of tags. There is a recommended set of tags (see [XML Comment Tags](../../language-reference/xmldoc/index.md)). Some of the recommended tags have special meanings: - - The \<param> tag is used to describe parameters. If used, the compiler will verify that the parameter exists and that all parameters are described in the documentation. If the verification fails, the compiler issues a warning. + - The `<param>` tag is used to describe parameters. If used, the compiler will verify that the parameter exists and that all parameters are described in the documentation. If the verification fails, the compiler issues a warning. - The `cref` attribute can be attached to any tag to provide a reference to a code element. The compiler verifies that this code element exists. If the verification fails, the compiler issues a warning. The compiler also respects any `Imports` statements when looking for a type described in the `cref` attribute. - - The \<summary> tag is used by IntelliSense in Visual Studio to display additional information about a type or member. + - The `<summary>` tag is used by IntelliSense in Visual Studio to display additional information about a type or member. ## Related sections diff --git a/docs/visual-basic/programming-guide/program-structure/how-to-create-xml-documentation.md b/docs/visual-basic/programming-guide/program-structure/how-to-create-xml-documentation.md index 2b3a4b5ebd834..95bc475a3dca3 100644 --- a/docs/visual-basic/programming-guide/program-structure/how-to-create-xml-documentation.md +++ b/docs/visual-basic/programming-guide/program-structure/how-to-create-xml-documentation.md @@ -28,7 +28,7 @@ This example shows how to add XML documentation comments to your code. 4. Add additional code that uses the type or member with the new XML documentation comments. - IntelliSense displays the text from the \<summary> tag for the type or member. + IntelliSense displays the text from the `<summary>` tag for the type or member. 5. Compile the code to generate an XML file containing the documentation comments. For more information, see [-doc](../../reference/command-line-compiler/doc.md).