diff --git a/xml/System/Activator.xml b/xml/System/Activator.xml index 349f7628f01..b625f8bf64e 100644 --- a/xml/System/Activator.xml +++ b/xml/System/Activator.xml @@ -87,8 +87,6 @@ A binder parameter specifies an object that searches an assembly for a suitable constructor. You can specify your own binder and search criteria. If no binder is specified, a default binder is used. For more information, see the and classes. - An evidence parameter affects the security policy and permissions for the constructor. For more information, see the class. - An instance of a type can be created at a local or remote site. If the type is created remotely, an activation attribute parameter specifies the URI of the remote site. The call to create the instance might pass through intermediary sites before it reaches the remote site. Other activation attributes can modify the environment, or context, in which the call operates at the remote and intermediary sites. If the instance is created locally, a reference to that object is returned. If the instance is created remotely, a reference to a proxy is returned. The remote object is manipulated through the proxy as if it were a local object. @@ -166,9 +164,6 @@ For information about other exceptions that can be thrown by invoked methods, see the Exceptions section of the and methods. -> [!NOTE] -> This method can be used to create nonpublic types if the caller has been granted with the flag and if the grant set of the assembly that contains the nonpublic types is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. - ]]> @@ -243,9 +238,6 @@ For information about other exceptions that can be thrown by invoked methods, see the Exceptions section of the and methods. -> [!NOTE] -> This method can be used to create nonpublic types if the caller has been granted with the flag and if the grant set of the assembly that contains the nonpublic types is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. - ]]> @@ -405,9 +397,6 @@ ## Remarks The constructor to be invoked must be accessible. -> [!NOTE] -> This method can be used to access nonpublic types if the caller has been granted with the flag and if the grant set of the assembly that contains the nonpublic types is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. - ## Examples The following code example demonstrates how to call the method. Instances of several different types are created and their default values are displayed. @@ -576,9 +565,6 @@ In .NET Core 3.0 and later versions, assembly loads triggered by this API are affected by the current value of . -> [!NOTE] -> This method can be used to create nonpublic types if the caller has been granted with the flag and if the grant set of the assembly that contains the nonpublic types is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. - ## Examples @@ -688,16 +674,7 @@ if a public or nonpublic parameterless constructor can match; if only a public parameterless constructor can match. Creates an instance of the specified type using that type's parameterless constructor. A reference to the newly created object, or for instances. - - [!NOTE] -> This method can be used to access nonpublic types and members if the caller has been granted with the flag and if the grant set of the assembly that contains the nonpublic types and members is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. - - ]]> - + To be added. is . @@ -810,9 +787,6 @@ ## Remarks The constructor to be invoked must be accessible and must provide the most specific match with the specified argument list. -> [!NOTE] -> This method can be used to access nonpublic types if the caller has been granted with the flag and if the grant set of the assembly that contains the nonpublic types is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. - ## Examples @@ -1019,9 +993,6 @@ In .NET Core 3.0 and later versions, assembly loads triggered by this API are affected by the current value of . -> [!NOTE] -> This method can be used to create nonpublic types if the caller has been granted with the flag and if the grant set of the nonpublic types is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. - ]]> @@ -1136,9 +1107,6 @@ An error occurred when attempting remote activation in a target specified in [!NOTE] -> This method can be used to access nonpublic types if the caller has been granted with the flag and if the grant set of the assembly that contains the nonpublic types is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. - ]]> @@ -1253,9 +1221,6 @@ An error occurred when attempting remote activation in a target specified in [!NOTE] -> This method can be used to access nonpublic types and members if the caller has been granted with the flag and if the grant set of the assembly that contains the nonpublic types and members is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. - ]]> @@ -1370,9 +1335,6 @@ An error occurred when attempting remote activation in a target specified in [!NOTE] -> This method can be used to access nonpublic types and members if the caller has been granted with the flag and if the grant set of the nonpublic types and members is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. - ]]> @@ -1500,9 +1462,6 @@ An error occurred when attempting remote activation in a target specified in . -> [!NOTE] -> This method can be used to create nonpublic types and members if the caller has been granted with the flag and if the grant set of the assembly that contains the nonpublic types and members is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. - ]]> @@ -1699,9 +1658,6 @@ An error occurred when attempting remote activation in a target specified in to unwrap the return value. -> [!NOTE] -> This method can be used to create nonpublic types and members if the caller has been granted with the flag and if the grant set of the assembly that contains the nonpublic types and members is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. - ]]> diff --git a/xml/System/AppContext.xml b/xml/System/AppContext.xml index 9087417bfe1..5366e8a4857 100644 --- a/xml/System/AppContext.xml +++ b/xml/System/AppContext.xml @@ -66,8 +66,6 @@ Provides members for setting and retrieving data about an application's context. For more information about this API, see Supplemental API remarks for AppContext. - <runtime> Element - <AppContextSwitchOverrides> Element @@ -285,34 +283,20 @@ In .NET 5 and later versions, for bundled assemblies, the value returned is the class enables library writers to provide a uniform opt-out mechanism for new functionality for their users. It establishes a loosely coupled contract between components in order to communicate an opt-out request. This capability is typically important when a change is made to existing functionality. Conversely, there is already an implicit opt-in for new functionality. + +The class enables library writers to provide a uniform opt-out mechanism for new functionality for their users. It establishes a loosely coupled contract between components to communicate an opt-out request. This capability is typically important when a change is made to existing functionality. Conversely, there is already an implicit opt-in for new functionality. The method is called by an application (or a library) to declare the value of a switch (which is always a value) that a dependent library defines. The switch is always implicitly `false`, which provides the new behavior. Setting the switch to `true` enables it, which provides the legacy behavior. Explicitly setting the switch to `false` also provides the new behavior. The dependent library can then check the value of the switch by calling the method. > [!NOTE] -> It's beneficial to use a consistent format for switch names, since they are a formal contract exposed by a library. The following are two obvious formats. +> It's beneficial to use a consistent format for switch names, since they're a formal contract exposed by a library. The following are two obvious formats: > > - *Switch*.*namespace*.*switchname* > - *Switch*.*library*.*switchname* - For applications running on .NET Framework, in addition to setting the value of a switch programmatically, it can also be set: - -- By adding the switch name and value to the [\](/dotnet/framework/configure-apps/file-schema/runtime/appcontextswitchoverrides-element) element in the [\](/dotnet/framework/configure-apps/file-schema/runtime/runtime-element) section of an application configuration file. For example, the following defines a switch named `Libraries.FPLibrary.UseExactFloatingPointComparison` whose value is `False`. - - ```xml - - - - - - ``` - -- By adding a string value whose name is the name of the switch to the **HKLM\SOFTWARE\Microsoft\\.NETFramework\AppContext** (and **HKLM\SOFTWARE\Wow6432Node\Microsoft\\.NETFramework\AppContext**) subkeys in the registry. Its value must be the string representation of a that can be parsed by the method; that is, it must be "True", "true", "False", or "false". - - If the registry entry exists, its value is overwritten by the `isEnabled` argument when is called. That is, the most recent call to the method overrides the value defined in the registry, in an app configuration file, or by previous calls to the method. - ## Examples - The following line of code sets a switch named `Switch.AmazingLib.ThrowOnException` to `true`, which enables a legacy behavior. The library can then check whether a library consumer has set the value of the switch by calling the method. + +The following line of code sets a switch named `Switch.AmazingLib.ThrowOnException` to `true`, which enables a legacy behavior. The library can then check whether a library consumer has set the value of the switch by calling the method. :::code language="csharp" source="~/snippets/csharp/System/AppContext/Overview/TestValue1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/System.AppContext.Class/fs/TestValue1.fs" id="Snippet1"::: diff --git a/xml/System/AppDomain.xml b/xml/System/AppDomain.xml index 982401d2599..7e4285235b7 100644 --- a/xml/System/AppDomain.xml +++ b/xml/System/AppDomain.xml @@ -112,8 +112,6 @@ Application domains, which are represented by objects, h This class implements the , , and interfaces. - You should never create a remotable wrapper for an object. Doing so could publish a remote reference to that , exposing methods such as to remote access and effectively destroying code access security for that . Malicious clients connecting to the remoted could obtain access to any resource the itself has access to. Do not create remotable wrappers for any type that extends and that implements methods that could be used by malicious clients to bypass the security system. - > [!CAUTION] > The default value for the property is `false`. This setting is unsafe for services. To prevent services from downloading partially trusted code, set this property to `true`. @@ -127,10 +125,6 @@ Application domains, which are represented by objects, h ]]> - How To: Configure an Application Domain - How To: Create an Application Domain - How to: Load Assemblies into an Application Domain - How to: Unload an Application Domain @@ -543,11 +537,6 @@ Application domains, which are represented by objects, h For guidance on the use of this event, see [Resolving Assembly Loads](/dotnet/standard/assembly/resolve-loads). - Beginning with the .NET Framework 4, the property returns the assembly that requested the assembly load that could not be resolved. For example, the loader might be unable to load a dependency of the requesting assembly because the requesting assembly and its dependency are not in the probing path. Knowing the identity of the requesting assembly might be useful in locating the dependency or in identifying the correct version, if more than one version of the dependency is available. For more information, see . - -> [!IMPORTANT] -> Beginning with the .NET Framework 4, the event is raised for all assemblies, including resource assemblies. In earlier versions, the event was not raised for resource assemblies. If the operating system is localized, the handler might be called multiple times: once for each culture in the fallback chain. - For this event, the property returns the assembly name before policy is applied. > [!IMPORTANT] @@ -796,7 +785,6 @@ Application domains, which are represented by objects, h The operation is attempted on an unloaded application domain. - Shadow Copying Assemblies @@ -1115,9 +1103,6 @@ This method overload uses the information from the If `securityInfo` is not supplied, the evidence from the current application domain is used. -> [!IMPORTANT] -> Do not use this method overload to create sandboxed application domains. Beginning with the .NET Framework 4, the evidence that is supplied for `securityInfo` no longer affects the grant set of the application domain. Use the method overload to create sandboxed application domains. - ## Examples @@ -1185,9 +1170,6 @@ This method overload uses the information from the If `securityInfo` is not supplied, the evidence from the current application domain is used. -> [!IMPORTANT] -> Do not use this method overload to create sandboxed application domains. Beginning with the .NET Framework 4, the evidence that is supplied for `securityInfo` no longer affects the grant set of the application domain. Use the method overload to create sandboxed application domains. - ## Examples @@ -1333,9 +1315,6 @@ This method overload uses the information from the For more information about shadow copying, see and [Shadow Copying Assemblies](/dotnet/framework/app-domains/shadow-copy-assemblies). -> [!IMPORTANT] -> Do not use this method overload to create sandboxed application domains. Beginning with the .NET Framework 4, the evidence that is supplied for `securityInfo` no longer affects the grant set of the application domain. Use the method overload to create sandboxed application domains. - ## Examples @@ -1413,9 +1392,6 @@ This method overload uses the information from the For more information about shadow copying, see and [Shadow Copying Assemblies](/dotnet/framework/app-domains/shadow-copy-assemblies). -> [!IMPORTANT] -> Do not use this method overload to create sandboxed application domains. Beginning with the .NET Framework 4, the evidence that is supplied for `securityInfo` no longer affects the grant set of the application domain. Use the method overload to create sandboxed application domains. - ]]> @@ -3288,9 +3264,6 @@ This method overload uses the information from the ## Remarks This method should only be used to define a dynamic assembly in the current application domain. For more information, see the method overload. -> [!NOTE] -> During the development of code that emits dynamic assemblies, it is recommended that you use an overload of the method that specifies evidence and permissions, supply the evidence you want the dynamic assembly to have, and include in `refusedPermissions`. Including in the `refusedPermissions` parameter ensures that the MSIL is verified. A limitation of this technique is that it also causes to be thrown when used with code that demands full trust. - ## Examples @@ -3365,8 +3338,6 @@ This method overload uses the information from the This method should be used only to define a dynamic assembly in the current application domain. For more information about this restriction, see the method overload. - This method overload is introduced in the .NET Framework 3.5. - ## Examples @@ -3509,9 +3480,6 @@ This method overload uses the information from the ## Remarks This method should only be used to define a dynamic assembly in the current application domain. For more information, see the method overload. -> [!NOTE] -> During the development of code that emits dynamic assemblies, it is recommended that you use an overload of the method that specifies evidence and permissions, supply the evidence you want the dynamic assembly to have, and include in `refusedPermissions`. Including in the `refusedPermissions` parameter ensures that the MSIL is verified. A limitation of this technique is that it also causes to be thrown when used with code that demands full trust. - ## Examples @@ -4137,17 +4105,10 @@ This method overload uses the information from the The permission requests specified for the `requiredPermissions`, `optionalPermissions`, and `refusedPermissions` parameters are used only if the `evidence` parameter is also supplied, or if the dynamic assembly is saved and reloaded into memory. -> [!NOTE] -> When you develop code that emits dynamic assemblies, we recommend that you include the flag in the `refusedPermissions` parameter. The inclusion of this flag ensures that the Microsoft intermediate language (MSIL) will be verified. This technique will detect the unintentional generation of unverifiable code, which otherwise is very difficult to detect. A limitation of this technique is that it also causes to be thrown when it is used with code that demands full trust. - - Only fully trusted callers can supply evidence when defining a dynamic . The runtime maps the through the security policy to determine the granted permissions. Partially trusted callers must supply `null` for the `evidence` parameter. If `evidence` is `null`, the runtime copies the permission sets (that is, the current grant and deny sets) from the caller's assembly to the dynamic assembly that is being defined, and marks the policy as resolved. - If the dynamic assembly is saved to disk, subsequent loads will get grants based on policies that are associated with the location where the dynamic assembly was saved. If `isSynchronized` is `true`, the following methods of the resulting will be synchronized: , , , , , and . If two of these methods are called on different threads, one will block until the other is completed. - This method overload is introduced in the .NET Framework 3.5. - ]]> @@ -5194,9 +5155,6 @@ This method overload uses the information from the The method does not create a new process or application domain, and it does not execute the entry point method on a new thread. -> [!NOTE] -> When you use the method with an parameter, pieces of evidence are merged. Pieces of evidence supplied as an argument to the method supersede pieces of evidence supplied by the loader. - ]]> @@ -5357,9 +5315,6 @@ This method overload uses the information from the This method does not create a new process or application domain, and it does not execute the entry point method on a new thread. -> [!NOTE] -> When you use the method with an parameter, pieces of evidence are merged. Pieces of evidence supplied as an argument to the method supersede pieces of evidence supplied by the loader. - ]]> The assembly specified by is not found. @@ -5435,9 +5390,6 @@ This method overload uses the information from the This method does not create a new process or application domain, and it does not execute the entry point method on a new thread. -> [!NOTE] -> When you use the method with an parameter, pieces of evidence are merged. Pieces of evidence supplied as an argument to the method supersede pieces of evidence supplied by the loader. - ]]> @@ -5545,7 +5497,6 @@ This method overload uses the information from the - How to: Receive First-Chance Exception Notifications @@ -6076,8 +6027,6 @@ The friendly name of the default application domain is the file name of the proc ## Remarks This method tests whether the specified compatibility switch has been set for the current application domain. Compatibility switches typically restore a behavior (such as the way strings are sorted) that was changed between versions of the .NET Framework. They are set by calling the method before creating an application domain. - The following table provides examples of compatibility switches that can be set to restore the behavior of earlier versions of the .NET Framework. - |Switch|Meaning| |------------|-------------| |"NetFx40_LegacySecurityPolicy"|Code access security (CAS) for the .NET Framework 3.5 is enabled in this application domain. See [<NetFx40_LegacySecurityPolicy> Element](/dotnet/framework/configure-apps/file-schema/runtime/netfx40-legacysecuritypolicy-element).| @@ -6273,31 +6222,9 @@ The friendly name of the default application domain is the file name of the proc Gets a value that indicates whether assemblies that are loaded into the current application domain execute with full trust. - .NET Framework only: if assemblies that are loaded into the current application domain execute with full trust; otherwise, . - - .NET Core and .NET 5+: in all cases. + in all cases in modern .NET. - - method overload, unless the permissions that are granted to the application domain are equivalent to full trust. - - - -## Examples - The following example demonstrates the property and the property with fully trusted and partially trusted application domains. The fully trusted application domain is the default application domain for the application. The partially trusted application domain is created by using the method overload. - - The example uses a `Worker` class that derives from , so it can be marshaled across application domain boundaries. The example creates a `Worker` object in the default application domain. It then calls the `TestIsFullyTrusted` method to display the property value for the application domain and for two assemblies that are loaded into the application domain: mscorlib, which is part of the .NET Framework, and the example assembly. The application domain is fully trusted, so both assemblies are fully trusted. - - The example creates another `Worker` object in a sandboxed application domain and again calls the `TestIsFullyTrusted` method. Mscorlib is always trusted, even in a partially trusted application domain, but the example assembly is partially trusted. - - :::code language="csharp" source="~/snippets/csharp/System/AppDomain/IsFullyTrusted/example.cs" id="Snippet1"::: - :::code language="fsharp" source="~/snippets/fsharp/System/AppDomain/IsFullyTrusted/example.fs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System/AppDomain/IsFullyTrusted/example.vb" id="Snippet1"::: - - ]]> - + To be added. @@ -6341,18 +6268,7 @@ The friendly name of the default application domain is the file name of the proc Gets a value that indicates whether the current application domain has a set of permissions that is granted to all assemblies that are loaded into the application domain. if the current application domain has a homogenous set of permissions; otherwise, . - - method overload. Sandboxed application domains have a homogenous set of permissions; that is, the same set of permissions is granted to all partially trusted assemblies that are loaded into the application domain. A sandboxed application domain optionally has a list of strong-named assemblies that are exempt from this permission set, and instead run with full trust. - - Fully trusted code can use the property to determine the homogenous grant set of a sandboxed application domain. - - This property also returns `true` for the default application domain of a desktop application, because that application domain grants full trust to all assemblies. - - ]]> - + To be added. @@ -6434,8 +6350,6 @@ The friendly name of the default application domain is the file name of the proc ## Remarks For information that is common to all overloads of this method, see the method overload. - Beginning with the .NET Framework 4, the trust level of an assembly that is loaded by using this method is the same as the trust level of the application domain. - ## Examples The following sample demonstrates the use of loading a raw assembly. @@ -6705,8 +6619,6 @@ The friendly name of the default application domain is the file name of the proc ## Remarks For information that is common to all overloads of this method, see the method overload. - Beginning with the .NET Framework 4, the trust level of an assembly that is loaded by using this method is the same as the trust level of the application domain. - ## Examples The following sample demonstrates the use of loading a raw assembly. @@ -6918,8 +6830,6 @@ The friendly name of the default application domain is the file name of the proc ## Remarks For information that is common to all overloads of this method, see the method overload. - Beginning with the .NET Framework 4, the trust level of an assembly that is loaded by using this method is the same as the trust level of the application domain. - ]]> @@ -6998,7 +6908,6 @@ The friendly name of the default application domain is the file name of the proc The current process attempted to assign the value to this property. Application Domain Resource Monitoring - <appdomainResourceMonitoring> Element @@ -7284,8 +7193,6 @@ The friendly name of the default application domain is the file name of the proc [!INCLUDE[cas-deprecated](~/includes/cas-deprecated.md)] - Sandboxed application domains that were created by using the method overload have a homogenous set of permissions; that is, the same set of permissions is granted to all partially trusted assemblies that are loaded into the application domain. A sandboxed application domain optionally has a list of strong-named assemblies that are exempt from this permission set, and instead run with full trust. - ]]> @@ -7357,13 +7264,6 @@ The friendly name of the default application domain is the file name of the proc ## Remarks The for this event can perform termination activities, such as closing files, releasing storage and so on, before the process ends. - Beginning with the .NET Framework version 2.0, this event is raised in each application domain that registers an event handler. - -> [!NOTE] -> In .NET Framework, the total execution time of all event handlers is limited, just as the total execution time of all finalizers is limited at process shutdown. The default is two seconds. An unmanaged host can change this execution time by calling the [ICLRPolicyManager::SetTimeout](/dotnet/framework/unmanaged-api/hosting/iclrpolicymanager-settimeout-method) method with the [OPR_ProcessExit](/dotnet/framework/unmanaged-api/hosting/eclroperation-enumeration) enumeration value. This time limit does not exist in .NET Core and .NET 5+. - - In the .NET Framework versions 1.0 and 1.1, this event is raised only in the default application domain, and only if an event handler is registered in the default application domain. - To register an event handler for this event, you must have the required permissions, or a is thrown. For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). @@ -7437,8 +7337,6 @@ The friendly name of the default application domain is the file name of the proc > [!IMPORTANT] > This event is raised only for missing dependencies of the assembly that you are loading into the reflection-only context (for example, by using the method). It is not raised if the assembly that you are loading cannot be found. - Beginning with the .NET Framework 4, the property returns the assembly that requested the assembly load that could not be resolved. Knowing the identity of the requesting assembly might be useful in identifying the correct version of the dependency, if more than one version is available. For more information, see . - For this event, the property returns the assembly name before policy is applied. For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). @@ -7651,8 +7549,6 @@ The friendly name of the default application domain is the file name of the proc > [!IMPORTANT] > This event is not raised if resolution fails because no file can be found for a valid linked resource. It is raised if a manifest resource stream cannot be found, but it is not raised if an individual resource key cannot be found. - Beginning with the .NET Framework 4, the property contains the assembly that requested the resource. For more information, see . - To register an event handler for this event, you must have the required permissions, or a is thrown. For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). @@ -7791,19 +7687,8 @@ The friendly name of the default application domain is the file name of the proc The fully qualified path to the shadow copy location. Establishes the specified directory path as the location where assemblies are shadow copied. - - property is not set. See the property. - - For more information on shadow copying see [Shadow Copying Assemblies](/dotnet/framework/app-domains/shadow-copy-assemblies). - - ]]> - + To be added. The operation is attempted on an unloaded application domain. - - Shadow Copying Assemblies @@ -8191,7 +8076,6 @@ The friendly name of the default application domain is the file name of the proc ]]> The operation is attempted on an unloaded application domain. - Shadow Copying Assemblies @@ -8279,7 +8163,6 @@ The friendly name of the default application domain is the file name of the proc ]]> The operation is attempted on an unloaded application domain. - Shadow Copying Assemblies @@ -8457,7 +8340,6 @@ The friendly name of the default application domain is the file name of the proc The operation is attempted on an unloaded application domain. - Shadow Copying Assemblies @@ -8808,8 +8690,6 @@ The friendly name of the default application domain is the file name of the proc However, the event does not occur if the runtime knows it is not possible to find a type in certain assemblies. For example, this event does not occur if the type is not found in a static assembly because the runtime knows types cannot be added dynamically to static assemblies. - Beginning with the .NET Framework 4, the property contains the assembly that requested the type. For more information, see . - To register an event handler for this event, you must have the required permissions, or a is thrown. For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). diff --git a/xml/System/AppDomainSetup.xml b/xml/System/AppDomainSetup.xml index 3198258a88b..76699108781 100644 --- a/xml/System/AppDomainSetup.xml +++ b/xml/System/AppDomainSetup.xml @@ -78,11 +78,10 @@ This class implements the interface. > [!CAUTION] -> The default value for the property is false. This setting is unsafe for services. To help prevent services from downloading partially trusted code, set this property to true +> The default value for the property is false. This setting is unsafe for services. To help prevent services from downloading partially trusted code, set this property to true. ]]> - How To: Configure an Application Domain @@ -658,7 +657,6 @@ - Shadow Copying Assemblies @@ -706,7 +704,6 @@ ]]> - Runtime Settings Schema @@ -1093,8 +1090,6 @@ (APTCA) attribute can be made conditional by setting its property to . An APTCA assembly that is marked with cannot be used by partially trusted code unless the host application allows it. - The host of a sandboxed application domain allows code in the application domain to use assemblies with conditional APTCA attributes by creating an array that contains the simple name and public key of each assembly, and assigning the array to this property. For example, an element of the array might look like the following: "MyAssembly, PublicKey=0024000004800000940000000602000000240000525341310004000001000100db2ad5e5fedc67ea526ff72ad426ef68e08e241d296c499eedfec6648dcc62b1a12f72be5833a45bbec481b68415b08a5fbc9f9ef247b523dd72bbea65bb532784ddc5c704544bd2f1c2d46fdbe41e4f949e76f9947357b2d5cf8ca9f970701bbd6e8ab64ad31b20ad0be9b56dae4f6b83332b92a2a3b8ea2804c40efbc0b6b9". > [!IMPORTANT] @@ -1226,8 +1221,6 @@ ## Remarks Disabling interface caching has a significant impact on the performance of interop calls. - This member is introduced in the .NET Framework 3.5. - ]]> @@ -1263,17 +1256,18 @@ method to specify that one or more of these breaking changes should be rolled back for the application domain, to make the behavior compatible with the previous version of the .NET Framework. - Each time you call this method, it replaces the existing switch settings. To erase the settings, specify `null` for the `switches` parameter. +Major versions of .NET Framework sometimes introduce breaking changes from the previous version. Use the method to specify that one or more of these breaking changes should be rolled back for the application domain, to make the behavior compatible with the previous version of .NET Framework. + +Each time you call this method, it replaces the existing switch settings. To erase the settings, specify `null` for the `switches` parameter. - The set of string values you provide for `switches` can be a simple string array, because arrays implement the interface. +The set of string values you provide for `switches` can be a simple string array, because arrays implement the interface. - The following table provides examples of compatibility switches that can be set to restore the behavior of earlier versions of the .NET Framework. +The following table provides examples of compatibility switches that can be set to restore the behavior of earlier versions of the .NET Framework. -|Switch|Meaning| -|------------|-------------| -|"NetFx40_LegacySecurityPolicy"|Code access security (CAS) for the .NET Framework 3.5 is enabled in this application domain. See [<NetFx40_LegacySecurityPolicy> Element](/dotnet/framework/configure-apps/file-schema/runtime/netfx40-legacysecuritypolicy-element).| +| Switch | Meaning | +|--------------------------------|---------| +| "NetFx40_LegacySecurityPolicy" | Code access security (CAS) for the .NET Framework 3.5 is enabled in this application domain. See [<NetFx40_LegacySecurityPolicy> Element](/dotnet/framework/configure-apps/file-schema/runtime/netfx40-legacysecuritypolicy-element). | |"NetFx40_Legacy20SortingBehavior"|String sorting defaults for the .NET Framework 3.5 are enabled in this application domain. Successfully restoring legacy sorting behavior also requires the sort00001000.dll dynamic link library to be available on the local system. See [<CompatSortNLSVersion> Element](/dotnet/framework/configure-apps/file-schema/runtime/compatsortnlsversion-element).| |"NetFx40_Legacy40SortingBehavior"|String sorting defaults for the .NET Framework 4 and Unicode 5.0 are enabled in this application domain. Successfully restoring legacy sorting behavior also requires the sort00060101.dll dynamic link library to be available on the local system.| |"NetFx40_TimeSpanLegacyFormatMode"| formatting behavior for the .NET Framework 3.5 is enabled in this application domain. See [<TimeSpan_LegacyFormatMode> Element](/dotnet/framework/configure-apps/file-schema/runtime/timespan-legacyformatmode-element) and the "Restoring Legacy TimeSpan Formatting" section of the topic.| @@ -1282,10 +1276,6 @@ ]]> - <NetFx40_LegacySecurityPolicy> Element - <CompatSortNLSVersion> Element - <TimeSpan_LegacyFormatMode> Element - <UseRandomizedStringHashAlgorithm> Element @@ -1329,7 +1319,6 @@ ]]> - Runtime Settings Schema @@ -1453,7 +1442,6 @@ - Shadow Copying Assemblies @@ -1495,7 +1483,6 @@ - Shadow Copying Assemblies diff --git a/xml/System/AppDomainUnloadedException.xml b/xml/System/AppDomainUnloadedException.xml index f1b6ccb3332..c6c4d1e82bb 100644 --- a/xml/System/AppDomainUnloadedException.xml +++ b/xml/System/AppDomainUnloadedException.xml @@ -74,20 +74,11 @@ that is not handled in user code has the following effect: - -- If a thread was started in managed code, it is terminated. The unhandled exception is not allowed to terminate the application. - -- If a task is executing on a thread, it is terminated and the thread is returned to the thread pool. The unhandled exception is not allowed to terminate the application. - -- If a thread started in unmanaged code, such as the main application thread, it is terminated. The unhandled exception is allowed to proceed, and the operating system terminates the application. uses the HRESULT COR_E_APPDOMAINUNLOADED, which has the value 0x80131014. For a list of initial property values for an instance of , see the constructors. - - ## Examples This section contains two code examples. The first example demonstrates the effects of an on various threads, and the second shows elementary application domain unloading. diff --git a/xml/System/ApplicationId.xml b/xml/System/ApplicationId.xml index 660b967e9aa..40cfa493464 100644 --- a/xml/System/ApplicationId.xml +++ b/xml/System/ApplicationId.xml @@ -72,13 +72,6 @@ is used by the class to identify a manifest-based application. - - - ## Examples The following code example displays the properties by obtaining the from an instance created using the for the currently executing manifest-based application. diff --git a/xml/System/Array.xml b/xml/System/Array.xml index 211dc99058f..2210ca0e4e7 100644 --- a/xml/System/Array.xml +++ b/xml/System/Array.xml @@ -110,8 +110,6 @@ The array size is limited to a total of 4 billion elements, and to a maximum index of 0X7FEFFFFF in any given dimension (0X7FFFFFC7 for byte arrays and arrays of single-byte structures). - **.NET Framework only:** By default, the maximum size of an is 2 gigabytes (GB). In a 64-bit environment, you can avoid the size restriction by setting the `enabled` attribute of the [gcAllowVeryLargeObjects](/dotnet/framework/configure-apps/file-schema/runtime/gcallowverylargeobjects-element) configuration element to `true` in the run-time environment. - Single-dimensional arrays implement the , , , and generic interfaces. The implementations are provided to arrays at run time, and as a result, the generic interfaces do not appear in the declaration syntax for the class. In addition, there are no reference topics for interface members that are accessible only by casting an array to the generic interface type (explicit interface implementations). The key thing to be aware of when you cast an array to one of these interfaces is that members which add, insert, or remove elements throw . objects provide information about array type declarations. objects with the same array type share the same object. diff --git a/xml/System/ArraySegment`1.xml b/xml/System/ArraySegment`1.xml index e49d57aa445..7848b422497 100644 --- a/xml/System/ArraySegment`1.xml +++ b/xml/System/ArraySegment`1.xml @@ -108,9 +108,6 @@ ## Remarks is a wrapper around an array that delimits a range of elements in that array. Multiple instances can refer to the same original array and can overlap. The original array must be one-dimensional and must have zero-based indexing. -> [!NOTE] -> implements the interface starting with the .NET Framework 4.6; in previous versions of the .NET Framework, the structure did not implement this interface. - The structure is useful whenever the elements of an array will be manipulated in distinct segments. For example: - You can pass an object that represents only a portion of an array as an argument to a method, rather than call a relatively expensive method like to pass a copy of a portion of an array. diff --git a/xml/System/Attribute.xml b/xml/System/Attribute.xml index 9e297d7199e..da3cd7d08d2 100644 --- a/xml/System/Attribute.xml +++ b/xml/System/Attribute.xml @@ -319,9 +319,6 @@ When implementing your own class derived from , you can o ## Remarks Use the method if you expect more than one value to be returned, or will be thrown. -> [!NOTE] -> Starting with the .NET Framework version 2.0, this method returns security attributes if the attributes are stored in the new metadata format. Assemblies compiled with version 2.0 or later use the new format. - ## Examples The following code example illustrates the use of the method taking an as a parameter. @@ -396,9 +393,6 @@ When implementing your own class derived from , you can o ## Remarks A match is determined in the same way described in the Return Value section of . -> [!NOTE] -> Starting with the .NET Framework version 2.0, this method returns security attributes on types, methods, and constructors if the attributes are stored in the new metadata format. Assemblies compiled with version 2.0 or later use the new format. - ## Examples The following code example illustrates the use of the method taking a as a parameter. @@ -623,11 +617,6 @@ When implementing your own class derived from , you can o [!NOTE] -> Starting with the .NET Framework version 2.0, this method returns security attributes if the attributes are stored in the new metadata format. Assemblies compiled with version 2.0 or later use the new format. - ## Examples The following code example illustrates the use of the method taking an as a parameter. @@ -701,11 +690,6 @@ When implementing your own class derived from , you can o [!NOTE] -> Starting with the .NET Framework version 2.0, this method returns security attributes on types, methods, and constructors if the attributes are stored in the new metadata format. Assemblies compiled with version 2.0 or later use the new format. - ## Examples The following code example illustrates the use of the method taking a as a parameter. @@ -933,11 +917,6 @@ When implementing your own class derived from , you can o [!NOTE] -> Starting with the .NET Framework version 2.0, this method returns security attributes if the attributes are stored in the new metadata format. Assemblies compiled with version 2.0 or later use the new format. - ## Examples The following example retrieves the custom attributes found in the current assembly. @@ -1000,9 +979,6 @@ When implementing your own class derived from , you can o ## Remarks The return value contains the custom attributes for ancestors of `element`. -> [!NOTE] -> Starting with the .NET Framework version 2.0, this method returns security attributes on methods, constructors, and types if the attributes are stored in the new metadata format. Assemblies compiled with version 2.0 or later use the new format. - ## Examples The following code example demonstrates the use of , taking a as a parameter. @@ -1252,11 +1228,6 @@ When implementing your own class derived from , you can o [!NOTE] -> Starting with the .NET Framework version 2.0, this method returns security attributes if the attributes are stored in the new metadata format. Assemblies compiled with version 2.0 or later use the new format. - ## Examples The following code example demonstrates the use of , taking an as a parameter. @@ -1323,9 +1294,6 @@ When implementing your own class derived from , you can o ## Remarks The return value contains the custom attributes for ancestors of `element` if `inherit` is `true`. -> [!NOTE] -> Starting with the .NET Framework version 2.0, this method returns security attributes on methods, constructors, and types if the attributes are stored in the new metadata format. Assemblies compiled with version 2.0 or later use the new format. - ## Examples The following code example demonstrates the use of , taking a as a parameter. @@ -1664,11 +1632,6 @@ When implementing your own class derived from , you can o [!NOTE] -> Starting with the .NET Framework version 2.0, this method returns security attributes if the attributes are stored in the new metadata format. Assemblies compiled with version 2.0 or later use the new format. - ## Examples The following code example demonstrates the use of , taking an as a parameter. @@ -1742,9 +1705,6 @@ When implementing your own class derived from , you can o ## Remarks The return value contains the custom attributes for ancestors of `element`. -> [!NOTE] -> Starting with the .NET Framework version 2.0, this method returns security attributes on methods, constructors, and types if the attributes are stored in the new metadata format. Assemblies compiled with version 2.0 or later use the new format. - ## Examples The following code example demonstrates the use of , taking a as a parameter. @@ -1970,9 +1930,6 @@ When implementing your own class derived from , you can o ## Remarks The return value contains the custom attributes for ancestors of `element` if `inherit` is `true`. -> [!NOTE] -> Starting with the .NET Framework version 2.0, this method returns security attributes on methods, constructors, and types if the attributes are stored in the new metadata format. Assemblies compiled with version 2.0 or later use the new format. - ## Examples The following code example demonstrates the use of , taking a as a parameter. @@ -2176,11 +2133,6 @@ When implementing your own class derived from , you can o [!NOTE] -> Starting with the .NET Framework version 2.0, this method returns `true` if the assembly has security attributes stored in the new metadata format. Assemblies compiled with version 2.0 or later use the new format. - ## Examples The following code example illustrates the use of , taking an as a parameter. @@ -2248,9 +2200,6 @@ When implementing your own class derived from , you can o ## Remarks The ancestors of `element` are searched for custom attributes. -> [!NOTE] -> Starting with the .NET Framework version 2.0, this method returns `true` if a type, method, or constructor has security attributes stored in the new metadata format. Assemblies compiled with version 2.0 or later use the new format. - ## Examples The following code example illustrates the use of , taking a as a parameter. @@ -2457,11 +2406,6 @@ When implementing your own class derived from , you can o [!NOTE] -> Starting with the .NET Framework version 2.0, this method returns `true` if the assembly has security attributes stored in the new metadata format. Assemblies compiled with version 2.0 or later use the new format. - ## Examples The following code example illustrates the use of , taking an as a parameter. @@ -2528,11 +2472,6 @@ When implementing your own class derived from , you can o [!NOTE] -> Starting with the .NET Framework version 2.0, this method returns `true` if a type, method, or constructor has security attributes stored in the new metadata format. Assemblies compiled with version 2.0 or later use the new format. - ## Examples The following code example illustrates the use of , taking a as a parameter. diff --git a/xml/System/Char.xml b/xml/System/Char.xml index 907996039a3..35408cef3ef 100644 --- a/xml/System/Char.xml +++ b/xml/System/Char.xml @@ -1239,8 +1239,6 @@ The following code example demonstrates some of the methods in method does not always return the same value as the method when it is passed a particular character as a parameter. The method is designed to reflect the current version of the Unicode standard. In contrast, although the method usually reflects the current version of the Unicode standard, it may return a character's category based on a previous version of the standard or it may return a category that differs from the current standard in order to preserve backward compatibility. As a result, we recommend that you use the method instead of . - Starting with .NET Framework 4.6.2, Unicode characters are classified based on [The Unicode Standard, Version 8.0.0](https://www.unicode.org/versions/Unicode8.0.0/). In versions of the .NET Framework from the .NET Framework 4 to the .NET Framework 4.6.1, they are classified based on [The Unicode Standard, Version 6.3.0](https://www.unicode.org/versions/Unicode6.3.0/). - ]]> @@ -1306,8 +1304,6 @@ The following code example demonstrates some of the methods in method does not always return the same value as the method when it is passed a particular character as a parameter. The method is designed to reflect the current version of the Unicode standard. In contrast, although the method usually reflects the current version of the Unicode standard, it may return a character's category based on a previous version of the standard or it may return a category that differs from the current standard in order to preserve backward compatibility. As a result, we recommend that you use the method instead of . - Starting with .NET Framework 4.6.2, Unicode characters are classified based on [The Unicode Standard, Version 8.0.0](https://www.unicode.org/versions/Unicode8.0.0/). In versions of the .NET Framework from the .NET Framework 4 to the .NET Framework 4.6.1, they are classified based on [The Unicode Standard, Version 6.3.0](https://www.unicode.org/versions/Unicode6.3.0/). - ]]> diff --git a/xml/System/Console.xml b/xml/System/Console.xml index 467c5f2a5d5..ee181dde2e2 100644 --- a/xml/System/Console.xml +++ b/xml/System/Console.xml @@ -1515,8 +1515,6 @@ Columns are numbered from left to right starting at 0. Rows are numbered from to ## Remarks The console uses the input encoding to translate keyboard input into a corresponding character. The input encoding incorporates a code page that maps 256 keyboard character codes to individual characters. Different code pages include different special characters, typically customized for a language or a group of languages. - Starting with the .NET Framework 4, a property get operation may return a cached value instead of the console's current input encoding. This can occur if the value of the property is modified by some means other than an assignment to the property, such as calling the Windows `SetConsoleCP` function or using the `chcp` command from a PowerShell script. - ]]> The property value in a set operation is . @@ -2827,8 +2825,6 @@ This method can be used to reacquire the standard output stream after it has bee ## Remarks The console uses the output encoding to translate characters written by an application into corresponding console display characters. The default code page that the console uses is determined by the system locale. - Starting with the .NET Framework 4, a property get operation may return a cached value instead of the console's current output encoding. This can occur if the value of the property is modified by some means other than an assignment to the property, such as calling the Windows `SetConsoleOutputCP` function. - ]]> The property value in a set operation is . diff --git a/xml/System/DateTime.xml b/xml/System/DateTime.xml index 7162fd71d5e..29bb385b152 100644 --- a/xml/System/DateTime.xml +++ b/xml/System/DateTime.xml @@ -1733,13 +1733,14 @@ For applications in which portability of date and time data or a limited degree . Instead, it returns a new whose value is the result of this operation. - The fractional part of `value` is the fractional part of a day. For example, 4.5 is equivalent to 4 days, 12 hours, 0 minutes, 0 seconds, 0 milliseconds, and 0 ticks. +This method does not change the value of this . Instead, it returns a new whose value is the result of this operation. + +The fractional part of `value` is the fractional part of a day. For example, 4.5 is equivalent to 4 days, 12 hours, 0 minutes, 0 seconds, 0 milliseconds, and 0 ticks. - In .NET Framework, the `value` parameter is rounded to the nearest millisecond. In .NET 7 and later versions, the full precision of the `value` parameter is used. However, due to the inherent imprecision of floating point math, the resulting precision will vary. +In .NET 7 and later versions, the full precision of the `value` parameter is used. However, due to the inherent imprecision of floating point math, the resulting precision will vary. - The method takes into account leap years and the number of days in a month when performing date arithmetic. +The method takes into account leap years and the number of days in a month when performing date arithmetic. ## Examples The following example uses the method to determine the day of the week 36 days after the current date. @@ -1805,13 +1806,14 @@ For applications in which portability of date and time data or a limited degree . Instead, it returns a new whose value is the result of this operation. The property of the returned object is the same as that of `value`. - The fractional part of `value` is the fractional part of an hour. For example, 4.5 is equivalent to 4 hours, 30 minutes, 0 seconds, 0 milliseconds, and 0 ticks. +This method does not change the value of this . Instead, it returns a new whose value is the result of this operation. The property of the returned object is the same as that of `value`. + +The fractional part of `value` is the fractional part of an hour. For example, 4.5 is equivalent to 4 hours, 30 minutes, 0 seconds, 0 milliseconds, and 0 ticks. - In .NET Framework, the `value` parameter is rounded to the nearest millisecond. In .NET 7 and later versions, the full precision of the `value` parameter is used. However, due to the inherent imprecision of floating point math, the resulting precision will vary. +In .NET 7 and later versions, the full precision of the `value` parameter is used. However, due to the inherent imprecision of floating point math, the resulting precision will vary. - Converting time intervals of less than an hour to a fraction can involve a loss of precision if the result is a non-terminating repeating decimal. (For example, one minute is 0.016667 of an hour.) If this is problematic, you can use the method, which enables you to specify more than one kind of time interval in a single method call and eliminates the need to convert time intervals to fractional parts of an hour. +Converting time intervals of less than an hour to a fraction can involve a loss of precision if the result is a non-terminating repeating decimal. (For example, one minute is 0.016667 of an hour.) If this is problematic, you can use the method, which enables you to specify more than one kind of time interval in a single method call and eliminates the need to convert time intervals to fractional parts of an hour. ## Examples The following example uses the method to add a number of whole and fractional values to a date and time. It also illustrates the loss of precision caused by passing the method a value that includes a fractional component. @@ -1866,11 +1868,9 @@ For applications in which portability of date and time data or a limited degree ## Remarks -This method does not change the value of this . Instead, it returns a new - whose value is the result of this operation. +This method does not change the value of this . Instead, it returns a new whose value is the result of this operation. -The fractional part of value is the fractional part of a microsecond. - For example, 4.5 is equivalent to 4 microseconds and 50 ticks, where one microsecond = 10 ticks. +The fractional part of value is the fractional part of a microsecond. For example, 4.5 is equivalent to 4 microseconds and 50 ticks, where one microsecond = 10 ticks. The value parameter is rounded to the nearest integer. @@ -1930,11 +1930,12 @@ The value parameter is rounded to the nearest integer. . Instead, it returns a new whose value is the result of this operation. - The fractional part of `value` is the fractional part of a millisecond. For example, 4.5 is equivalent to 4 milliseconds and 5000 ticks, where one millisecond = 10000 ticks. +This method does not change the value of this . Instead, it returns a new whose value is the result of this operation. + +The fractional part of `value` is the fractional part of a millisecond. For example, 4.5 is equivalent to 4 milliseconds and 5000 ticks, where one millisecond = 10000 ticks. - In .NET Framework, the `value` parameter is rounded to the nearest millisecond. In .NET 7 and later versions, the full precision of the `value` parameter is used. However, due to the inherent imprecision of floating point math, the resulting precision will vary. +In .NET 7 and later versions, the full precision of the `value` parameter is used. However, due to the inherent imprecision of floating point math, the resulting precision will vary. ## Examples The following example uses the method to add one millisecond and 1.5 milliseconds to a value. It then displays each new value and displays the difference between it and the original value. The difference is displayed both as a time span and as a number of ticks. The example makes it clear that one millisecond equals 10,000 ticks. It also shows that fractional milliseconds are rounded before performing the addition; the value that results from adding 1.5 milliseconds to the original date is 2 milliseconds greater than the original date. @@ -2001,11 +2002,12 @@ The value parameter is rounded to the nearest integer. . Instead, it returns a new whose value is the result of this operation. - The fractional part of `value` is the fractional part of a minute. For example, 4.5 is equivalent to 4 minutes, 30 seconds, 0 milliseconds, and 0 ticks. +This method does not change the value of this . Instead, it returns a new whose value is the result of this operation. - In .NET Framework, the `value` parameter is rounded to the nearest millisecond. In .NET 7 and later versions, the full precision of the `value` parameter is used. However, due to the inherent imprecision of floating point math, the resulting precision will vary. +The fractional part of `value` is the fractional part of a minute. For example, 4.5 is equivalent to 4 minutes, 30 seconds, 0 milliseconds, and 0 ticks. + +In .NET 7 and later versions, the full precision of the `value` parameter is used. However, due to the inherent imprecision of floating point math, the resulting precision will vary. ## Examples The following example uses the method to add a number of whole and fractional values to a date and time. @@ -2078,8 +2080,6 @@ The value parameter is rounded to the nearest integer. The time-of-day part of the resulting object remains the same as this instance. - - ## Examples The following example adds between zero and fifteen months to the last day of December, 2015. In this case, the AddMonths method returns the date of the last day of each month, and successfully handles leap years. @@ -2147,11 +2147,12 @@ The value parameter is rounded to the nearest integer. . Instead, it returns a new whose value is the result of this operation. - The fractional part of `value` is the fractional part of a second. For example, 4.5 is equivalent to 4 seconds, 500 milliseconds, and 0 ticks. +This method does not change the value of this . Instead, it returns a new whose value is the result of this operation. + +The fractional part of `value` is the fractional part of a second. For example, 4.5 is equivalent to 4 seconds, 500 milliseconds, and 0 ticks. - In .NET Framework, the `value` parameter is rounded to the nearest millisecond. In .NET 7 and later versions, the full precision of the `value` parameter is used. However, due to the inherent imprecision of floating point math, the resulting precision will vary. +In .NET 7 and later versions, the full precision of the `value` parameter is used. However, due to the inherent imprecision of floating point math, the resulting precision will vary. ## Examples The following example uses the method to add 30 seconds and the number of seconds in one day to a value. It then displays each new value and displays the difference between it and the original value. The difference is displayed both as a time span and as a number of ticks. @@ -3373,13 +3374,12 @@ The value parameter is rounded to the nearest integer. whose property is . +A Windows file time is a 64-bit value that represents the number of 100-nanosecond intervals that have elapsed since 12:00 midnight, January 1, 1601 A.D. (C.E.) Coordinated Universal Time (UTC). Windows uses a file time to record when an application creates, accesses, or writes to a file. +The `fileTime` parameter specifies a file time expressed in 100-nanosecond ticks. +The return value is a whose property is . ## Examples The following example demonstrates the method. @@ -3460,11 +3460,12 @@ The value parameter is rounded to the nearest integer. whose property is . +The return value is a whose property is . ]]> @@ -4945,12 +4946,10 @@ juillet 2009 The property is frequently used to measure performance. However, because of its low resolution, it is not suitable for use as a benchmarking tool. A better alternative is to use the class. - Starting with the .NET Framework version 2.0, the return value is a whose property returns . +The return value is a whose property is . > [!NOTE] -> You can also use the property to retrieve the current local date and time. It allows a local time to be expressed unambiguously as a single point in time, which in turn makes that time value portable across computers. - - +> You can also use the property to retrieve the current local date and time. It allows a local time to be expressed unambiguously as a single point in time, which in turn makes that time value portable across computers. ## Examples The following example uses the and properties to retrieve the current local date and time and the current universal coordinated (UTC) date and time. It then uses the formatting conventions of a number of cultures to display the strings, along with the values of their properties. @@ -8274,11 +8273,10 @@ In general, the ticks represent the time according to the time zone specified by whose property returns . - - Because it returns the current date without the current time, the property is suitable for use in applications that work with dates only. For details, see [Choosing Between DateTime, DateTimeOffset, TimeSpan, and TimeZoneInfo](/dotnet/standard/datetime/choosing-between-datetime). In contrast, the property returns the current time without the current date, and the property returns both the current date and the current time. +The return value is a whose property is . +Because it returns the current date without the current time, the property is suitable for use in applications that work with dates only. For details, see [Choosing Between DateTime, DateTimeOffset, TimeSpan, and TimeZoneInfo](/dotnet/standard/datetime/choosing-between-datetime). In contrast, the property returns the current time without the current date, and the property returns both the current date and the current time. ## Examples The following example uses the property to retrieve the current date. It also illustrates how a value can be formatted using some of the standard date and time format strings. Note that the output produced by the third call to the method uses the g format specifier to include the time component, which is zero. @@ -8486,25 +8484,21 @@ In general, the ticks represent the time according to the time zone specified by . The conversion also takes into account the daylight saving time rule that applies to the time represented by the current object. -> [!IMPORTANT] -> On Windows XP systems, the method recognizes only the current adjustment rule when converting from UTC to local time. As a result, conversions for periods before the current adjustment rule came into effect may not accurately reflect the difference between UTC and local time. +The local time is equal to the Coordinated Universal Time (UTC) time plus the UTC offset. For more information about the UTC offset, see . The conversion also takes into account the daylight saving time rule that applies to the time represented by the current object. - Starting with the .NET Framework version 2.0, the value returned by the method is determined by the property of the current object. The following table describes the possible results. +The value returned by the method is determined by the property of the current object. The following table describes the possible results. -|Kind|Results| -|----------|-------------| -||This instance of is converted to local time.| -||No conversion is performed.| -||This instance of is assumed to be a UTC time, and the conversion is performed as if were .| +| Kind | Results | +|----------------------------------------|---------------------------------------------------------------------| +| | This instance of is converted to local time. | +| | No conversion is performed. | +| | This instance of is assumed to be a UTC time, and the conversion is performed as if were . | > [!NOTE] -> The method converts a value from UTC to local time. To convert the time in any designated time zone to local time, use the method. - - The value returned by the conversion is a whose property always returns . Consequently, a valid result is returned even if is applied repeatedly to the same . - +> The method converts a value from UTC to local time. To convert the time in any designated time zone to local time, use the method. +The value returned by the conversion is a whose property always returns . Consequently, a valid result is returned even if is applied repeatedly to the same . ## Examples The following example demonstrates the method. Note that the exact output depends on the current culture and the local time zone of the system on which it is run. @@ -9396,12 +9390,10 @@ The following example illustrates how the string representation of a [!IMPORTANT] > On Windows XP systems, the method recognizes only the current adjustment rule when converting from local time to UTC. As a result, conversions for periods before the current adjustment rule came into effect may not accurately reflect the difference between local time and UTC. - Starting with the .NET Framework version 2.0, the value returned by the method is determined by the property of the current object. The following table describes the possible results. - -|Kind|Results| -|----------|-------------| -||No conversion is performed.| -||The current object is converted to UTC.| +| Kind | Results | +|----------------------------------|----------------------------------------------------------------| +| | No conversion is performed. | +| | The current object is converted to UTC. | ||The current object is assumed to be a local time, and the conversion is performed as if were .| > [!NOTE] @@ -9409,7 +9401,7 @@ The following example illustrates how the string representation of a method is determined by the property of the current object. The following table describes the possible results. ## Examples The following example demonstrates the method. @@ -10530,11 +10522,12 @@ The following example illustrates the whose property returns . +The resolution of this property depends on the system timer, which depends on the underlying operating system. It tends to be between 0.5 and 15 milliseconds. + +The return value is a whose property returns . - An alternative to using is . While the former indicates that a date and time value is Coordinated Universal Time (UTC) by assigning to its property, the latter assigns the date and time value the UTC time's offset (equal to ). +An alternative to using is . While the former indicates that a date and time value is Coordinated Universal Time (UTC) by assigning to its property, the latter assigns the date and time value the UTC time's offset (equal to ). ## Examples The following example uses the method to demonstrate how the property influences the and conversion methods. diff --git a/xml/System/DateTimeOffset.xml b/xml/System/DateTimeOffset.xml index b69adeefb60..d5f06560c3f 100644 --- a/xml/System/DateTimeOffset.xml +++ b/xml/System/DateTimeOffset.xml @@ -1114,7 +1114,7 @@ The property is earlier than The fractional part of the `days` parameter is the fractional part of a day. For example, 4.5 is equivalent to 4 days, 12 hours, 0 minutes, 0 seconds, 0 milliseconds. -In .NET Framework, the `days` parameter is rounded to the nearest millisecond. In .NET 7 and later versions, the full precision of the `days` parameter is used. However, due to the inherent imprecision of floating point math, the resulting precision will vary. +In .NET 7 and later versions, the full precision of the `days` parameter is used. However, due to the inherent imprecision of floating point math, the resulting precision will vary. > [!NOTE] > This method returns a new object. It does not modify the value of the current object by adding `days` to its date and time. @@ -1123,8 +1123,6 @@ In .NET Framework, the `days` parameter is rounded to the nearest millisecond. I Converting time intervals of less than a day to a fraction can involve a loss of precision. If this is problematic, you can use the method, which enables you to specify more than one kind of time interval in a single method call and eliminates the need to convert time intervals to fractional parts of a day. - - ## Examples The following example uses the method to list the dates that fall on Monday, the start of the work week, in March 2008. @@ -1194,7 +1192,7 @@ In .NET Framework, the `days` parameter is rounded to the nearest millisecond. I The fractional part of the `hours` parameter is the fractional part of an hour. For example, 4.5 is equivalent to 4 hours, 30 minutes, 0 seconds, 0 milliseconds. -In .NET Framework, the `hours` parameter is rounded to the nearest millisecond. In .NET 7 and later versions, the full precision of the `hours` parameter is used. However, due to the inherent imprecision of floating point math, the resulting precision will vary. +In .NET 7 and later versions, the full precision of the `hours` parameter is used. However, due to the inherent imprecision of floating point math, the resulting precision will vary. > [!NOTE] > This method returns a new object. It does not modify the value of the current object by adding `hours` to its date and time. @@ -1395,7 +1393,7 @@ The fractional part of the `milliseconds` parameter is the fractional part of a The fractional part of the `minutes` parameter is the fractional part of a minute. For example, 4.5 is equivalent to 4 minutes, 30 seconds, 0 milliseconds. -In .NET Framework, the `minutes` parameter is rounded to the nearest millisecond. In .NET 7 and later versions, the full precision of the `minutes` parameter is used. However, due to the inherent imprecision of floating point math, the resulting precision will vary. +In .NET 7 and later versions, the full precision of the `minutes` parameter is used. However, due to the inherent imprecision of floating point math, the resulting precision will vary. > [!NOTE] > This method returns a new object. It does not modify the value of the current object by adding `minutes` to its date and time. @@ -1539,13 +1537,13 @@ In .NET Framework, the `minutes` parameter is rounded to the nearest millisecond ## Remarks The fractional part of the `seconds` parameter is the fractional part of a second. The value of fractional parts of a second are shown in the following table. -|Second value|Equivalent| -|------------------|----------------| -|.1 second|100 milliseconds| -|.01 second|10 milliseconds| -|.001 second|1 millisecond| +| Second value | Equivalent | +|--------------|------------------| +| .1 second | 100 milliseconds | +| .01 second | 10 milliseconds | +| .001 second | 1 millisecond | -In .NET Framework, the `seconds` parameter is rounded to the nearest millisecond. In .NET 7 and later versions, the full precision of the `seconds` parameter is used. However, due to the inherent imprecision of floating point math, the resulting precision will vary. +In .NET 7 and later versions, the full precision of the `seconds` parameter is used. However, due to the inherent imprecision of floating point math, the resulting precision will vary. > [!NOTE] > This method returns a new object. It does not modify the value of the current object by adding `seconds` to its date and time. diff --git a/xml/System/Double.xml b/xml/System/Double.xml index e03fb322fbc..730b194e95f 100644 --- a/xml/System/Double.xml +++ b/xml/System/Double.xml @@ -4943,8 +4943,6 @@ The following code example illustrates the use of data type, the method throws an . - On .NET Core 3.0 and later versions, no exception is thrown when `s` is out of range of the data type. In most cases, the method will return or . However, there is a small set of values that are considered to be closer to the maximum or minimum values of than to positive or negative infinity. In those cases, the method returns or . If a separator is encountered in the `s` parameter during a parse operation, and the applicable currency or number decimal and group separators are the same, the parse operation assumes that the separator is a decimal separator rather than a group separator. For more information about separators, see , , , and . @@ -5173,8 +5171,6 @@ If a separator is encountered in the `s` parameter during a parse operation, and :::code language="fsharp" source="~/snippets/fsharp/System/Double/Parse/parse2.fs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System/Double/Parse/parse2.vb" id="Snippet3"::: -On .NET Framework, if `s` is out of range of the data type, the method throws an . - On .NET Core 3.0 and later versions, no exception is thrown when `s` is out of range of the data type. In most cases, the method will return or . However, there is a small set of values that are considered to be closer to the maximum or minimum values of than to positive or negative infinity. In those cases, the method returns or . If a separator is encountered in the `s` parameter during a parse operation, and the applicable currency or number decimal and group separators are the same, the parse operation assumes that the separator is a decimal separator rather than a group separator. For more information about separators, see , , , and . @@ -5300,8 +5296,6 @@ If a separator is encountered in the `s` parameter during a parse operation, and :::code language="fsharp" source="~/snippets/fsharp/System/Double/Parse/parse2.fs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System/Double/Parse/parse2.vb" id="Snippet3"::: -On .NET Framework, if `s` is out of range of the data type, the method throws an . - On .NET Core 3.0 and later versions, no exception is thrown when `s` is out of range of the data type. In most cases, the method will return or . However, there is a small set of values that are considered to be closer to the maximum or minimum values of than to positive or negative infinity. In those cases, the method returns or . If a separator is encountered in the `s` parameter during a parse operation, and the applicable currency or number decimal and group separators are the same, the parse operation assumes that the separator is a decimal separator rather than a group separator. For more information about separators, see , , , and . @@ -5566,8 +5560,6 @@ If `s` is out of range of the data type, the method returns :::code language="fsharp" source="~/snippets/fsharp/System/Double/Parse/parse2.fs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System/Double/Parse/parse2.vb" id="Snippet3"::: -On .NET Framework, if `s` is out of range of the data type, the method throws an . - On .NET Core 3.0 and later versions, no exception is thrown when `s` is out of range of the data type. In most cases, the method will return or . However, there is a small set of values that are considered to be closer to the maximum or minimum values of than to positive or negative infinity. In those cases, the method returns or . If a separator is encountered in the `s` parameter during a parse operation, and the applicable currency or number decimal and group separators are the same, the parse operation assumes that the separator is a decimal separator rather than a group separator. For more information about separators, see , , , and . @@ -10294,8 +10286,6 @@ Tau is approximately 6.2831853071795864769. :::code language="fsharp" source="~/snippets/fsharp/System/Double/TryParse/tryparse2.fs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System/Double/TryParse/tryparse2.vb" id="Snippet3"::: -On .NET Framework, if `s` is out of range of the data type, the method throws an . - On .NET Core 3.0 and later versions, no exception is thrown when `s` is out of range of the data type. In most cases, the method calculates a result of or . However, there is a small set of values that are considered to be closer to the maximum or minimum values of than to positive or negative infinity. In those cases, the method calculates a result of or . If a separator is encountered in the `s` parameter during a parse operation, and the decimal and group separators are the same, the parse operation assumes that the separator is a decimal separator rather than a group separator. For more information about separators, see , , , and . @@ -10697,8 +10687,6 @@ If a separator is encountered in the `s` parameter during a parse operation, and :::code language="fsharp" source="~/snippets/fsharp/System/Double/TryParse/tryparse2.fs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System/Double/TryParse/tryparse2.vb" id="Snippet3"::: -On .NET Framework, if `s` is out of range of the data type, the method throws an . - On .NET Core 3.0 and later versions, no exception is thrown when `s` is out of range of the data type. In most cases, the method calculates a result of or . However, there is a small set of values that are considered to be closer to the maximum or minimum values of than to positive or negative infinity. In those cases, the method calculates a result of or . If a separator is encountered in the `s` parameter during a parse operation, and the applicable currency or number decimal and group separators are the same, the parse operation assumes that the separator is a decimal separator rather than a group separator. For more information about separators, see , , , and . diff --git a/xml/System/Environment.xml b/xml/System/Environment.xml index 9da8fdd8dfe..4e7ee1f6bfd 100644 --- a/xml/System/Environment.xml +++ b/xml/System/Environment.xml @@ -1523,8 +1523,6 @@ The following example creates environment variables for the property returns `true` only after the finalizer thread has been started. When the property returns `true`, you can determine whether an application domain is being unloaded or the CLR itself is shutting down by calling the method. This method returns `true` if finalizers are called because the application domain is unloading or `false` if the CLR is shutting down. - The property returns `false` if the finalizer thread has not been started. By using this property, you can determine whether to access static variables in your finalization code. If either an application domain or the CLR is shutting down, you cannot reliably access any object that has a finalization method and that is referenced by a static field. This is because these objects may have already been finalized. @@ -2860,28 +2858,7 @@ This value updates at the same frequency as the underlying interrupt timer for t Gets a version consisting of the major, minor, build, and revision numbers of the common language runtime. The version of the common language runtime. - - property returns the .NET runtime version number. - - For .NET Framework versions 4, 4.5, 4.5.1, and 4.5.2, the property returns a object whose string representation has the form `4.0.30319.xxxxx`. For .NET Framework 4.6 and later versions, it has the form `4.0.30319.42000`. - -> [!WARNING] -> For the .NET Framework 4.5 and later, we do not recommend using the property to detect the version of the runtime; instead, you can determine the version of the common language runtime by querying the registry. For more information, see [How to: Determine Which .NET Framework Versions Are Installed](/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed). - - For more information about the version of the common language runtime that is installed with each version of the .NET Framework, see [Versions and Dependencies](/dotnet/framework/migration-guide/versions-and-dependencies). - -## Examples - The following example displays the version of the common language runtime. - - :::code language="csharp" source="~/snippets/csharp/System/Environment/Version/version.cs" id="Snippet1"::: - :::code language="fsharp" source="~/snippets/fsharp/System/Environment/Version/version.fs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System/Environment/Version/version.vb" id="Snippet1"::: - - ]]> - + For .NET Core 3.x and .NET 5+, this property returns the .NET runtime version number. diff --git a/xml/System/Exception.xml b/xml/System/Exception.xml index 6be3534212f..67eb89e06c0 100644 --- a/xml/System/Exception.xml +++ b/xml/System/Exception.xml @@ -96,7 +96,6 @@ Represents errors that occur during application execution. For more information about this API, see Supplemental API remarks for Exception. Handling and Throwing Exceptions - Packaging and Deploying Resources in Desktop Apps Assertions in Managed Code @@ -800,8 +799,6 @@ The following example demonstrates how to add and retrieve information using the ## Remarks HRESULT is a 32-bit value, divided into three different fields: a severity code, a facility code, and an error code. The severity code indicates whether the return value represents information, warning, or error. The facility code identifies the area of the system responsible for the error. The error code is a unique number that is assigned to represent the exception. Each exception is mapped to a distinct HRESULT. When managed code throws an exception, the runtime passes the HRESULT to the COM client. When unmanaged code returns an error, the HRESULT is converted to an exception, which is then thrown by the runtime. For information about HRESULT values and their corresponding .NET Framework exceptions, see [How to: Map HRESULTs and Exceptions](/dotnet/framework/interop/how-to-map-hresults-and-exceptions). See [Common HRESULT Values](/windows/win32/seccrypto/common-hresult-values) in the Windows documentation for a list of the values you are most likely to encounter. - Starting with the .NET Framework 4.5, the property's setter is protected, whereas its getter is public. In previous versions of the .NET Framework, both getter and setter are protected. - ## Examples @@ -813,7 +810,6 @@ The following example demonstrates how to add and retrieve information using the ]]> - How to: Map HRESULTs and Exceptions Common HRESULT Values diff --git a/xml/System/GC.xml b/xml/System/GC.xml index a489570a01b..84d26e8cc43 100644 --- a/xml/System/GC.xml +++ b/xml/System/GC.xml @@ -405,14 +405,12 @@ Skipping zero-initialization using this API only has a material performance bene All objects, regardless of how long they have been in memory, are considered for collection; however, objects that are referenced in managed code are not collected. Use this method to force the system to try to reclaim the maximum amount of available memory. - Starting with the .NET Framework 4.5.1, you can compact the large object heap (LOH) by setting the property to before calling the method, as the following example illustrates. +You can compact the large object heap (LOH) by setting the property to before calling the method, as the following example illustrates. :::code language="csharp" source="~/snippets/csharp/System/GC/Collect/lohcompactionmode1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/GC/Collect/lohcompactionmode1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/GC/Collect/lohcompactionmode1.vb" id="Snippet1"::: - - ## Examples The following example demonstrates how to use the method to perform a collection on all generations of memory. The code generates a number of unused objects, and then calls the method to clean them from memory. diff --git a/xml/System/Lazy`1.xml b/xml/System/Lazy`1.xml index de62b995af2..35ee62f3a5d 100644 --- a/xml/System/Lazy`1.xml +++ b/xml/System/Lazy`1.xml @@ -185,7 +185,6 @@ By default, all public and protected members of the class are thread safe and may be used concurrently from multiple threads. These thread-safety guarantees may be removed optionally and per instance, using parameters to the type's constructors. - Lazy Initialization Lazy Expressions (F#) @@ -280,7 +279,6 @@ ]]> - Lazy Initialization @@ -355,7 +353,6 @@ ]]> - Lazy Initialization @@ -448,7 +445,6 @@ is . - Lazy Initialization @@ -543,7 +539,6 @@ contains an invalid value. - Lazy Initialization @@ -687,7 +682,6 @@ An instance created with this constructor is usable by multiple threads concurre is . - Lazy Initialization @@ -798,7 +792,6 @@ An instance created with this constructor is usable by multiple threads concurre contains an invalid value. is . - Lazy Initialization @@ -865,7 +858,6 @@ An instance created with this constructor is usable by multiple threads concurre ]]> - Lazy Initialization @@ -990,7 +982,6 @@ An instance created with this constructor is usable by multiple threads concurre The instance is initialized to use the parameterless constructor of the type that is being lazily initialized, and permissions to access the constructor are missing. The instance is initialized to use the parameterless constructor of the type that is being lazily initialized, and that type does not have a public, parameterless constructor. The initialization function tries to access on this instance. - Lazy Initialization diff --git a/xml/System/LoaderOptimization.xml b/xml/System/LoaderOptimization.xml index 2ea3c859129..61cc439f913 100644 --- a/xml/System/LoaderOptimization.xml +++ b/xml/System/LoaderOptimization.xml @@ -65,19 +65,7 @@ An enumeration used with the class to specify loader optimizations for an executable. - - [!NOTE] -> **.NET Framework only:** If custom code access security policy is set for the , by using the method, and the is created using the `MultiDomain` flag, the effect is the same as specifying the `MultiDomainHost` flag; that is, only assemblies in the GAC are shared. When this occurs, the loader does not throw an exception and the application does not experience the performance gains associated with the `MultiDomain` flag. - - For more information on assembly sharing and domain-neutral assembly loading, see [Application Domains and Assemblies](/dotnet/framework/app-domains/application-domains#application-domains-and-assemblies). - - ]]> - + To be added. diff --git a/xml/System/LoaderOptimizationAttribute.xml b/xml/System/LoaderOptimizationAttribute.xml index 0c2d076a37b..18411f8470f 100644 --- a/xml/System/LoaderOptimizationAttribute.xml +++ b/xml/System/LoaderOptimizationAttribute.xml @@ -75,9 +75,6 @@ This attribute is only a hint to the loader and does not affect program behavior. -> [!NOTE] -> If custom code access security policy is set for the , by using the method, and the is created using the flag, the effect is the same as specifying the flag. That is, only assemblies in the GAC are shared. When this occurs, the loader does not throw an exception and the application does not experience the performance gains associated with the flag. - ]]> diff --git a/xml/System/MTAThreadAttribute.xml b/xml/System/MTAThreadAttribute.xml index 212bdcc4272..7aa3a84ec37 100644 --- a/xml/System/MTAThreadAttribute.xml +++ b/xml/System/MTAThreadAttribute.xml @@ -70,11 +70,11 @@ The default threading model for COM interop depends on the language in which you're developing your application, as the following table shows. -|Language|COM apartment model| -|--------------|-------------------------| -|C#|Multithreaded apartment| -|C++|Multithreaded apartment| -|Visual Basic|Single-threaded apartment| +| Language | COM apartment model | +|--------------|---------------------------| +| C# | Multithreaded apartment | +| C++ | Multithreaded apartment | +| Visual Basic | Single-threaded apartment | To change these defaults, you use the attribute to set the threading model for the application, or call the or method before starting the thread to set the threading model for a particular thread. In C++, you can also use the [/CLRTHREADATTRIBUTE (Set CLR Thread Attribute)](/cpp/build/reference/clrthreadattribute-set-clr-thread-attribute) linker option to specify the apartment model. diff --git a/xml/System/MethodAccessException.xml b/xml/System/MethodAccessException.xml index 78ff7bbf392..7a4d2fde668 100644 --- a/xml/System/MethodAccessException.xml +++ b/xml/System/MethodAccessException.xml @@ -76,9 +76,6 @@ - The access level of a method in a class library has changed, and one or more assemblies that reference the library have not been recompiled. -> [!NOTE] -> Beginning with the .NET Framework 4, the common language runtime treats application code as transparent when it is run with partial trust. See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection). - uses the HRESULT COR_E_METHODACCESS, that has the value 0x80131510. For a list of initial property values for an instance of , see the constructors. diff --git a/xml/System/OutOfMemoryException.xml b/xml/System/OutOfMemoryException.xml index 8548123d9d7..98e6dccfb13 100644 --- a/xml/System/OutOfMemoryException.xml +++ b/xml/System/OutOfMemoryException.xml @@ -125,8 +125,6 @@ If you have created a type that uses unmanaged resources, make sure that you hav **You are attempting to create a large array in a 64-bit process** -By default, the common language runtime in .NET Framework does not allow single objects whose size exceeds 2GB. To override this default, you can use the [\](/dotnet/framework/configure-apps/file-schema/runtime/gcallowverylargeobjects-element) configuration file setting to enable arrays whose total size exceeds 2 GB. On .NET Core, support for arrays of greater than 2 GB is enabled by default. - **You are working with very large sets of data (such as arrays, collections, or database data sets) in memory.** When data structures or data sets that reside in memory become so large that the common language runtime is unable to allocate enough contiguous memory for them, an exception results. diff --git a/xml/System/Random.xml b/xml/System/Random.xml index 4cfe623731b..732bca78e38 100644 --- a/xml/System/Random.xml +++ b/xml/System/Random.xml @@ -162,16 +162,12 @@ The following example generates a random integer that it uses as an index to ret objects that are created in close succession by a call to the parameterless constructor have identical default seed values and, therefore, produce identical sets of random numbers. You can avoid this problem by using a single object to generate all random numbers. You can also work around it by generating your own random seed value and passing it to the constructor. For more information, see the constructor. +In modern .NET, the default seed value is produced by the thread-static, pseudo-random number generator. Different objects created in close succession produce different sets of random numbers. -In .NET Core, the default seed value is produced by the thread-static, pseudo-random number generator, so the previously described limitation does not apply. Different objects created in close succession produce different sets of random numbers in .NET Core. - - Call this constructor if you want your random number generator to generate a random sequence of numbers. To generate a fixed sequence of random numbers that will be the same for different random number generators, call the constructor with a fixed seed value. This constructor overload is frequently used when testing apps that use random numbers. + Call this constructor if you want your random number generator to generate a random sequence of numbers. To generate a fixed sequence of random numbers that will be the same for different random number generators, call the constructor with a fixed seed value. This constructor overload is frequently used when testing apps that use random numbers. Once you've instantiated the random number generator, you call individual methods, such as or , to generate random numbers. - - ## Examples The following example uses the parameterless constructor to instantiate three objects and displays a sequence of five random integers for each. If it is run on .NET Framework, because the first two objects are created in close succession, they are instantiated using identical seed values based on the system clock and, therefore, they produce an identical sequence of random numbers. On the other hand, the parameterless constructor of the third object is called after a two-second delay caused by calling the method. Because this produces a different seed value for the third object, it produces a different sequence of random numbers. diff --git a/xml/System/ResolveEventHandler.xml b/xml/System/ResolveEventHandler.xml index 9a6d6685a9b..9ab3d0a239a 100644 --- a/xml/System/ResolveEventHandler.xml +++ b/xml/System/ResolveEventHandler.xml @@ -87,12 +87,12 @@ to return the assembly that resolves the type, assembly, or resource, or to return null if the assembly is not recognized. For more information, see [Resolving Assembly Loads](/dotnet/standard/assembly/resolve-loads) and the , , and events. -> [!IMPORTANT] -> Beginning with .NET Framework 4, the event is raised for all assemblies, including resource assemblies. In earlier versions, the event was not raised for resource assemblies. If the operating system is localized, the handler might be called multiple times: once for each culture in the fallback chain. +If the runtime class loader cannot resolve a reference to an assembly, type, or resource, the corresponding events are raised to give the callback a chance to tell the runtime which assembly the referenced assembly, type, or resource is in. It is the responsibility of the to return the assembly that resolves the type, assembly, or resource, or to return null if the assembly is not recognized. For more information, see [Resolving Assembly Loads](/dotnet/standard/assembly/resolve-loads) and the , , and events. - Every derived class of and has a constructor and an `Invoke` method. +The event is raised for all assemblies, including resource assemblies. If the operating system is localized, the handler might be called multiple times: once for each culture in the fallback chain. + +Every derived class of and has a constructor and an `Invoke` method. ]]> diff --git a/xml/System/STAThreadAttribute.xml b/xml/System/STAThreadAttribute.xml index 8eb2a120c8a..b141a63cac9 100644 --- a/xml/System/STAThreadAttribute.xml +++ b/xml/System/STAThreadAttribute.xml @@ -68,24 +68,22 @@ COM threading models only apply to applications that use COM interop. The COM threading model can be set to single-threaded apartment or multithreaded apartment. The application thread is only initialized for COM interop if the thread actually makes a call to a COM component. If COM interop is not used, then the thread is not initialized, and the attribute, if it is present, has no effect. - Starting with the .NET Framework version 2.0, the default threading model for COM interop depends on the language in which you are developing your application, as the following table shows. +The default threading model for COM interop depends on the language in which you are developing your application, as the following table shows. -|Language|COM apartment model| -|--------------|-------------------------| -|C#|Multithreaded apartment| -|C++|Multithreaded apartment| -|Visual Basic|Single-threaded apartment| +| Language | COM apartment model | +|--------------|---------------------------| +| C# | Multithreaded apartment | +| C++ | Multithreaded apartment | +| Visual Basic | Single-threaded apartment | To change these defaults, you use the attribute to set the threading model for the application, or call the or method before starting the thread to set the threading model for a particular thread. In C++, you can also use the [/CLRTHREADATTRIBUTE](/cpp/build/reference/clrthreadattribute-set-clr-thread-attribute) linker option to specify the apartment model. ASP.NET applications should set the `ASPCompat` attribute of the `@ Page` directive to `true` to force the page to be serviced by the STA thread pool. - Here are some of the cases in which you'll want to use the attribute to explicitly set the threading model to single-threaded apartment: + Here are some scenarios where you should use the attribute to explicitly set the threading model to single-threaded apartment: - You're developing a Windows Forms app. Windows Forms apps must be single-threaded if they communicate with Windows system components such as the Clipboard or Windows common dialog boxes, or if they use system features such as drag-and-drop functionality. The Windows Forms Application template for C# automatically adds the attribute to C# projects. Because the single-threaded apartment model is the default for Visual Basic, there is no need for the attribute. - - You're developing a C# app that calls a Visual Basic library, which, in turn, relies on COM interop. Because the single-threaded apartment model is the default for Visual Basic, you should change your app's threading model to single-threaded by using the attribute. - - Your application makes calls to COM components that use the single-threaded apartment model. ]]> diff --git a/xml/System/String.xml b/xml/System/String.xml index 3829760c095..8ec700b2e30 100644 --- a/xml/System/String.xml +++ b/xml/System/String.xml @@ -6884,8 +6884,6 @@ The behavior of is dependent on its implementa > > For more information about hash codes, see . -In .NET Framework desktop apps, you can use the [\ element](/dotnet/framework/configure-apps/file-schema/runtime/userandomizedstringhashalgorithm-element) to generate unique hash codes on a per-application domain basis. This can reduce the number of collisions and improve the overall performance of insertions and lookups that use hash tables. The following example shows how to use the [\ element](/dotnet/framework/configure-apps/file-schema/runtime/userandomizedstringhashalgorithm-element). It defines a `DisplayString` class that includes a private string constant, `s`, whose value is "This is a string." It also includes a `ShowStringHashCode` method that displays the string value and its hash code along with the name of the application domain in which the method is executing. - :::code language="csharp" source="~/snippets/csharp/System/String/GetHashCode/perdomain.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/GetHashCode/perdomain.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System/String/GetHashCode/perdomain.vb" id="Snippet2"::: @@ -6933,7 +6931,6 @@ The following example demonstrates the method The value returned by is platform-dependent. It differs on the 32-bit and 64-bit versions of .NET Framework. It also can differ between versions of .NET Framework and .NET Core. - <UseRandomizedStringHashAlgorithm> Element @@ -12422,8 +12419,6 @@ The following example demonstrates the method. [!NOTE] > This method does not modify the value of the current instance. Instead, it returns a new string in which all characters from position `startIndex` to the end of the original string have been removed. @@ -12511,8 +12506,6 @@ The following example demonstrates the method. The [!NOTE] > This method does not modify the value of the current instance. Instead, it returns a new string in which the number of characters specified by the `count` parameter have been removed. The characters are removed at the position specified by `startIndex`. diff --git a/xml/System/TimeZoneInfo.xml b/xml/System/TimeZoneInfo.xml index fc863e8bb0b..672550a053d 100644 --- a/xml/System/TimeZoneInfo.xml +++ b/xml/System/TimeZoneInfo.xml @@ -976,22 +976,20 @@ property of the `dateTime` parameter, as the following table shows. -|DateTime.Kind property|Conversion| -|----------------------------|----------------| -||Converts from local time to Coordinated Universal Time (UTC).| -||Assumes `dateTime` is local time and converts from local time to UTC.| -||Returns `dateTime` unchanged.| +The exact conversion performed depends on the value of the property of the `dateTime` parameter, as the following table shows. - If `dateTime` corresponds to an ambiguous local time, this method assumes that it is standard local time. If `dateTime` corresponds to an invalid local time, the method throws an . - -> [!NOTE] -> If the current computer's local time zone includes multiple adjustment rules, this overload of the method can return results that differ from the and methods. always applies the current adjustment rule to time zone conversion, whether or not `dateTime` lies within its date range. And when executing on .NET Framework 3.5, also applies the current adjustment rule to time zone conversion, whether or not `dateTime` lies within its date range. +| DateTime.Kind property | Conversion | +|---------------------------------------------------------------|---------------------------------------------------------------| +| | Converts from local time to Coordinated Universal Time (UTC). | +| | Assumes `dateTime` is local time and converts from local time to UTC. | +| | Returns `dateTime` unchanged. | - If the UTC equivalent of `dateTime` is earlier than or later that , this method returns or , respectively. +If `dateTime` corresponds to an ambiguous local time, this method assumes that it is standard local time. If `dateTime` corresponds to an invalid local time, the method throws an . +If the current computer's local time zone includes multiple adjustment rules, this overload of the method can return results that differ from the and methods. always applies the current adjustment rule to time zone conversion, whether or not `dateTime` lies within its date range. +If the UTC equivalent of `dateTime` is earlier than or later that , this method returns or , respectively. ## Examples The following example illustrates the conversion of time values whose property is , , and , respectively. It also illustrates the conversion of ambiguous and invalid times. diff --git a/xml/System/Type.xml b/xml/System/Type.xml index 59cf598e843..c7687fda213 100644 --- a/xml/System/Type.xml +++ b/xml/System/Type.xml @@ -149,7 +149,6 @@ The code example uses the to invoke the - Viewing Type Information @@ -543,7 +542,6 @@ TopNamespace.Sub\+Namespace.ContainingClass+NestedClass, MyAssembly, Version=1.3 - Reflection and Generic Types @@ -611,8 +609,6 @@ TopNamespace.Sub\+Namespace.ContainingClass+NestedClass, MyAssembly, Version=1.3 - Reflection and Generic Types - How to: Examine and Instantiate Generic Types with Reflection @@ -676,9 +672,6 @@ TopNamespace.Sub\+Namespace.ContainingClass+NestedClass, MyAssembly, Version=1.3 The that is returned by the property is either a in the case of a generic method, or a in the case of a generic constructor. -> [!NOTE] -> In the .NET Framework version 2.0, generic constructors are not supported. - For a list of the invariant conditions for terms used in generic reflection, see the property remarks. @@ -693,8 +686,6 @@ TopNamespace.Sub\+Namespace.ContainingClass+NestedClass, MyAssembly, Version=1.3 ]]> - Reflection and Generic Types - How to: Examine and Instantiate Generic Types with Reflection @@ -1742,8 +1733,6 @@ The `filter` argument can be a custom delegate of type The invoked method is not supported in the base class. - Reflection and Generic Types - How to: Examine and Instantiate Generic Types with Reflection @@ -1827,8 +1816,6 @@ The `filter` argument can be a custom delegate of type - Reflection and Generic Types - How to: Examine and Instantiate Generic Types with Reflection @@ -4340,8 +4327,6 @@ In .NET 6 and earlier versions, the method does no The invoked method is not supported in the base class. Derived classes must provide an implementation. - Reflection and Generic Types - How to: Examine and Instantiate Generic Types with Reflection @@ -4405,7 +4390,6 @@ In .NET 6 and earlier versions, the method does no The current object is not a generic type parameter. That is, the property returns . - How to: Examine and Instantiate Generic Types with Reflection @@ -4484,8 +4468,6 @@ In .NET 6 and earlier versions, the method does no - Reflection and Generic Types - How to: Examine and Instantiate Generic Types with Reflection @@ -9134,10 +9116,6 @@ You can use the method to obtain a [!NOTE] > If `typeName` cannot be found, the call to the method returns `null`. It does not throw an exception. To control whether an exception is thrown, call an overload of the method that has a `throwOnError` parameter. - .NET Framework only: only works on assemblies loaded from disk. If you call to look up a type defined in a dynamic assembly defined using the services, you might get inconsistent behavior. The behavior depends on whether the dynamic assembly is persistent, that is, created using the `RunAndSave` or `Save` access modes of the enumeration. If the dynamic assembly is persistent and has been written to disk before `GetType` is called, the loader finds the saved assembly on disk, loads that assembly, and retrieves the type from that assembly. If the assembly has not been saved to disk when `GetType` is called, the method returns `null`. `GetType` does not understand transient dynamic assemblies; therefore, calling `GetType` to retrieve a type in a transient dynamic assembly returns `null`. - - In .NET Framework, to use `GetType` on a dynamic module, subscribe to the event and call `GetType` before saving. Otherwise, you will get two copies of the assembly in memory. - On .NET Core 3.0 and later versions, assembly loads triggered by this API are affected by the current value of . The following table shows what members of a base class are returned by the `Get` methods when reflecting on a type. @@ -9342,10 +9320,6 @@ Type.GetType("System.Collections.Generic.Dictionary`2[System.String,[MyType,MyAs ## Remarks You can use the method to obtain a object for a type in another assembly if you know its assembly-qualified name, which can be obtained from . causes loading of the assembly specified in `typeName`. You can also load an assembly using the method, and then use the or method to get objects. If a type is in an assembly known to your program at compile time, it's more efficient to use `typeof` in C# or the `GetType` operator in Visual Basic. - .NET Framework only: only works on assemblies loaded from disk. If you call to look up a type defined in a dynamic assembly defined using the services, you might get inconsistent behavior. The behavior depends on whether the dynamic assembly is persistent, that is, created using the `RunAndSave` or `Save` access modes of the enumeration. If the dynamic assembly is persistent and has been written to disk before `GetType` is called, the loader finds the saved assembly on disk, loads that assembly, and retrieves the type from that assembly. If the assembly has not been saved to disk when `GetType` is called, the method returns `null`. `GetType` does not understand transient dynamic assemblies; therefore, calling `GetType` to retrieve a type in a transient dynamic assembly returns `null`. - - In .NET Framework, to use `GetType` on a dynamic module, subscribe to the event and call `GetType` before saving. Otherwise, you will get two copies of the assembly in memory. - On .NET Core 3.0 and later versions, assembly loads triggered by this API are affected by the current value of . The `throwOnError` parameter specifies what happens when the type is not found, and also suppresses certain other exception conditions, as described in the Exceptions section. Some exceptions are thrown regardless of the value of `throwOnError`. For example, if the type is found but cannot be loaded, a is thrown even if `throwOnError` is `false`. @@ -9577,10 +9551,6 @@ Type.GetType("System.Collections.Generic.Dictionary`2[System.String,[MyType,MyAs ## Remarks You can use the method to obtain a object for a type in another assembly if you know its assembly-qualified name, which can be obtained from . causes loading of the assembly specified in `typeName`. You can also load an assembly using the method, and then use the or method to get objects. If a type is in an assembly known to your program at compile time, it's more efficient to use `typeof` in C# or the `GetType` operator in Visual Basic. - .NET Framework only: only works on assemblies loaded from disk. If you call to look up a type defined in a dynamic assembly defined using the services, you might get inconsistent behavior. The behavior depends on whether the dynamic assembly is persistent, that is, created using the `RunAndSave` or `Save` access modes of the enumeration. If the dynamic assembly is persistent and has been written to disk before `GetType` is called, the loader finds the saved assembly on disk, loads that assembly, and retrieves the type from that assembly. If the assembly has not been saved to disk when `GetType` is called, the method returns `null`. `GetType` does not understand transient dynamic assemblies; therefore, calling `GetType` to retrieve a type in a transient dynamic assembly returns `null`. - - In .NET Framework, to use `GetType` on a dynamic module, subscribe to the event and call `GetType` before saving. Otherwise, you will get two copies of the assembly in memory. - On .NET Core 3.0 and later versions, assembly loads triggered by this API are affected by the current value of . The `throwOnError` parameter specifies what happens when the type is not found, and also suppresses certain other exception conditions, as described in the Exceptions section. Some exceptions are thrown regardless of the value of `throwOnError`. For example, if the type is found but cannot be loaded, a is thrown even if `throwOnError` is `false`. @@ -11589,11 +11559,6 @@ Calling this method overload is the same as calling the [!NOTE] -> This method can be used to access non-public members if the caller has been granted with the flag and if the grant set of the non-public members is restricted to the caller's grant set, or a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) -> -> To use this functionality, your application should target .NET Framework 3.5 or later. - ## Examples The following example uses `InvokeMember` to access members of a type. @@ -11824,11 +11789,6 @@ Calling this method overload is the same as calling the [!NOTE] -> This method can be used to access non-public members if the caller has been granted with the flag and if the grant set of the non-public members is restricted to the caller's grant set, or a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) -> -> To use this functionality, your application should target the .NET Framework 3.5 or later. - ]]> @@ -12068,11 +12028,6 @@ Calling this method overload is the same as calling the [!NOTE] -> This method can be used to access non-public members if the caller has been granted with the flag and if the grant set of the non-public members is restricted to the caller's grant set, or a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) -> -> To use this functionality, your application should target the .NET Framework 3.5 or later. - ]]> @@ -13469,8 +13424,6 @@ Byref-like structures are declared using `ref struct` keyword in C#. An instance object to represent its view of the COM type. The common language runtime supports type equivalence between these different views for interfaces, structures, enumerations, and delegates. - Type equivalence means that a COM object that is passed from one managed assembly to another can be cast to the appropriate managed type in the receiving assembly. The method enables an assembly to determine that a COM object obtained from another assembly has the same COM identity as one of the first assembly's own embedded interop types, and thus can be cast to that type. For more information, see [Type Equivalence and Embedded Interop Types](/dotnet/framework/interop/type-equivalence-and-embedded-interop-types). @@ -13698,8 +13651,6 @@ Byref-like structures are declared using `ref struct` keyword in C#. An instance - Reflection and Generic Types - How to: Examine and Instantiate Generic Types with Reflection @@ -13791,8 +13742,6 @@ Byref-like structures are declared using `ref struct` keyword in C#. An instance - Reflection and Generic Types - How to: Examine and Instantiate Generic Types with Reflection @@ -13857,8 +13806,6 @@ Byref-like structures are declared using `ref struct` keyword in C#. An instance - Reflection and Generic Types - How to: Examine and Instantiate Generic Types with Reflection @@ -15322,14 +15269,10 @@ Byref-like structures are declared using `ref struct` keyword in C#. An instance > [!IMPORTANT] > For partial-trust assemblies, the value of this property depends on the current trust level of the assembly. If the assembly is loaded into a partially trusted application domain (for example, into a sandboxed application domain), then the runtime ignores the security annotations of the assembly. The assembly and all its types are treated as transparent. The runtime pays attention to the security annotations of a partial-trust assembly only when that assembly is loaded into a fully trusted application domain (for example, into the default application domain of a desktop application). By contrast, a trusted assembly (that is, a strong-named assembly that is installed in the global assembly cache) is always loaded with full trust regardless of the trust level of the application domain, so its current trust level is always fully trusted. You can determine the current trust levels of assemblies and application domains by using the and properties. - For more information about reflection and transparency, see [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection). For information about transparency, see [Security Changes](/dotnet/framework/security/security-changes). - ]]> - Security Considerations for Reflection - Security Changes in the .NET Framework @@ -15387,14 +15330,10 @@ Byref-like structures are declared using `ref struct` keyword in C#. An instance > [!IMPORTANT] > For partial-trust assemblies, the value of this property depends on the current trust level of the assembly. If the assembly is loaded into a partially trusted application domain (for example, into a sandboxed application domain), then the runtime ignores the security annotations of the assembly. The assembly and all its types are treated as transparent. The runtime pays attention to the security annotations of a partial-trust assembly only when that assembly is loaded into a fully trusted application domain (for example, into the default application domain of a desktop application). By contrast, a trusted assembly (that is, a strong-named assembly that is installed in the global assembly cache) is always loaded with full trust regardless of the trust level of the application domain, so its current trust level is always fully trusted. You can determine the current trust levels of assemblies and application domains by using the and properties. - For more information about reflection and transparency, see [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection). For information about transparency, see [Security Changes](/dotnet/framework/security/security-changes). - ]]> - Security Considerations for Reflection - Security Changes in the .NET Framework @@ -15446,14 +15385,10 @@ Byref-like structures are declared using `ref struct` keyword in C#. An instance > [!IMPORTANT] > For partial-trust assemblies, the value of this property depends on the current trust level of the assembly. If the assembly is loaded into a partially trusted application domain (for example, into a sandboxed application domain), then the runtime ignores the security annotations of the assembly. The assembly and all its types are treated as transparent. The runtime pays attention to the security annotations of a partial-trust assembly only when that assembly is loaded into a fully trusted application domain (for example, into the default application domain of a desktop application). By contrast, a trusted assembly (that is, a strong-named assembly that is installed in the global assembly cache) is always loaded with full trust regardless of the trust level of the application domain, so its current trust level is always fully trusted. You can determine the current trust levels of assemblies and application domains by using the and properties. - For more information about reflection and transparency, see [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection). For information about transparency, see [Security Changes](/dotnet/framework/security/security-changes). - ]]> - Security Considerations for Reflection - Security Changes in the .NET Framework @@ -16681,8 +16616,6 @@ The following example uses the method to cre The invoked method is not supported in the base class. Derived classes must provide an implementation. - Reflection and Generic Types - How to: Examine and Instantiate Generic Types with Reflection @@ -17424,7 +17357,6 @@ The following example uses the method to cre Specifying Fully Qualified Type Names - How to: Load Assemblies into the Reflection-Only Context diff --git a/xml/System/TypedReference.xml b/xml/System/TypedReference.xml index 811cdf5e33a..00c9b843d1a 100644 --- a/xml/System/TypedReference.xml +++ b/xml/System/TypedReference.xml @@ -280,11 +280,6 @@ ## Remarks The method returns a typed reference to some terminal field, where the `target` parameter contains the field described by the first element of `flds`, the field described by the first element of `flds` contains the field described by the second element of `flds`, and so on until the terminal field is reached. -> [!NOTE] -> This method can be used to access non-public members if the caller has been granted with the flag and if the grant set of the non-public members is restricted to the caller's grant set, or a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) -> -> To use this functionality, your application should target .NET Framework 3.5 or later. - ]]> diff --git a/xml/System/Uri.xml b/xml/System/Uri.xml index a3fa4787787..c1edb987a0c 100644 --- a/xml/System/Uri.xml +++ b/xml/System/Uri.xml @@ -123,9 +123,6 @@ The following code snippet shows example values of the various properties on the - Changes to the System.Uri namespace in Version 2.0 - International Resource Identifier Support in System.UriSystem.Uri - Network Programming in the .NET Framework @@ -1054,7 +1051,8 @@ For `uriString`, an IPv6 address in string form must be enclosed within brackets The path information does not include the scheme, host name, or query portion of the URI. ## Examples - The following example writes the path `/catalog/shownew.htm` to the console. + +The following example writes the path `/catalog/shownew.htm` to the console. :::code language="csharp" source="~/snippets/csharp/System/Uri/AbsolutePath/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/AbsolutePath/source.fs" id="Snippet1"::: @@ -1115,7 +1113,8 @@ For `uriString`, an IPv6 address in string form must be enclosed within brackets The property includes the entire URI stored in the instance, including all fragments and query strings. ## Examples - The following example writes the complete contents of the instance to the console. In the example shown, `http://www.contoso.com/catalog/shownew.htm?date=today` is written to the console. + +The following example writes the complete contents of the instance to the console. In the example shown, `http://www.contoso.com/catalog/shownew.htm?date=today` is written to the console. :::code language="csharp" source="~/snippets/csharp/System/Uri/AbsoluteUri/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/AbsoluteUri/source.fs" id="Snippet1"::: @@ -1176,7 +1175,8 @@ For `uriString`, an IPv6 address in string form must be enclosed within brackets The property is typically a server DNS host name or IP address. This property might include the service port number if it differs from the default port for the URI. If the component contains reserved characters, these are escaped in the string value returned by this property. ## Examples - The following example writes the host name (`www.contoso.com`) and port number (8080) of the server to the console. + +The following example writes the host name (`www.contoso.com`) and port number (8080) of the server to the console. :::code language="csharp" source="~/snippets/csharp/System/Uri/Authority/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/Authority/source.fs" id="Snippet1"::: @@ -1307,7 +1307,8 @@ For `uriString`, an IPv6 address in string form must be enclosed within brackets The method checks that the host name provided meets the requirements for a valid Internet host name. It does not, however, perform a host-name lookup to verify the existence of the host. ## Examples - The following example checks whether the host name is valid. + +The following example checks whether the host name is valid. :::code language="csharp" source="~/snippets/csharp/System/Uri/CheckHostName/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/CheckHostName/source.fs" id="Snippet1"::: @@ -1382,7 +1383,8 @@ For `uriString`, an IPv6 address in string form must be enclosed within brackets For more information on IRI support, see the Remarks section for the class. ## Examples - The following example creates a instance and checks whether the scheme name is valid. + +The following example creates a instance and checks whether the scheme name is valid. :::code language="csharp" source="~/snippets/csharp/System/Uri/CheckSchemeName/uriexamples.cs" id="Snippet9"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/CheckSchemeName/uriexamples.fs" id="Snippet9"::: @@ -1583,49 +1585,9 @@ For `uriString`, an IPv6 address in string form must be enclosed within brackets If you used an escaped string to construct this instance (for example, `"http://[fe80::200:39ff:fe36:1a2d%254]/temp/example.htm"`), then DnsSafeHost returns an escaped string. Unescape any escaped string returned from `DnsSafeHost` before using that string for DNS resolution (see the Example). If you used an invalid unescaped string to construct this instance (for example, "http://[fe80::200:39ff:fe36:1a2d%4]/temp/example.htm"), then DnsSafeHost returns an unescaped string. - The property is dependent on configuration settings in .NET Framework apps, as discussed later in this topic. The property is provided as the preferred alternative to using , because is guaranteed to always be DNS safe. - - The property was extended in .NET Framework v3.5, 3.0 SP1, and 2.0 SP1 to provide International Resource Identifier (IRI) support based on RFC 3987. However, to ensure application compatibility with prior versions, you must specifically enable it in .NET Framework apps. To enable support for IRI, the following two changes are required: - -1. Add the following line to the *machine.config* file under the .NET Framework 2.0 directory: - - `\
` - -2. Specify whether you want Internationalized Domain Name (IDN) parsing applied to the domain name and whether IRI parsing rules should be applied. This can be done in the *machine.config* or in the *app.config* file. For example, add the following: - - ```xml - - - - - - - ``` - - Enabling IDN converts all Unicode labels in a domain name to their Punycode equivalents. Punycode names contain only ASCII characters and always start with the xn-- prefix. The reason for this is to support existing DNS servers on the Internet, since most DNS servers only support ASCII characters (see RFC 3940). - - Enabling IDN only affects the value of the property. - - There are three possible values for IDN depending on the DNS servers that are used: - -- idn enabled = All - - This value will convert any Unicode domain names to their Punycode equivalents (IDN names). - -- idn enabled = AllExceptIntranet - - This value will convert all external Unicode domain names to use the Punycode equivalents (IDN names). In this case to handle international names on the local Intranet, the DNS servers that are used for the Intranet should support Unicode names. - -- idn enabled = None - - This value will not convert any Unicode domain names to use Punycode. This is the default value, which is consistent with the .NET Framework 2.0 behavior. - - Enabling IRI parsing (iriParsing enabled = `true`) normalizes and checks characters according to the IRI rules in RFC 3987. The default value is `false` and normalizes and checks characters according to RFC 2396 and RFC 2732 (for IPv6 literals). - - For more information on IRI support, see the Remarks section for the class. - ## Examples - The following example creates a instance from a string. It illustrates the difference between the value returned from , which returns the host name or address specified in the URI, and the value returned from , which returns an address that is safe to use in DNS resolution. + +The following example creates a instance from a string. It illustrates the difference between the value returned from , which returns the host name or address specified in the URI, and the value returned from , which returns an address that is safe to use in DNS resolution. :::code language="csharp" source="~/snippets/csharp/System/Uri/.ctor/nclurienhancements.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/.ctor/nclurienhancements.fs" id="Snippet4"::: @@ -2141,7 +2103,8 @@ If you used an escaped string to construct this instance (for example, `"http:// > The property includes the leading delimiter (`#`), whereas the URI specification (RFC 3986) recognizes the fragment as the portion of a URI without the delimiter. ## Examples - The following example creates a instance and writes the fragment information to the console. + +The following example creates a instance and writes the fragment information to the console. :::code language="csharp" source="~/snippets/csharp/System/Uri/CheckSchemeName/uriexamples.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/CheckSchemeName/uriexamples.fs" id="Snippet4"::: @@ -2202,7 +2165,8 @@ If you used an escaped string to construct this instance (for example, `"http:// The method converts a character representing a hexadecimal digit (0-9, a-f, A-F) to its decimal value (0 to 15). If `digit` is not a valid hexadecimal digit, an exception is thrown. ## Examples - The following example determines whether a character is a hexadecimal character and, if it is, writes the corresponding decimal value to the console. + +The following example determines whether a character is a hexadecimal character and, if it is, writes the corresponding decimal value to the console. :::code language="csharp" source="~/snippets/csharp/System/Uri/CheckSchemeName/uriexamples.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/CheckSchemeName/uriexamples.fs" id="Snippet1"::: @@ -2332,7 +2296,8 @@ If you used an escaped string to construct this instance (for example, `"http:// instance and writes the hash code to the console. + +The following example creates a instance and writes the hash code to the console. :::code language="csharp" source="~/snippets/csharp/System/Uri/CheckSchemeName/uriexamples.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/CheckSchemeName/uriexamples.fs" id="Snippet4"::: @@ -2417,7 +2382,8 @@ The following examples show a URI and the results of calling instance and writes the path to the console. + +The following example creates a instance and writes the path to the console. :::code language="csharp" source="~/snippets/csharp/System/Uri/CheckSchemeName/uriexamples.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/CheckSchemeName/uriexamples.fs" id="Snippet4"::: @@ -2522,7 +2488,8 @@ The following examples show a URI and the results of calling property, this property value does not include the port number. ## Examples - The following example writes the host name (`www.contoso.com`) of the server to the console. + +The following example writes the host name (`www.contoso.com`) of the server to the console. :::code language="csharp" source="~/snippets/csharp/System/Uri/Host/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/Host/source.fs" id="Snippet1"::: @@ -2703,7 +2671,8 @@ The following examples show a URI and the results of calling instance and writes the to the console. + +The following example creates a instance and writes the to the console. :::code language="csharp" source="~/snippets/csharp/System/Uri/CheckSchemeName/uriexamples.cs" id="Snippet9"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/CheckSchemeName/uriexamples.fs" id="Snippet9"::: @@ -3018,7 +2987,8 @@ The following examples show a URI and the results of calling instance and checks whether it uses the default port. + +The following example creates a instance and checks whether it uses the default port. :::code language="csharp" source="~/snippets/csharp/System/Uri/CheckSchemeName/uriexamples.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/CheckSchemeName/uriexamples.fs" id="Snippet4"::: @@ -3141,7 +3111,8 @@ The following examples show a URI and the results of calling property is `true` when the property equals . ## Examples - The following example creates a instance and determines whether it is a file URI. + +The following example creates a instance and determines whether it is a file URI. :::code language="csharp" source="~/snippets/csharp/System/Uri/CheckSchemeName/uriexamples.cs" id="Snippet6"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/CheckSchemeName/uriexamples.fs" id="Snippet6"::: @@ -3203,7 +3174,8 @@ The following examples show a URI and the results of calling method checks for hexadecimal encoding that follows the pattern "%hexhex" in a string, where "hex" is a digit from 0 to 9 or a letter from A-F (case-insensitive). ## Examples - The following code example determines whether a character is hexadecimal encoded and, if so, writes the equivalent character to the console. + +The following code example determines whether a character is hexadecimal encoded and, if so, writes the equivalent character to the console. :::code language="csharp" source="~/snippets/csharp/System/Uri/CheckSchemeName/uriexamples.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/CheckSchemeName/uriexamples.fs" id="Snippet2"::: @@ -3327,7 +3300,8 @@ The following examples show a URI and the results of calling returns `true` if the URI specified when this instance was created was 127.0.0.1, loopback, or localhost, or if the URI did not specify host information (for example, file:///c:Dir/file.txt). All other URIs return `false`. ## Examples - The following example creates a instance and determines whether it references a local host. + +The following example creates a instance and determines whether it references a local host. :::code language="csharp" source="~/snippets/csharp/System/Uri/CheckSchemeName/uriexamples.cs" id="Snippet6"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/CheckSchemeName/uriexamples.fs" id="Snippet6"::: @@ -3450,7 +3424,8 @@ The following examples show a URI and the results of calling property is `true` if the specified instance is a UNC path (such as `\\server\folder`, //server, or `file://server/folder`). This property always returns `true` if the URI has the file:// scheme and specifies a host component. ## Examples - The following example creates a instance and determines whether it is a UNC path. + +The following example creates a instance and determines whether it is a UNC path. :::code language="csharp" source="~/snippets/csharp/System/Uri/CheckSchemeName/uriexamples.cs" id="Snippet6"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/CheckSchemeName/uriexamples.fs" id="Snippet6"::: @@ -3673,7 +3648,8 @@ The following examples show a URI and the results of calling instance and writes the local path to the console. + +The following example creates a instance and writes the local path to the console. :::code language="csharp" source="~/snippets/csharp/System/Uri/CheckSchemeName/uriexamples.cs" id="Snippet6"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/CheckSchemeName/uriexamples.fs" id="Snippet6"::: @@ -3833,7 +3809,8 @@ The following examples show a URI and the results of calling instances. The difference in the path information is written to the console. + +The following example creates 2 instances. The difference in the path information is written to the console. :::code language="csharp" source="~/snippets/csharp/System/Uri/CheckSchemeName/uriexamples.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/CheckSchemeName/uriexamples.fs" id="Snippet3"::: @@ -4037,7 +4014,8 @@ The following examples show a URI and the results of calling object is serialized, the is not preserved. The serialization process uses the fully escaped and canonicalized property when serializing. For a that contains an IPv6 address, the IPv6 address and the scope ID are included in the serialized object. ## Examples - The following example creates a new instance from a string. It illustrates the difference between the value returned from , which returns the string that was passed to the constructor, and from a call to , which returns the canonical form of the string. + +The following example creates a new instance from a string. It illustrates the difference between the value returned from , which returns the string that was passed to the constructor, and from a call to , which returns the canonical form of the string. :::code language="csharp" source="~/snippets/csharp/System/Uri/.ctor/nclurienhancements.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/.ctor/nclurienhancements.fs" id="Snippet3"::: @@ -4158,7 +4136,8 @@ The following examples show a URI and the results of calling class. ## Examples - The following example writes the URI path (`/catalog/shownew.htm`) and query (`?date=today`) information to the console. + +The following example writes the URI path (`/catalog/shownew.htm`) and query (`?date=today`) information to the console. :::code language="csharp" source="~/snippets/csharp/System/Uri/PathAndQuery/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/PathAndQuery/source.fs" id="Snippet1"::: @@ -4219,7 +4198,8 @@ The following examples show a URI and the results of calling property returns the default value for the protocol. If there is no default port number, this property returns -1. ## Examples - The following example writes the URI port number to the console. In this case, the value is the default port number for HTTP, port 80. + +The following example writes the URI port number to the console. In this case, the value is the default port number for HTTP, port 80. :::code language="csharp" source="~/snippets/csharp/System/Uri/Port/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/Port/source.fs" id="Snippet1"::: @@ -4287,7 +4267,8 @@ The following examples show a URI and the results of calling The property includes the leading delimiter (`?`), whereas the URI specification (RFC 3986) recognizes the query as the portion of a URI without the delimiter. ## Examples - The following example writes the query `?date=today` to the console. + +The following example writes the query `?date=today` to the console. :::code language="csharp" source="~/snippets/csharp/System/Uri/PathAndQuery/source.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/PathAndQuery/source.fs" id="Snippet2"::: @@ -4366,7 +4347,8 @@ The following examples show a URI and the results of calling , , and an address. A instance is then created from the string. + +The following example creates a string from , , and an address. A instance is then created from the string. :::code language="csharp" source="~/snippets/csharp/System/Uri/CheckSchemeName/uriexamples.cs" id="Snippet17"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/CheckSchemeName/uriexamples.fs" id="Snippet17"::: @@ -4509,7 +4492,8 @@ The following examples show a URI and the results of calling instance with 3 segments and displays the segments on the screen. + +The following example creates a instance with 3 segments and displays the segments on the screen. :::code language="csharp" source="~/snippets/csharp/System/Uri/CheckSchemeName/uriexamples.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/CheckSchemeName/uriexamples.fs" id="Snippet5"::: @@ -4719,7 +4703,8 @@ The following examples show a URI and the results of calling The string returned by the method may contain control characters, which can corrupt the state of a console application. You can use the method with the format to remove control characters from the returned string. ## Examples - The following example creates a new instance from a string. It illustrates the difference between the value returned from , which returns the string that was passed to the constructor, and from a call to , which returns the canonical form of the string. + +The following example creates a new instance from a string. It illustrates the difference between the value returned from , which returns the string that was passed to the constructor, and from a call to , which returns the canonical form of the string. :::code language="csharp" source="~/snippets/csharp/System/Uri/CheckSchemeName/uriexamples.cs" id="Snippet7"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/CheckSchemeName/uriexamples.fs" id="Snippet7"::: @@ -5297,7 +5282,8 @@ The following examples show a URI and the results of calling instance and determines whether the scheme is . + +The following example creates a instance and determines whether the scheme is . :::code language="csharp" source="~/snippets/csharp/System/Uri/CheckSchemeName/uriexamples.cs" id="Snippet10"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/CheckSchemeName/uriexamples.fs" id="Snippet10"::: @@ -5433,11 +5417,12 @@ The following examples show a URI and the results of calling instance and determines whether the scheme is . - :::code language="csharp" source="~/snippets/csharp/System/Uri/CheckSchemeName/uriexamples.cs" id="Snippet15"::: - :::code language="fsharp" source="~/snippets/fsharp/System/Uri/CheckSchemeName/uriexamples.fs" id="Snippet15"::: - :::code language="vb" source="~/snippets/visualbasic/System/Uri/CheckSchemeName/uriexamples.vb" id="Snippet15"::: +The following example creates a instance and determines whether the scheme is . + +:::code language="csharp" source="~/snippets/csharp/System/Uri/CheckSchemeName/uriexamples.cs" id="Snippet15"::: +:::code language="fsharp" source="~/snippets/fsharp/System/Uri/CheckSchemeName/uriexamples.fs" id="Snippet15"::: +:::code language="vb" source="~/snippets/visualbasic/System/Uri/CheckSchemeName/uriexamples.vb" id="Snippet15"::: ]]> @@ -5516,7 +5501,8 @@ The following examples show a URI and the results of calling instance and determines whether the scheme is . + +The following example creates a instance and determines whether the scheme is . :::code language="csharp" source="~/snippets/csharp/System/Uri/CheckSchemeName/uriexamples.cs" id="Snippet14"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/CheckSchemeName/uriexamples.fs" id="Snippet14"::: @@ -5568,7 +5554,8 @@ The following examples show a URI and the results of calling instance and determines whether the scheme is . + +The following example creates a instance and determines whether the scheme is . :::code language="csharp" source="~/snippets/csharp/System/Uri/CheckSchemeName/uriexamples.cs" id="Snippet9"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/CheckSchemeName/uriexamples.fs" id="Snippet9"::: @@ -5620,7 +5607,8 @@ The following examples show a URI and the results of calling instance and determines whether the scheme is . + +The following example creates a instance and determines whether the scheme is . :::code language="csharp" source="~/snippets/csharp/System/Uri/CheckSchemeName/uriexamples.cs" id="Snippet16"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/CheckSchemeName/uriexamples.fs" id="Snippet16"::: @@ -5672,7 +5660,8 @@ The following examples show a URI and the results of calling instance and determines whether the scheme is . + +The following example creates a instance and determines whether the scheme is . :::code language="csharp" source="~/snippets/csharp/System/Uri/CheckSchemeName/uriexamples.cs" id="Snippet11"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/CheckSchemeName/uriexamples.fs" id="Snippet11"::: @@ -5804,7 +5793,8 @@ The following examples show a URI and the results of calling instance and determines whether the scheme is . + +The following example creates a instance and determines whether the scheme is . :::code language="csharp" source="~/snippets/csharp/System/Uri/CheckSchemeName/uriexamples.cs" id="Snippet12"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/CheckSchemeName/uriexamples.fs" id="Snippet12"::: @@ -5859,7 +5849,8 @@ The following examples show a URI and the results of calling parsing errors in .NET Framework version 1.1 have been corrected. ## Examples - The following example creates a instance and determines whether the scheme is . + +The following example creates a instance and determines whether the scheme is . :::code language="csharp" source="~/snippets/csharp/System/Uri/CheckSchemeName/uriexamples.cs" id="Snippet13"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/CheckSchemeName/uriexamples.fs" id="Snippet13"::: @@ -6076,7 +6067,8 @@ The following examples show a URI and the results of calling property was originally designed to indicate that the string used to create the instance was completely escaped before it was passed to the constructor; that is, the `dontEscape` parameter of the constructor call was set to `true`. However, since the `dontEscape` parameter is now obsolete, this property is deprecated and shouldn't be used. ## Examples - The following example creates a instance and determines whether it was fully escaped when it was created. + +The following example creates a instance and determines whether it was fully escaped when it was created. :::code language="csharp" source="~/snippets/csharp/System/Uri/CheckSchemeName/uriexamples.cs" id="Snippet18"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/CheckSchemeName/uriexamples.fs" id="Snippet18"::: @@ -6136,7 +6128,8 @@ The property was originally designed to indicate t The value returned by this property is usually in the format "userName:password". ## Examples - The following example creates a instance and writes the user information to the console. + +The following example creates a instance and writes the user information to the console. :::code language="csharp" source="~/snippets/csharp/System/Uri/CheckSchemeName/uriexamples.cs" id="Snippet18"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/CheckSchemeName/uriexamples.fs" id="Snippet18":::