From 3f9172374b74c264a0d8d52fafa944cf17fa780a Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Fri, 29 May 2026 14:43:28 -0700 Subject: [PATCH 1/3] Remove .NET Framework remarks --- xml/System/Activator.xml | 14 +- xml/System/AppContext.xml | 26 +- xml/System/AppDomain.xml | 193 +------- xml/System/AppDomainSetup.xml | 41 +- xml/System/AppDomainUnloadedException.xml | 29 +- xml/System/ArgumentNullException.xml | 10 +- xml/System/Array.xml | 35 +- xml/System/ArraySegment`1.xml | 7 - xml/System/Attribute.xml | 61 --- xml/System/BadImageFormatException.xml | 42 +- xml/System/CannotUnloadAppDomainException.xml | 2 - xml/System/Char.xml | 4 +- xml/System/Console.xml | 7 +- xml/System/ConsoleCancelEventArgs.xml | 4 +- xml/System/DateTime.xml | 84 ++-- xml/System/DateTimeOffset.xml | 20 +- xml/System/DllNotFoundException.xml | 2 +- xml/System/Double.xml | 150 +++---- xml/System/Environment.xml | 30 +- xml/System/Exception.xml | 13 +- xml/System/FormatException.xml | 116 ++--- xml/System/GC.xml | 10 +- xml/System/GenericUriParser.xml | 4 +- xml/System/GenericUriParserOptions.xml | 6 +- xml/System/IAsyncResult.xml | 2 +- xml/System/IConvertible.xml | 2 +- xml/System/ICustomFormatter.xml | 14 +- xml/System/IFormatProvider.xml | 6 +- xml/System/IFormattable.xml | 30 +- xml/System/IntPtr.xml | 2 +- xml/System/InvalidCastException.xml | 2 +- xml/System/LoaderOptimization.xml | 14 +- xml/System/LoaderOptimizationAttribute.xml | 3 - xml/System/LocalDataStoreSlot.xml | 6 +- xml/System/MarshalByRefObject.xml | 44 +- xml/System/Math.xml | 2 +- xml/System/MethodAccessException.xml | 7 +- xml/System/NonSerializedAttribute.xml | 35 +- xml/System/OperatingSystem.xml | 4 +- xml/System/OutOfMemoryException.xml | 5 +- xml/System/PlatformID.xml | 2 +- xml/System/Progress`1.xml | 2 +- xml/System/Random.xml | 28 +- xml/System/ResolveEventArgs.xml | 3 +- xml/System/ResolveEventHandler.xml | 2 +- xml/System/STAThreadAttribute.xml | 12 +- xml/System/Single.xml | 70 ++- xml/System/String.xml | 132 ++---- xml/System/StringComparer.xml | 4 +- xml/System/StringSplitOptions.xml | 4 +- xml/System/TimeSpan.xml | 2 +- xml/System/TimeZone.xml | 2 +- xml/System/TimeZoneInfo.xml | 4 +- xml/System/Tuple.xml | 11 +- xml/System/TupleExtensions.xml | 24 +- xml/System/Type.xml | 424 ++++++------------ xml/System/TypeAccessException.xml | 6 +- xml/System/TypedReference.xml | 5 - xml/System/UIntPtr.xml | 2 +- xml/System/Uri.xml | 56 +-- xml/System/UriBuilder.xml | 16 +- xml/System/ValueType.xml | 2 +- xml/System/Version.xml | 6 - 63 files changed, 518 insertions(+), 1389 deletions(-) diff --git a/xml/System/Activator.xml b/xml/System/Activator.xml index 9e8f647032f..884c84b0455 100644 --- a/xml/System/Activator.xml +++ b/xml/System/Activator.xml @@ -278,17 +278,9 @@ `assemblyName` can be either of the following: - The simple name of an assembly, without its path or file extension. For example, you would specify `TypeExtensions` for an assembly whose path and name are .\bin\TypeExtensions.dll. - - The full name of a signed assembly, which consists of its simple name, version, culture, and public key token; for example, "TypeExtensions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=181869f2f7435b51". - For more information on how the common language runtime identifies and loads assemblies, see [How the Runtime Locates Assemblies](/dotnet/framework/deployment/how-the-runtime-locates-assemblies). For information on using the application configuration file to define assembly locations, see [Specifying an Assembly's Location](/dotnet/framework/configure-apps/specify-assembly-location). If `assemblyName` is found, it is loaded in the default context. - - 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. - - +Assembly loads triggered by this API are affected by the current value of . ## Examples The following example defines a class named `Person` in an assembly named `PersonInfo`. Note that the `Person` class has two constructors, one of which is parameterless. @@ -631,7 +623,7 @@ ## Remarks Use to unwrap the return value. - In .NET Core 3.0 and later versions, assembly loads triggered by this API are affected by the current value of . +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. @@ -1089,7 +1081,7 @@ An error occurred when attempting remote activation in a target specified in to unwrap the return value. - In .NET Core 3.0 and later versions, assembly loads triggered by this API are affected by the current value of . +Assembly loads triggered by this API are affected by the current value of . > [!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 fbc5e3f9054..126f23e1df1 100644 --- a/xml/System/AppContext.xml +++ b/xml/System/AppContext.xml @@ -65,8 +65,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 @@ -114,11 +112,7 @@ property of the current application domain. - -In .NET 5 and later versions, for bundled assemblies, the value returned is the containing directory of the host executable. +For bundled assemblies, the value returned is the containing directory of the host executable. ]]> @@ -285,22 +279,6 @@ In .NET 5 and later versions, for bundled assemblies, the value returned is the > - *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. @@ -369,7 +347,7 @@ In .NET 5 and later versions, for bundled assemblies, the value returned is the property. For a list of target framework names for .NET Framework, see the [<supportedRuntime> Element](/dotnet/framework/configure-apps/file-schema/startup/supportedruntime-element) element. + The name of the target framework version corresponds to the value of the property. ]]> diff --git a/xml/System/AppDomain.xml b/xml/System/AppDomain.xml index 0cf417cce8e..42aa011c9de 100644 --- a/xml/System/AppDomain.xml +++ b/xml/System/AppDomain.xml @@ -69,45 +69,10 @@ objects, help provide isolation, unloading, and security boundaries for executing managed code. - -- Use application domains to isolate tasks that might bring down a process. If the state of the that's executing a task becomes unstable, the can be unloaded without affecting the process. This is important when a process must run for long periods without restarting. You can also use application domains to isolate tasks that should not share data. -- If an assembly is loaded into the default application domain, it cannot be unloaded from memory while the process is running. However, if you open a second application domain to load and execute the assembly, the assembly is unloaded when that application domain is unloaded. Use this technique to minimize the working set of long-running processes that occasionally use large DLLs. - - > [!NOTE] - > On .NET Core and .NET 5+, the implementation is limited by design and does not provide isolation, unloading, or security boundaries. These versions have exactly one . Isolation and unloading are provided through . Security boundaries should be provided by process boundaries and appropriate remoting techniques. - - Multiple application domains can run in a single process; however, there is not a one-to-one correlation between application domains and threads. Several threads can belong to a single application domain, and while a given thread is not confined to a single application domain, at any given time, a thread executes in a single application domain. - - Application domains are created using the method. instances are used to load and execute assemblies (). When an is no longer in use, it can be unloaded. - - The class implements a set of events that enable applications to respond when an assembly is loaded, when an application domain will be unloaded, or when an unhandled exception is thrown. - - For more information on using application domains, see [Application Domains](/dotnet/framework/app-domains/application-domains). - - 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`. - -## Examples - This example shows how to create a new , instantiate a type in that new , and communicate with that type's object. In addition, this example shows how to unload the causing the object to be garbage collected. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/AppDomainX/cpp/AppDomainX.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System/AppDomain/Overview/AppDomainX.cs" id="Snippet1"::: - :::code language="fsharp" source="~/snippets/fsharp/System/AppDomain/Overview/AppDomainX.fs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System/AppDomain/Overview/AppDomainX.vb" id="Snippet1"::: +In modern .NET versions, the implementation is limited by design and does not provide isolation, unloading, or security boundaries. These versions have exactly one . Isolation and unloading are provided through . Security boundaries should be provided by process boundaries and appropriate remoting techniques. ]]> - 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 @@ -170,16 +135,7 @@ Application domains, which are represented by objects, h The name of the directory to be appended to the private path. Appends the specified directory name to the private path list. - - property instead. - - The private path, or relative search path, is the path relative to the base directory where the assembly resolver probes for private assemblies. - - ]]> - + To be added. The operation is attempted on an unloaded application domain. @@ -228,14 +184,7 @@ Application domains, which are represented by objects, h The assembly display name, in the form provided by the property. Returns the assembly display name after policy has been applied. A string containing the assembly display name after policy has been applied. - - method takes an assembly display name and returns the post-policy display name. This is useful if you need to load an assembly using policy, because the reflection-only context does not apply policy. - - ]]> - + To be added. @@ -368,20 +317,18 @@ 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 . +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. +> 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. For this event, the property returns the assembly name before policy is applied. > [!IMPORTANT] -> If more than one event handler is registered for this event, the event handlers are called in order until an event handler returns a value that isn't `null`. Subsequent event handlers are ignored. +> If more than one event handler is registered for this event, the event handlers are called in order until an event handler returns a value that isn't `null`. Subsequent event handlers are ignored. For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). - - ## Examples The following sample demonstrates the event. @@ -666,30 +613,9 @@ Application domains, which are represented by objects, h The friendly name of the domain. Creates a new application domain with the specified name. The newly created application domain. - - information from the default application domain. - -## Examples - The following sample demonstrates, in general, how to create a domain using one of the overloads. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/AppDomain_Setup/CPP/setup.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System/AppDomain/CreateDomain/setup.cs" id="Snippet1"::: - :::code language="fsharp" source="~/snippets/fsharp/System/AppDomain/CreateDomain/setup.fs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System/AppDomain/CreateDomain/setup.vb" id="Snippet1"::: - - ]]> - - - is . - .NET Core and .NET 5+ only: In all cases. + To be added. + In all cases. Unavailable technologies on .NET Core/5+: Application domains - @@ -2754,14 +2680,12 @@ This method overload uses the information from the The event can be handled per application domain. If a thread passes through multiple application domains while executing a call, the event is raised in each application domain that has registered an event handler, before the CLR begins searching for a matching exception handler in that application domain. After the event has been handled, a search is made for a matching exception handler in that application domain. If none is found, the event is raised in the next application domain. - You must handle all exceptions that occur in the event handler for the event. Otherwise, is raised recursively. This could result in a stack overflow and termination of the application. We recommend that you implement event handlers for this event as constrained execution regions (CERs), to keep infrastructure-related exceptions such as out-of-memory or stack overflow from affecting the virtual machine while the exception notification is being processed. + You must handle all exceptions that occur in the event handler for the event. Otherwise, is raised recursively. This could result in a stack overflow and termination of the application. This event is not raised for exceptions that indicate corruption of process state, such as access violations, unless the event handler is security-critical and has the attribute. The common language runtime suspends thread aborts while this notification event is being handled. - - ## Examples The following example creates a series of application domains named `AD0` through `AD3`, with a `Worker` object in each application domain. Each `Worker` object has a reference to the `Worker` object in the next application domain, except for the `Worker` in the last application domain. The event is handled in all application domains except `AD1`. @@ -2835,7 +2759,7 @@ This method overload uses the information from the ## Remarks -The friendly name of the default application domain is the file name of the process executable. For example, if the executable used to start the process is `"c:\MyAppDirectory\MyAssembly.exe"`, the friendly name of the default application domain is `"MyAssembly.exe"`. (In .NET Core and .NET 5+, the friendly name doesn't include the file extension.) +The friendly name of the default application domain is the file name of the process executable. For example, if the executable used to start the process is `"c:\MyAppDirectory\MyAssembly.exe"`, the friendly name of the default application domain is `"MyAssembly"`. The friendly name doesn't include the file extension. ## Examples The following code example uses the property to get the friendly name of the current application domain. For the default application domain, the friendly name is the name of the application's executable file. The code example also displays additional information about the application domain. @@ -3193,17 +3117,7 @@ The friendly name of the default application domain is the file name of the proc 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).| -|"NetFx40_Legacy20SortingBehavior"|String sorting defaults for the .NET Framework 3.5 are enabled in this application domain. Its success requires sort00001000.dll to be installed. See [<CompatSortNLSVersion> Element](/dotnet/framework/configure-apps/file-schema/runtime/compatsortnlsversion-element).| -|"NetFx40_Legacy40SortingBehavior"|String sorting defaults for the .NET Framework 4and Unicode 5.0 are enabled in this application domain. Its success requires sort00060101.dll to be installed.| -|"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.| -|"UseRandomizedStringHashAlgorithm"|The runtime calculates hash codes for strings on a per application domain basis instead of using a single hashing algorithm that produces a consistent hash code across application domains. See [<UseRandomizedStringHashAlgorithm> Element](/dotnet/framework/configure-apps/file-schema/runtime/userandomizedstringhashalgorithm-element).| + 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 .NET. They are set by calling the method before creating an application domain. ]]> @@ -3380,31 +3294,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. - - 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. @@ -3447,20 +3339,8 @@ 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. - - ]]> - - + in call cases. + To be added. @@ -3846,7 +3726,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 @@ -4104,11 +3983,8 @@ 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. - ]]> - @@ -4165,14 +4041,7 @@ 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. +This event is raised in each application domain that registers an event handler. For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). @@ -5310,36 +5179,10 @@ The following example demonstrates the An application domain to unload. Unloads the specified application domain. - - , the target domain is marked for unloading. The dedicated thread attempts to unload the domain, and all threads in the domain are aborted. If a thread does not abort, for example because it is executing unmanaged code, or because it is executing a `finally` block, then after a period of time, a is thrown in the thread that originally called . If the thread that could not be aborted eventually ends, the target domain is not unloaded. Thus, `domain` is not guaranteed to unload, because it might not be possible to terminate executing threads. - -> [!NOTE] -> In some cases, calling causes an immediate , for example if it is called in a finalizer. - -The threads in `domain` are terminated using the method, which throws a in the thread. Although the thread should terminate promptly, it can continue executing for an unpredictable amount of time in a `finally` clause. - -## Examples - The following code example shows how to unload an application domain. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/ADUnload/CPP/adunload.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System/AppDomain/Unload/adunload.cs" id="Snippet1"::: - :::code language="fsharp" source="~/snippets/fsharp/System/AppDomain/Unload/adunload.fs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System/AppDomain/Unload/adunload.vb" id="Snippet1"::: - - ]]> - + To be added. is . - -.NET Core and .NET 5+ only: In all cases. - --or- - - could not be unloaded. + In all cases. An error occurred during the unload process. Unavailable technologies on .NET Core/5+: Application domains diff --git a/xml/System/AppDomainSetup.xml b/xml/System/AppDomainSetup.xml index 88f6aa2d225..a6e03f349d2 100644 --- a/xml/System/AppDomainSetup.xml +++ b/xml/System/AppDomainSetup.xml @@ -57,12 +57,8 @@ 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 - ]]> - How To: Configure an Application Domain @@ -137,29 +133,7 @@ Gets the name of the directory containing the application. The name of the application base directory. - - property can influence which permissions are granted to an application domain. For example, an application domain originating from the local computer normally receives full trust based on its location of origin. However, if the property of that is set to the full name of an intranet directory, the setting restricts the permissions granted to the application domain to a LocalIntranet grant even though the application domain actually originates from the local computer. - - - -## Examples - The following example demonstrates how to use the property to set the location where the assembly loader begins probing for assemblies to load into a new application domain. - -> [!NOTE] -> You must ensure that the folder you specify exists. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/ADApplicationBase/CPP/adapplicationbase.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System/AppDomain/CurrentDomain/adapplicationbase.cs" id="Snippet1"::: - :::code language="fsharp" source="~/snippets/fsharp/System/AppDomain/CurrentDomain/adapplicationbase.fs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System/AppDomain/CurrentDomain/adapplicationbase.vb" id="Snippet1"::: - - ]]> - + To be added. @@ -194,18 +168,9 @@ System.String - Gets (or, in .NET Framework, sets) a string that specifies the target framework in a format that can be parsed by the constructor. + Gets a string that specifies the target framework in a format that can be parsed by the constructor. The target framework of the executable that started the process. - - property is inferred from the attribute. In Visual Studio 2010 and later, this attribute is added to the assembly automatically based on the setting of the project's **Target Framework** property. - - ]]> - + To be added. diff --git a/xml/System/AppDomainUnloadedException.xml b/xml/System/AppDomainUnloadedException.xml index a1571811153..dcfc72e99e9 100644 --- a/xml/System/AppDomainUnloadedException.xml +++ b/xml/System/AppDomainUnloadedException.xml @@ -65,42 +65,17 @@ 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. +An 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. - - Example 1 - - The following code example defines a `TestClass` class that can be marshaled across application domain boundaries and an `Example` class containing a `static` (`Shared` in Visual Basic) `ThreadProc` method. The `ThreadProc` method creates an application domain, creates a `TestClass` object in the domain, and calls a method of `TestClass` that unloads the executing domain, causing an . - - The `TestClass` method is executed without exception handling from a thread and from an ordinary thread, demonstrating that the unhandled exception terminates the task or thread but not the application. It is then executed with and without exception handling from the main application thread, demonstrating that it terminates the application if not handled. - - :::code language="csharp" source="~/snippets/csharp/System/AppDomainUnloadedException/Overview/Sample.cs" id="Snippet1"::: - :::code language="fsharp" source="~/snippets/fsharp/System/AppDomainUnloadedException/Overview/Sample.fs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System/AppDomainUnloadedException/Overview/Sample.vb" id="Snippet1"::: - - Example 2 - - The following code example creates and unloads an application domain, and demonstrates that an is thrown on a subsequent attempt to access the unloaded domain. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/ADUnload/CPP/adunload.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System/AppDomain/Unload/adunload.cs" id="Snippet1"::: - :::code language="fsharp" source="~/snippets/fsharp/System/AppDomain/Unload/adunload.fs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System/AppDomain/Unload/adunload.vb" id="Snippet1"::: - ]]> diff --git a/xml/System/ArgumentNullException.xml b/xml/System/ArgumentNullException.xml index c2a5a2817ae..2480e27a16d 100644 --- a/xml/System/ArgumentNullException.xml +++ b/xml/System/ArgumentNullException.xml @@ -196,11 +196,11 @@ The following table shows the initial property values for an instance of . -|Property|Value| -|--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||A localized error message string that identifies the null argument. For example, if the `paramName` argument is "arg1", the English language message string is:

On .NET 5+ and .NET Core: `Value cannot be null. (Parameter name: 'arg1')`

On .NET Framework: `Value cannot be null.\r\nParameter name: arg1`| -||The parameter name string.| +| Property | Value | +|-----------------------------------------|-----------------------------------------------| +| | A null reference (`Nothing` in Visual Basic). | +| | A localized error message string that identifies the null argument. For example, if the `paramName` argument is "arg1", the English language message string is `Value cannot be null. (Parameter name: 'arg1') | +| | The parameter name string. | ]]> diff --git a/xml/System/Array.xml b/xml/System/Array.xml index 1d94599f346..1f0c88a5769 100644 --- a/xml/System/Array.xml +++ b/xml/System/Array.xml @@ -91,9 +91,7 @@ Unlike the classes in the namespaces, has a fixed capacity. To increase the capacity, you must create a new object with the required capacity, copy the elements from the old object to the new one, and delete the old . - 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. + 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).ent) 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 . @@ -1373,7 +1371,7 @@ The arrays can be reference-type or value-type arrays. If `sourceArray` and `destinationArray` are both reference-type arrays or are both arrays of type , a shallow copy is performed. A shallow copy of an is a new containing references to the same elements as the original . The elements themselves or anything referenced by the elements are not copied. In contrast, a deep copy of an copies the elements and everything directly or indirectly referenced by the elements. - If this method throws an exception while copying, the `destinationArray` remains unchanged; therefore, can be used within a constrained execution region (). + If this method throws an exception while copying, the `destinationArray` remains unchanged. This method is an $O(n)$ operation, where $n$ is `length`. @@ -1407,8 +1405,6 @@ is greater than the number of elements from to the end of . - - @@ -8080,9 +8076,6 @@ This method is an O(`n` log `n`) operation, where `n` is the is , and one or more elements in do not implement the interface. The implementation of caused an error during the sort. For example, might not return 0 when comparing an item with itself. - - .NET Framework 4 and earlier versions used only the Quicksort algorithm. Quicksort identifies invalid comparers in some situations in which the sorting operation throws an exception, and throws an exception to the caller. Starting with .NET Framework 4.5, it is possible that sorting operations that previously threw will not throw an exception, because the insertion sort and heapsort algorithms do not detect an invalid comparer. For the most part, this applies to arrays with less than or equal to 16 elements. - @@ -8213,9 +8206,6 @@ This method is an O(`n` log `n`) operation, where `n` is the caused an error during the sort. For example, might not return 0 when comparing an item with itself. is , and one or more elements in the do not implement the interface. - - .NET Framework 4 and earlier versions used only the Quicksort algorithm. Quicksort identifies invalid comparers in some situations in which the sorting operation throws an exception, and throws an exception to the caller. Starting with .NET Framework 4.5, it is possible that sorting operations that previously threw will not throw an exception, because the insertion sort and heapsort algorithms do not detect an invalid comparer. For the most part, this applies to arrays with less than or equal to 16 elements. - @@ -8564,9 +8554,6 @@ This method is an O(`n` log `n`) operation, where `n` is the caused an error during the sort. For example, might not return 0 when comparing an item with itself. is , and one or more elements in do not implement the interface. - - .NET Framework 4 and earlier versions used only the Quicksort algorithm. Quicksort identifies invalid comparers in some situations in which the sorting operation throws an exception, and throws an exception to the caller. Starting with .NET Framework 4.5, it is possible that sorting operations that previously threw will not throw an exception, because the insertion sort and heapsort algorithms do not detect an invalid comparer. For the most part, this applies to arrays with less than or equal to 16 elements. - @@ -8719,9 +8706,6 @@ This method is an O(`n` log `n`) operation, where `n` is the caused an error during the sort. For example, might not return 0 when comparing an item with itself. is , and one or more elements in the do not implement the interface. - - .NET Framework 4 and earlier versions used only the Quicksort algorithm. Quicksort identifies invalid comparers in some situations in which the sorting operation throws an exception, and throws an exception to the caller. Starting with .NET Framework 4.5, it is possible that sorting operations that previously threw will not throw an exception, because the insertion sort and heapsort algorithms do not detect an invalid comparer. For the most part, this applies to arrays with less than or equal to 16 elements. - @@ -8935,9 +8919,6 @@ This method is an O(`n` log `n`) operation, where `n` is the is , and one or more elements in do not implement the generic interface. The implementation of caused an error during the sort. For example, might not return 0 when comparing an item with itself. - - .NET Framework 4 and earlier versions used only the Quicksort algorithm. Quicksort identifies invalid comparers in some situations in which the sorting operation throws an exception, and throws an exception to the caller. Starting with .NET Framework 4.5, it is possible that sorting operations that previously threw will not throw an exception, because the insertion sort and heapsort algorithms do not detect an invalid comparer. For the most part, this applies to arrays with less than or equal to 16 elements. - @@ -9039,9 +9020,6 @@ This method is an O(`n` log `n`) operation, where `n` is the is . The implementation of caused an error during the sort. For example, might not return 0 when comparing an item with itself. - - .NET Framework 4 and earlier versions used only the Quicksort algorithm. Quicksort identifies invalid comparers in some situations in which the sorting operation throws an exception, and throws an exception to the caller. Starting with .NET Framework 4.5, it is possible that sorting operations that previously threw will not throw an exception, because the insertion sort and heapsort algorithms do not detect an invalid comparer. For the most part, this applies to arrays with less than or equal to 6 elements. - Performing Culture-Insensitive String Operations in Arrays @@ -9279,9 +9257,6 @@ This method is an O(`n` log `n`) operation, where `n` is the caused an error during the sort. For example, might not return 0 when comparing an item with itself. is , and one or more elements in do not implement the generic interface. - - .NET Framework 4 and earlier versions used only the Quicksort algorithm. Quicksort identifies invalid comparers in some situations in which the sorting operation throws an exception, and throws an exception to the caller. Starting with .NET Framework 4.5, it is possible that sorting operations that previously threw will not throw an exception, because the insertion sort and heapsort algorithms do not detect an invalid comparer. For the most part, this applies to arrays with less than or equal to 16 elements. - @@ -9548,9 +9523,6 @@ This method is an O(`n` log `n`) operation, where `n` is the caused an error during the sort. For example, might not return 0 when comparing an item with itself. is , and one or more elements in the do not implement the generic interface. - - .NET Framework 4 and earlier versions used only the Quicksort algorithm. Quicksort identifies invalid comparers in some situations in which the sorting operation throws an exception, and throws an exception to the caller. Starting with .NET Framework 4.5, it is possible that sorting operations that previously threw will not throw an exception, because the insertion sort and heapsort algorithms do not detect an invalid comparer. For the most part, this applies to arrays with less than or equal to 16 elements. - @@ -9850,9 +9822,6 @@ This method is an O(`n` log `n`) operation, where `n` is the caused an error during the sort. For example, might not return 0 when comparing an item with itself. is , and one or more elements in the do not implement the generic interface. - - .NET Framework 4 and earlier versions used only the Quicksort algorithm. Quicksort identifies invalid comparers in some situations in which the sorting operation throws an exception, and throws an exception to the caller. Starting with .NET Framework 4.5, it is possible that sorting operations that previously threw will not throw an exception, because the insertion sort and heapsort algorithms do not detect an invalid comparer. For the most part, this applies to arrays with less than or equal to 16 elements. - diff --git a/xml/System/ArraySegment`1.xml b/xml/System/ArraySegment`1.xml index d361fede6fc..fbd91d57ff6 100644 --- a/xml/System/ArraySegment`1.xml +++ b/xml/System/ArraySegment`1.xml @@ -95,9 +95,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. @@ -115,9 +112,7 @@ The method and the equality and inequality operators test for reference equality when they compare two objects. For two objects to be considered equal, they must meet all of the following conditions: - Reference the same array. - - Begin at the same index in the array. - - Have the same number of elements. If you want to retrieve an element by its index in the object, you must cast it to an object and retrieve it or modify it by using the property. Note that this is not necessary in F#. The following example retrieves the element in an object that delimits a section of a string array. @@ -126,8 +121,6 @@ :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.arraysegment.class/fs/example1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/ArraySegmentT/Overview/example1.vb" id="Snippet1"::: - - ## Examples The following code example passes an structure to a method. diff --git a/xml/System/Attribute.xml b/xml/System/Attribute.xml index 138d276646b..b9ecec67382 100644 --- a/xml/System/Attribute.xml +++ b/xml/System/Attribute.xml @@ -281,9 +281,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. @@ -358,9 +355,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. @@ -585,11 +579,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. @@ -663,11 +652,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. @@ -895,11 +879,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. @@ -962,9 +941,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. @@ -1214,11 +1190,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. @@ -1285,9 +1256,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. @@ -1620,11 +1588,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. @@ -1698,9 +1661,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. @@ -1920,9 +1880,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. @@ -2117,11 +2074,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. @@ -2189,9 +2141,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. @@ -2398,11 +2347,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. @@ -2469,11 +2413,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/BadImageFormatException.xml b/xml/System/BadImageFormatException.xml index 9aa16449a8b..e64b5a99785 100644 --- a/xml/System/BadImageFormatException.xml +++ b/xml/System/BadImageFormatException.xml @@ -69,50 +69,42 @@ - An earlier version of a .NET utility, such as ILDasm.exe or installutil.exe, is used with an assembly that was developed with a later version of .NET. - To address this exception, use the version of the tool that corresponds to the version of .NET that was used to develop the assembly. This may require modifying the `Path` environment variable or providing a fully qualified path to the correct executable. + To address this exception, use the version of the tool that corresponds to the version of .NET that was used to develop the assembly. This may require modifying the `Path` environment variable or providing a fully qualified path to the correct executable. - You are trying to load an unmanaged dynamic link library or executable (such as a Windows system DLL) as if it were a .NET assembly. The following example illustrates this by using the method to load Kernel32.dll. - :::code language="csharp" source="~/snippets/csharp/System/BadImageFormatException/Overview/condition1.cs" id="Snippet1"::: - :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.badimageformatexception.class/fs/condition1.fs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System/BadImageFormatException/Overview/condition1.vb" id="Snippet1"::: + :::code language="csharp" source="~/snippets/csharp/System/BadImageFormatException/Overview/condition1.cs" id="Snippet1"::: + :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.badimageformatexception.class/fs/condition1.fs" id="Snippet1"::: + :::code language="vb" source="~/snippets/visualbasic/System/BadImageFormatException/Overview/condition1.vb" id="Snippet1"::: - To address this exception, access the methods defined in the DLL by using the features provided by your development language, such as the `Declare` statement in Visual Basic or the attribute with the `extern` keyword in C# and F#. + To address this exception, access the methods defined in the DLL by using the features provided by your development language, such as the `Declare` statement in Visual Basic or the attribute with the `extern` keyword in C# and F#. - You are trying to load a reference assembly in a context other than the reflection-only context. You can address this issue in either of two ways: - - You can load the implementation assembly rather than the reference assembly. - - You can load the reference assembly in the reflection-only context by calling the method. + - You can load the implementation assembly rather than the reference assembly. + - You can load the reference assembly in the reflection-only context by calling the method. - A DLL or executable is loaded as a 64-bit assembly, but it contains 32-bit features or resources. For example, it relies on COM interop or calls methods in a 32-bit dynamic link library. - To address this exception, set the project's **Platform target** property to x86 (instead of x64 or AnyCPU) and recompile. + To address this exception, set the project's **Platform target** property to x86 (instead of x64 or AnyCPU) and recompile. -- Your application's components were created using different versions of .NET. Typically, this exception occurs when an application that was developed using .NET Framework 2.0 SP1 or .NET Framework 3.5 tries to load an assembly that was developed using .NET Framework 4 or later. The may be reported as a compile-time error, or the exception may be thrown at run time. The following example defines a `StringLib` class that has a single member, `ToProperCase`, and that resides in an assembly named StringLib.dll. +- Your application's components were created using different versions of .NET. The might be reported as a compile-time error, or it might be thrown at runtime. The following example defines a `StringLib` class that has a single member, `ToProperCase`, and that resides in an assembly named StringLib.dll. - :::code language="csharp" source="~/snippets/csharp/System/BadImageFormatException/Overview/stringlib.cs" id="Snippet2"::: - :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.badimageformatexception.class/fs/stringlib.fs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System/BadImageFormatException/Overview/stringlib.vb" id="Snippet2"::: - - The following example uses reflection to load an assembly named StringLib.dll. If the source code is compiled with a .NET Framework 1.1 compiler, a is thrown by the method. - - :::code language="csharp" source="~/snippets/csharp/System/BadImageFormatException/Overview/loadstringlib.cs" id="Snippet3"::: - :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.badimageformatexception.class/fs/loadstringlib.fs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/System/BadImageFormatException/Overview/loadstringlib.vb" id="Snippet3"::: - - To address this exception, make sure that the assembly whose code is executing and that throws the exception, and the assembly to be loaded, both target compatible versions of .NET. + :::code language="csharp" source="~/snippets/csharp/System/BadImageFormatException/Overview/stringlib.cs" id="Snippet2"::: + :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.badimageformatexception.class/fs/stringlib.fs" id="Snippet2"::: + :::code language="vb" source="~/snippets/visualbasic/System/BadImageFormatException/Overview/stringlib.vb" id="Snippet2"::: - The components of your application target different platforms. For example, you are trying to load ARM assemblies in an x86 application. You can use the following command-line utility to determine the target platforms of individual .NET assemblies. The list of files should be provided as a space-delimited list at the command line. - :::code language="csharp" source="~/snippets/csharp/System/BadImageFormatException/Overview/targetplatform1.cs" id="Snippet4"::: - :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.badimageformatexception.class/fs/targetplatform1.fs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/System/BadImageFormatException/Overview/targetplatform1.vb" id="Snippet4"::: + :::code language="csharp" source="~/snippets/csharp/System/BadImageFormatException/Overview/targetplatform1.cs" id="Snippet4"::: + :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.badimageformatexception.class/fs/targetplatform1.fs" id="Snippet4"::: + :::code language="vb" source="~/snippets/visualbasic/System/BadImageFormatException/Overview/targetplatform1.vb" id="Snippet4"::: - Reflecting on C++ executable files might throw this exception. This is most likely caused by the C++ compiler stripping the relocation addresses or the .Reloc section from the executable file. To preserve the .relocation address in a C++ executable file, specify /fixed:no when linking. - uses the HRESULT `COR_E_BADIMAGEFORMAT`, which has the value 0x8007000B. + uses the HRESULT `COR_E_BADIMAGEFORMAT`, which has the value 0x8007000B. - For a list of initial property values for an instance of , see the constructors. +For a list of initial property values for an instance of , see the constructors. ]]> diff --git a/xml/System/CannotUnloadAppDomainException.xml b/xml/System/CannotUnloadAppDomainException.xml index 8ff73b7ae1a..d36f8a1e24d 100644 --- a/xml/System/CannotUnloadAppDomainException.xml +++ b/xml/System/CannotUnloadAppDomainException.xml @@ -68,9 +68,7 @@ is thrown when there is an attempt to unload the following: - The default application domain, which must remain loaded during the lifetime of the application. - - An application domain with a running thread that cannot immediately stop execution. - - An application domain that has already been unloaded. uses the HRESULT COR_E_CANNOTUNLOADAPPDOMAIN, which has the value 0x80131015. diff --git a/xml/System/Char.xml b/xml/System/Char.xml index 63dde987094..b49fb77744b 100644 --- a/xml/System/Char.xml +++ b/xml/System/Char.xml @@ -1177,7 +1177,7 @@ 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/). +Unicode characters are classified based on [The Unicode Standard, Version 8.0.0](https://www.unicode.org/versions/Unicode8.0.0/). ]]> @@ -1238,7 +1238,7 @@ 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/). +Unicode characters are classified based on [The Unicode Standard, Version 8.0.0](https://www.unicode.org/versions/Unicode8.0.0/). ]]> diff --git a/xml/System/Console.xml b/xml/System/Console.xml index 32f4fa4e148..d5006418517 100644 --- a/xml/System/Console.xml +++ b/xml/System/Console.xml @@ -1409,7 +1409,7 @@ 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. +A property get operation might 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. ]]> @@ -2663,7 +2663,7 @@ 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. +A property get operation might 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. ]]> @@ -2671,12 +2671,11 @@ This method can be used to reacquire the standard output stream after it has bee An error occurred during the execution of this operation. Your application does not have permission to perform this operation. - Of the Unicode encodings, the class supports UTF-8 encoding with the class and, starting with the .NET Framework 4.5, it supports UTF-16 encoding with the class. UTF-32 encoding with the class is not supported. Attempting to set the output encoding to UTF-32 throws an . + Of the Unicode encodings, the class supports UTF-8 encoding with the class and it supports UTF-16 encoding with the class. UTF-32 encoding with the class is not supported. Attempting to set the output encoding to UTF-32 throws an . Note that successfully displaying Unicode characters to the console requires the following: - The console must use a TrueType font, such as Lucida Console or Consolas, to display characters. - - A font used by the console must define the particular glyph or glyphs to be displayed. The console can take advantage of font linking to display glyphs from linked fonts if the base font does not contain a definition for that glyph. For more information about support for Unicode encoding by the console, see the "Unicode Support for the Console" section in the class. diff --git a/xml/System/ConsoleCancelEventArgs.xml b/xml/System/ConsoleCancelEventArgs.xml index 7b7bc15a569..5ddc243faec 100644 --- a/xml/System/ConsoleCancelEventArgs.xml +++ b/xml/System/ConsoleCancelEventArgs.xml @@ -112,8 +112,6 @@ In a set operation after Ctrl+C is pressed, specify `true` to indicate that the current process should resume when the event handler concludes, or `false` to indicate that the current process should terminate. - - ## Examples The following example demonstrates how to use the property to handle an event. @@ -124,7 +122,7 @@ ]]> - In the .NET Framework 3.5 and .NET Framework 4, attempting to set the property to if the event was invoked by the user pressing Ctrl+Break threw an exception. In the .NET Framework 4.5, you can set the property to after the user presses Ctrl+Break and cancel the termination of the application. + You can set the property to after the user presses Ctrl+Break and cancel the termination of the application. diff --git a/xml/System/DateTime.xml b/xml/System/DateTime.xml index 713c6e9d220..1e59e7b6ffd 100644 --- a/xml/System/DateTime.xml +++ b/xml/System/DateTime.xml @@ -1675,7 +1675,7 @@ For applications in which portability of date and time data or a limited degree 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. +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. @@ -1744,7 +1744,7 @@ For applications in which portability of date and time data or a limited degree 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. +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. @@ -1863,7 +1863,7 @@ The value parameter is rounded to the nearest integer. 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. +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. @@ -1931,7 +1931,7 @@ The value parameter is rounded to the nearest integer. 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 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 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. @@ -2071,7 +2071,7 @@ The value parameter is rounded to the nearest integer. 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. +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. @@ -3237,7 +3237,7 @@ The value parameter is rounded to the nearest integer. The `fileTime` parameter specifies a file time expressed in 100-nanosecond ticks. - Starting with the .NET Framework version 2.0, the return value is a whose property is . +The return value is a whose property is . @@ -3321,7 +3321,7 @@ The value parameter is rounded to the nearest integer. The `fileTime` parameter specifies a file time expressed in 100-nanosecond ticks. - Starting with the .NET Framework version 2.0, the return value is a whose property is . +The return value is a whose property is . ]]> @@ -4715,7 +4715,7 @@ 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 returns . > [!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. @@ -5414,9 +5414,9 @@ The following example parses strings in each of these formats by using the forma > [!IMPORTANT] > Note that the formatting conventions for a particular culture are dynamic and can be subject to change. This means that parsing operations that depend on the formatting conventions of the default (current) culture or that specify an object that represents a culture other than the invariant culture can unexpectedly fail if any of the following occurs: > -> - The culture-specific data has changed between major or minor versions of the .NET Framework or as the result of an update to the existing version of the .NET Framework. -> - The culture-specific data reflects user preferences, which can vary from machine to machine or session to session. -> - The culture-specific data represents a replacement culture that overrides the settings of a standard culture or a custom culture. +> - The culture-specific data has changed between major or minor versions of .NET or as the result of an update to the existing version of .NET. +> - The culture-specific data reflects user preferences, which can vary from machine to machine or session to session. +> - The culture-specific data represents a replacement culture that overrides the settings of a standard culture or a custom culture. > > To prevent the difficulties in parsing data and time strings that are associated with changes in cultural data, you can parse date and time strings by using the invariant culture, or you can call the or method and specify the exact format of the string to be parsed. If you are serializing and deserializing date and time data, you can either use the formatting conventions of the invariant culture, or you can serialize and deserialize the value in a binary format. > @@ -5429,7 +5429,7 @@ The following example parses strings in each of these formats by using the forma |DateTimeStyles member|Effect on conversion| |---------------------------|--------------------------| -||Parses `s` and, if necessary, converts it to UTC, as follows:

- If `s` includes a time zone offset, or if `s` contains no time zone information but `styles` includes the flag, the method parses the string, calls to convert the returned value to UTC, and sets the property to .
- If `s` indicates that it represents UTC, or if `s` does not contain time zone information but `styles` includes the flag, the method parses the string, performs no time zone conversion on the returned value, and sets the property to .
- In all other cases, the flag has no effect.| +||Parses `s` and, if necessary, converts it to UTC, as follows:

- If `s` includes a time zone offset, or if `s` contains no time zone information but `styles` includes the flag, the method parses the string, calls to convert the returned value to UTC, and sets the property to .
- If `s` indicates that it represents UTC, or if `s` does not contain time zone information but `styles` includes the flag, the method parses the string, performs no time zone conversion on the returned value, and sets the property to .
- In all other cases, the flag has no effect.| ||This value is ignored. Inner white space is always permitted in the date and time elements of `s`.| ||This value is ignored. Leading white space is always permitted in the date and time elements of `s`.| ||This value is ignored. Trailing white space is always permitted in the date and time elements of `s`.| @@ -5471,7 +5471,7 @@ The `DateTime.Parse` overloads return a value whose
@@ -5557,7 +5557,7 @@ It handles the exception that is thrown when the m - Parsing Date and Time Strings in the .NET Framework + Parsing Date and Time Strings in .NET Standard Date and Time Format Strings Custom Date and Time Format Strings @@ -5691,7 +5691,7 @@ The following example parses an array of date strings by using the conventions o - Parsing Date and Time Strings in the .NET Framework + Parsing Date and Time Strings in .NET Standard Date and Time Format Strings Custom Date and Time Format Strings @@ -5837,7 +5837,7 @@ The following example demonstrates the - Parsing Date and Time Strings in the .NET Framework + Parsing Date and Time Strings in .NET Standard Date and Time Format Strings Custom Date and Time Format Strings How to: Round-trip Date and Time Values @@ -5973,13 +5973,10 @@ The following example demonstrates the do not agree. - - In the .NET Framework 4, the method throws a if the string to be parsed contains an hour component and an AM/PM designator that are not in agreement. In the .NET Framework 3.5 and earlier versions, the AM/PM designator is ignored. - - Parsing Date and Time Strings in the .NET Framework + Parsing Date and Time Strings in .NET Standard Date and Time Format Strings Custom Date and Time Format Strings @@ -6234,13 +6231,10 @@ The following example demonstrates the do not agree. contains an invalid combination of values. For example, both and . - - In the .NET Framework 4, the method throws a if the string to be parsed contains an hour component and an AM/PM designator that are not in agreement. In the .NET Framework 3.5 and earlier versions, the AM/PM designator is ignored. - - Parsing Date and Time Strings in the .NET Framework + Parsing Date and Time Strings in .NET Standard Date and Time Format Strings Custom Date and Time Format Strings @@ -6378,13 +6372,10 @@ The following example demonstrates the do not agree. contains an invalid combination of values. For example, both and . - - In the .NET Framework 4, the method throws a if the string to be parsed contains an hour component and an AM/PM designator that are not in agreement. In the .NET Framework 3.5 and earlier versions, the AM/PM designator is ignored. - - Parsing Date and Time Strings in the .NET Framework + Parsing Date and Time Strings in .NET Standard Date and Time Format Strings Custom Date and Time Format Strings @@ -6508,7 +6499,6 @@ The following example demonstrates the - COM Interoperability in .NET Framework Applications (Visual Basic)
@@ -6652,21 +6642,21 @@ The following example demonstrates the method allows you to subtract a time interval that consists of more than one unit of time (such as a given number of hours and a given number of minutes). To subtract a single unit of time (such as years, months, or days) from the instance, you can pass a negative numeric value as a parameter to any of the following methods: -- , to subtract a specific number of years from the current date and time instance. +- , to subtract a specific number of years from the current date and time instance. -- , to subtract a specific number of months from the current date and time instance. +- , to subtract a specific number of months from the current date and time instance. -- , to subtract a specific number of days from the current date and time instance. +- , to subtract a specific number of days from the current date and time instance. -- , to subtract a specific number of hours from the current date and time instance. +- , to subtract a specific number of hours from the current date and time instance. -- , to subtract a specific number of minutes from the current date and time instance. +- , to subtract a specific number of minutes from the current date and time instance. -- , to subtract a specific number of seconds from the current date and time instance. +- , to subtract a specific number of seconds from the current date and time instance. -- , to subtract a specific number of milliseconds from the current date and time instance. +- , to subtract a specific number of milliseconds from the current date and time instance. -- , to subtract a specific number of ticks from the current date and time instance. +- , to subtract a specific number of ticks from the current date and time instance. @@ -7818,7 +7808,7 @@ In general, the ticks represent the time according to the time zone specified by whose property returns . +The return value is a 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. @@ -8026,7 +8016,7 @@ In general, the ticks represent the time according to the time zone specified by > [!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. - 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| |----------|-------------| @@ -8868,7 +8858,7 @@ 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. +The value returned by the method is determined by the property of the current object. The following table describes the possible results. |Kind|Results| |----------|-------------| @@ -9176,7 +9166,7 @@ The following example illustrates how the string representation of a - Parsing Date and Time Strings in the .NET Framework + Parsing Date and Time Strings in .NET Standard Date and Time Format Strings Custom Date and Time Format Strings Sample: .NET Core WinForms Formatting Utility (C#) @@ -9407,7 +9397,7 @@ The following example illustrates the - Parsing Date and Time Strings in the .NET Framework + Parsing Date and Time Strings in .NET Standard Date and Time Format Strings Custom Date and Time Format Strings @@ -9713,12 +9703,12 @@ The following example illustrates the contains an invalid combination of values (for example, both and ). - In the .NET Framework 4, the method returns if the string to be parsed contains an hour component and an AM/PM designator that are not in agreement. In the .NET Framework 3.5 and earlier versions, the AM/PM designator is ignored. + The method returns if the string to be parsed contains an hour component and an AM/PM designator that are not in agreement. - Parsing Date and Time Strings in the .NET Framework + Parsing Date and Time Strings in .NET Standard Date and Time Format Strings Custom Date and Time Format Strings @@ -9852,12 +9842,12 @@ The following example illustrates the contains an invalid combination of values (for example, both and ). - In the .NET Framework 4, the method returns if the string to be parsed contains an hour component and an AM/PM designator that are not in agreement. In the .NET Framework 3.5 and earlier versions, the AM/PM designator is ignored. + The method returns if the string to be parsed contains an hour component and an AM/PM designator that are not in agreement. - Parsing Date and Time Strings in the .NET Framework + Parsing Date and Time Strings in .NET Standard Date and Time Format Strings Custom Date and Time Format Strings @@ -9940,7 +9930,7 @@ The following example illustrates the whose property returns . +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 ). diff --git a/xml/System/DateTimeOffset.xml b/xml/System/DateTimeOffset.xml index 7103e558088..e36d0c1b3e5 100644 --- a/xml/System/DateTimeOffset.xml +++ b/xml/System/DateTimeOffset.xml @@ -1077,7 +1077,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. +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. @@ -1154,7 +1154,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. +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. @@ -1279,7 +1279,7 @@ The resulting value is greater than precision of the `milliseconds` parameter is used. However, due to the inherent imprecision of floating point math, the resulting precision will vary. +The fractional part of the `milliseconds` parameter is the fractional part of a millisecond. For example, 4.5 is equivalent to 4 milliseconds and 5000 ticks, where one millisecond equals 10,000 ticks. The full precision of the `milliseconds` 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 `milliseconds` to its date and time. @@ -1346,7 +1346,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. +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. @@ -1490,7 +1490,7 @@ In .NET Framework, the `minutes` parameter is rounded to the nearest millisecond |.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. +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. @@ -4616,7 +4616,7 @@ The following example parses an array of strings that are expected to conform to The hour component and the AM/PM designator in do not agree. - In the .NET Framework 4, the method throws a if the string to be parsed contains an hour component and an AM/PM designator that are not in agreement. In the .NET Framework 3.5 and earlier versions, the AM/PM designator is ignored. + The method throws a if the string to be parsed contains an hour component and an AM/PM designator that are not in agreement. Standard Date and Time Format Strings @@ -4974,7 +4974,7 @@ Strings that do not specify a UTC offset are assumed to have the offset of the l The hour component and the AM/PM designator in do not agree. - In the .NET Framework 4, the method throws a if the string to be parsed contains an hour component and an AM/PM designator that are not in agreement. In the .NET Framework 3.5 and earlier versions, the AM/PM designator is ignored. + The method throws a if the string to be parsed contains an hour component and an AM/PM designator that are not in agreement. Standard Date and Time Format Strings @@ -5117,7 +5117,7 @@ Strings that do not specify a UTC offset are assumed to have the offset of the l The hour component and the AM/PM designator in do not agree. - In the .NET Framework 4, the method throws a if the string to be parsed contains an hour component and an AM/PM designator that are not in agreement. In the .NET Framework 3.5 and earlier versions, the AM/PM designator is ignored. + The method throws a if the string to be parsed contains an hour component and an AM/PM designator that are not in agreement. Standard Date and Time Format Strings @@ -7324,7 +7324,7 @@ Strings that do not specify a UTC offset are assumed to have the offset of the l includes mutually exclusive values. - In the .NET Framework 4, the returns if the string to be parsed contains an hour component and an AM/PM designator that are not in agreement. In the .NET Framework 3.5 and earlier versions, the AM/PM designator is ignored. + The method returns if the string to be parsed contains an hour component and an AM/PM designator that are not in agreement. @@ -7457,7 +7457,7 @@ Strings that do not specify a UTC offset are assumed to have the offset of the l includes mutually exclusive values. - In the .NET Framework 4, the returns if the string to be parsed contains an hour component and an AM/PM designator that are not in agreement. In the .NET Framework 3.5 and earlier versions, the AM/PM designator is ignored. + The method returns if the string to be parsed contains an hour component and an AM/PM designator that are not in agreement. diff --git a/xml/System/DllNotFoundException.xml b/xml/System/DllNotFoundException.xml index 0c282cd6a6f..0abb5428a84 100644 --- a/xml/System/DllNotFoundException.xml +++ b/xml/System/DllNotFoundException.xml @@ -64,7 +64,7 @@ For a list of initial property values for an instance of , see the constructors. - The is thrown when a dynamic link library defined by the attribute or a comparable language construct, such as the Visual Basic `Declare` statement, cannot be found. It is not thrown when the common language runtime is unable to load a .NET Framework assembly. + The is thrown when a dynamic link library defined by the attribute or a comparable language construct, such as the Visual Basic `Declare` statement, cannot be found. It is not thrown when the common language runtime is unable to load a .NET assembly. Note that the can specify the path to the directory in which the DLL resides. If a path is not specified, Windows uses the search order described in [Dynamic-Link Library Search Order](https://learn.microsoft.com/windows/win32/dlls/dynamic-link-library-search-order). diff --git a/xml/System/Double.xml b/xml/System/Double.xml index 87ba4a1f2b7..91a33065741 100644 --- a/xml/System/Double.xml +++ b/xml/System/Double.xml @@ -1847,7 +1847,7 @@ Euler's number is approximately 2.7182818284590452354. > [!NOTE] > Because defines the minimum expression of a positive value whose range is near zero, the margin of difference between two similar values must be greater than . Typically, it is many times greater than . - The precision of floating-point numbers beyond the documented precision is specific to the implementation and version of the .NET Framework. Consequently, a comparison of two particular numbers might change between versions of the .NET Framework because the precision of the numbers' internal representation might change. + The precision of floating-point numbers beyond the documented precision is specific to the implementation and version of .NET. Consequently, a comparison of two particular numbers might change between versions of .NET because the precision of the numbers' internal representation might change. If two values are tested for equality by calling the method, the method returns `true`. However, if two values are tested for equality by using the equality operator, the operator returns `false`. When you want to determine whether the value of a is not a number (NaN), an alternative is to call the method. @@ -4551,7 +4551,7 @@ The following code example illustrates the use of Converts the string representation of a number to its double-precision floating-point number equivalent. - In .NET Core 3.0 and later, values that are too large to represent are rounded to or as required by the IEEE 754 specification. In prior versions, including .NET Framework, parsing a value that was too large to represent resulted in failure. + Values that are too large to represent are rounded to or as required by the IEEE 754 specification. @@ -4602,17 +4602,18 @@ The following code example illustrates the use of or as required by the IEEE 754 specification. In prior versions, including .NET Framework, parsing a value that was too large to represent resulted in failure. - The `s` parameter can contain the current culture's , , or symbol. This string comparison is case-insensitive in .NET Core 3.0 and later versions, but is case-sensitive in prior versions including .NET Framework. The `s` parameter can also be a string of the form: +Values that are too large to represent are rounded to or as required by the IEEE 754 specification. + + The `s` parameter can contain the current culture's , , or symbol. This string comparison is case-insensitive. The `s` parameter can also be a string of the form: [*ws*][*sign*][*integral-digits*[*,*]]*integral-digits*[*.*[*fractional-digits*]][E[*sign*]*exponential-digits*][*ws*] Elements in square brackets ([ and ]) are optional. The following table describes each element. -|Element|Description| -|-------------|-----------------| -|*ws*|A series of white-space characters.| +| Element | Description | +|---------|-------------------------------------| +| *ws* | A series of white-space characters. | |*sign*|A negative sign symbol (-) or a positive sign symbol (+). Only a leading sign can be used.| |*integral-digits*|A series of digits ranging from 0 to 9 that specify the integral part of the number. Runs of *integral-digits* can be partitioned by a group-separator symbol. For example, in some cultures a comma (,) separates groups of thousands. The *integral-digits* element can be absent if the string contains the *fractional-digits* element.| |,|A culture-specific thousands separator symbol.| @@ -4625,15 +4626,7 @@ The following code example illustrates the use of object that is initialized for the current culture. For more information, see . To parse a string using the formatting information of some other culture, call the or method. - Ordinarily, if you pass the method a string that is created by calling the method, the original value is returned. However, on .NET Framework, the values might not be equal because of a loss of precision. In addition, attempting to parse the string representation of either or fails to round-trip. On .NET Framework, it throws an . The following example provides an illustration. - - :::code language="csharp" source="~/snippets/csharp/System/Double/Parse/parse2.cs" id="Snippet3"::: - :::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 . +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 . @@ -4650,8 +4643,6 @@ If a separator is encountered in the `s` parameter during a parse operation, and is . does not represent a number in a valid format. - - .NET Framework only: represents a number that is less than Double.MinValue or greater than Double.MaxValue. Parsing Numeric Strings in .NET @@ -4796,22 +4787,22 @@ If a separator is encountered in the `s` parameter during a parse operation, and or as required by the IEEE 754 specification. In prior versions, including .NET Framework, parsing a value that was too large to represent resulted in failure. - The `style` parameter defines the style elements (such as white space, thousands separators, and currency symbols) that are allowed in the `s` parameter for the parse operation to succeed. It must be a combination of bit flags from the enumeration. The following members are not supported: +Values that are too large to represent are rounded to or as required by the IEEE 754 specification. -- + The `style` parameter defines the style elements (such as white space, thousands separators, and currency symbols) that are allowed in the `s` parameter for the parse operation to succeed. It must be a combination of bit flags from the enumeration. The following members are not supported: -- +- +- - The `s` parameter can contain the current culture's , , or symbol. This string comparison is case-insensitive in .NET Core 3.0 and later versions, but is case-sensitive in prior versions including .NET Framework. Depending on the value of `style`, the `s` parameter can also take the form: + The `s` parameter can contain the current culture's , , or symbol. This string comparison is case-insensitive. Depending on the value of `style`, the `s` parameter can also take the form: [*ws*][*$*][*sign*][*integral-digits*[*,*]]*integral-digits*[*.*[*fractional-digits*]][E[*sign*]*exponential-digits*][*ws*] Elements in square brackets ([ and ]) are optional. The following table describes each element. -|Element|Description| -|-------------|-----------------| +| Element | Description | +|---------|-------------| |*ws*|A series of white-space characters. White space can appear at the beginning of `s` if `style` includes the flag, and it can appear at the end of `s` if `style` includes the flag.| |$|A culture-specific currency symbol. Its position in the string is defined by the and properties of the current culture. The current culture's currency symbol can appear in `s` if `style` includes the flag.| |*sign*|A negative sign symbol (-) or a positive sign symbol (+). The sign can appear at the beginning of `s` if `style` includes the flag, and it can appear at the end of `s` if `style` includes the flag. Parentheses can be used in `s` to indicate a negative value if `style` includes the flag.| @@ -4827,10 +4818,10 @@ If a separator is encountered in the `s` parameter during a parse operation, and A string with digits only (which corresponds to the style) always parses successfully if it is in the range of the type. The remaining members control elements that may be present, but are not required to be present, in the input string. The following table indicates how individual flags affect the elements that may be present in `s`. -|NumberStyles value|Elements permitted in `s` in addition to digits| -|------------------------|-----------------------------------------------------| -||The *integral-digits* element only.| -||The decimal point (*.*) and *fractional-digits* elements.| +| NumberStyles value | Elements permitted in `s` in addition to digits | +|------------------------------------------------------------|-----------------------------------------------------------| +| | The *integral-digits* element only. | +| | The decimal point (*.*) and *fractional-digits* elements. | ||The "e" or "E" character, which indicates exponential notation. This flag by itself supports values in the form *digits*E*digits*; additional flags are needed to successfully parse strings with such elements as positive or negative signs and decimal point symbols.| ||The *ws* element at the beginning of `s`.| ||The *ws* element at the end of `s`.| @@ -4846,15 +4837,13 @@ If a separator is encountered in the `s` parameter during a parse operation, and The `s` parameter is parsed using the formatting information in a object that is initialized for the current system culture. For more information, see . - Ordinarily, if you pass the method a string that is created by calling the method, the original value is returned. However, because of a loss of precision, the values might not be equal. In addition, attempting to parse the string representation of either or fails to round-trip. On .NET Framework, it throws an . On .NET Core 3.0 and later versions, it returns if you attempt to parse , or if you attempt to parse . The following example provides an illustration. + Ordinarily, if you pass the method a string that is created by calling the method, the original value is returned. However, because of a loss of precision, the values might not be equal. In addition, attempting to parse the string representation of either or fails to round-trip. It returns if you attempt to parse , or if you attempt to parse . The following example provides an illustration. :::code language="csharp" source="~/snippets/csharp/System/Double/Parse/parse2.cs" id="Snippet3"::: :::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 . +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 . @@ -4871,8 +4860,6 @@ If a separator is encountered in the `s` parameter during a parse operation, and is . does not represent a number in a valid format. - - .NET Framework only: represents a number that is less than Double.MinValue or greater than Double.MaxValue. is not a value. @@ -4946,20 +4933,21 @@ If a separator is encountered in the `s` parameter during a parse operation, and or as required by the IEEE 754 specification. In prior versions, including .NET Framework, parsing a value that was too large to represent resulted in failure. + +Values that are too large to represent are rounded to or as required by the IEEE 754 specification. This overload of the method is typically used to convert text that can be formatted in a variety of ways to a value. For example, it can be used to convert the text that is entered by a user into an HTML text box to a numeric value. - The `s` parameter is interpreted using a combination of the and flags. The `s` parameter can contain , , or symbol for the culture specified by `provider`. This string comparison is case-insensitive in .NET Core 3.0 and later versions, but is case-sensitive in prior versions including .NET Framework. The `s` parameter can also contain a string of the form: + The `s` parameter is interpreted using a combination of the and flags. The `s` parameter can contain , , or symbol for the culture specified by `provider`. This string comparison is case-insensitive. The `s` parameter can also contain a string of the form: [*ws*][*sign*]*integral-digits*[*.*[*fractional-digits*]][E[*sign*]*exponential-digits*][*ws*] Optional elements are framed in square brackets ([ and ]). Elements that contain the term "digits" consist of a series of numeric characters ranging from 0 to 9. -|Element|Description| -|-------------|-----------------| -|*ws*|A series of white-space characters.| -|*sign*|A negative sign symbol (-) or a positive sign symbol (+).| +| Element | Description | +|---------|-----------------------------------------------------------| +| *ws* | A series of white-space characters. | +| *sign* | A negative sign symbol (-) or a positive sign symbol (+). | |*integral-digits*|A series of digits ranging from 0 to 9 that specify the integral part of the number. Runs of *integral-digits* can be partitioned by a group-separator symbol. For example, in some cultures a comma (,) separates groups of thousands. The *integral-digits* element can be absent if the string contains the *fractional-digits* element.| |.|A culture-specific decimal point symbol.| |*fractional-digits*|A series of digits ranging from 0 to 9 that specify the fractional part of the number.| @@ -4970,15 +4958,13 @@ If a separator is encountered in the `s` parameter during a parse operation, and The `provider` parameter is an implementation whose method returns a object that supplies culture-specific information used in interpreting the format of `s`. Typically, it is a or object. If `provider` is `null` or a cannot be obtained, the formatting information for the current system culture is used. - Ordinarily, if you pass the method a string that is created by calling the method, the original value is returned. However, because of a loss of precision, the values might not be equal. In addition, attempting to parse the string representation of either or fails to round-trip. On .NET Framework, it throws an . On .NET Core 3.0 and later versions, it returns if you attempt to parse , or if you attempt to parse . The following example provides an illustration. + Ordinarily, if you pass the method a string that is created by calling the method, the original value is returned. However, because of a loss of precision, the values might not be equal. In addition, attempting to parse the string representation of either or fails to round-trip. It returns if you attempt to parse , or if you attempt to parse . The following example provides an illustration. :::code language="csharp" source="~/snippets/csharp/System/Double/Parse/parse2.cs" id="Snippet3"::: :::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 . +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 . @@ -4994,8 +4980,6 @@ If a separator is encountered in the `s` parameter during a parse operation, and is . does not represent a number in a valid format. - - .NET Framework only: represents a number that is less than Double.MinValue or greater than Double.MaxValue. Parsing Numeric Strings in .NET @@ -5097,7 +5081,7 @@ If a separator is encountered in the `s` parameter during a parse operation, and or as required by the IEEE 754 specification. In prior versions, including .NET Framework, parsing a value that was too large to represent resulted in failure. +Values that are too large to represent are rounded to or as required by the IEEE 754 specification. If `s` is out of range of the data type, the method returns if `s` is less than and if `s` is greater than . @@ -5177,22 +5161,22 @@ If `s` is out of range of the data type, the method returns or as required by the IEEE 754 specification. In prior versions, including .NET Framework, parsing a value that was too large to represent resulted in failure. - The `style` parameter defines the style elements (such as white space, thousands separators, and currency symbols) that are allowed in the `s` parameter for the parse operation to succeed. It must be a combination of bit flags from the enumeration. The following members are not supported: +Values that are too large to represent are rounded to or as required by the IEEE 754 specification. -- + The `style` parameter defines the style elements (such as white space, thousands separators, and currency symbols) that are allowed in the `s` parameter for the parse operation to succeed. It must be a combination of bit flags from the enumeration. The following members are not supported: -- +- +- - The `s` parameter can contain , , or symbol for the culture specified by `provider`. This string comparison is case-insensitive in .NET Core 3.0 and later versions, but is case-sensitive in prior versions including .NET Framework. Depending on the value of `style`, the `s` parameter can also take the form: + The `s` parameter can contain , , or symbol for the culture specified by `provider`. This string comparison is case-insensitive. Depending on the value of `style`, the `s` parameter can also take the form: [*ws*] [*$*] [*sign*][*integral-digits*,]*integral-digits*[.[*fractional-digits*]][E[*sign*]*exponential-digits*][*ws*] Elements framed in square brackets ([ and ]) are optional. The following table describes each element. -|Element|Description| -|-------------|-----------------| +| Element | Description | +|---------|-------------| |*ws*|A series of white-space characters. White space can appear at the beginning of `s` if `style` includes the flag, and it can appear at the end of `s` if `style` includes the flag.| |$|A culture-specific currency symbol. Its position in the string is defined by the and properties of the current culture. The current culture's currency symbol can appear in `s` if `style` includes the flag.| |*sign*|A negative sign symbol (-) or a positive sign symbol (+). The sign can appear at the beginning of `s` if `style` includes the flag, and it can appear at the end of `s` if `style` includes the flag. Parentheses can be used in `s` to indicate a negative value if `style` includes the flag.| @@ -5208,9 +5192,9 @@ If `s` is out of range of the data type, the method returns A string with digits only (which corresponds to the style) always parses successfully if it is in the range of the type. The remaining members control elements that may be present, but are not required to be present, in the input string. The following table indicates how individual flags affect the elements that may be present in `s`. -|NumberStyles value|Elements permitted in `s` in addition to digits| -|------------------------|-----------------------------------------------------| -||The *integral-digits* element only.| +| NumberStyles value | Elements permitted in `s` in addition to digits | +|-----------------------------------------------|-------------------------------------------------| +| | The *integral-digits* element only. | ||The decimal point (*.*) and *fractional-digits* elements.| ||The "e" or "E" character, which indicates exponential notation. This flag by itself supports values in the form *digits*E*digits*; additional flags are needed to successfully parse strings with such elements as positive or negative signs and decimal point symbols.| ||The *ws* element at the beginning of `s`.| @@ -5227,15 +5211,13 @@ If `s` is out of range of the data type, the method returns The `provider` parameter is an implementation whose method returns a object that supplies culture-specific information used in interpreting the format of `s`. Typically, it is a or object. If `provider` is `null` or a cannot be obtained, the formatting information for the current system culture is used. - Ordinarily, if you pass the method a string that is created by calling the method, the original value is returned. However, because of a loss of precision, the values might not be equal. In addition, attempting to parse the string representation of either or fails to round-trip. On .NET Framework, it throws an . On .NET Core 3.0 and later versions, it returns if you attempt to parse , or if you attempt to parse . The following example provides an illustration. + Ordinarily, if you pass the method a string that is created by calling the method, the original value is returned. However, because of a loss of precision, the values might not be equal. In addition, attempting to parse the string representation of either or fails to round-trip. It returns if you attempt to parse , or if you attempt to parse . The following example provides an illustration. :::code language="csharp" source="~/snippets/csharp/System/Double/Parse/parse2.cs" id="Snippet3"::: :::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 . +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 . @@ -5258,8 +5240,6 @@ If a separator is encountered in the `s` parameter during a parse operation, and -or- is the value. - - .NET Framework only: represents a number that is less than Double.MinValue or greater than Double.MaxValue. Parsing Numeric Strings in .NET @@ -9480,7 +9460,7 @@ Tau is approximately 6.2831853071795864769. Converts the string representation of a number to its double-precision floating-point number equivalent. A return value indicates whether the conversion succeeded or failed. - In .NET Core 3.0 and later, values that are too large to represent are rounded to or as required by the IEEE 754 specification. In prior versions, including .NET Framework, parsing a value that was too large to represent resulted in failure. + Values that are too large to represent are rounded to or as required by the IEEE 754 specification. @@ -9555,7 +9535,7 @@ Tau is approximately 6.2831853071795864769. Converts the span representation of a number in a specified style and culture-specific format to its double-precision floating-point number equivalent. A return value indicates whether the conversion succeeded or failed. if was converted successfully; otherwise, . - In .NET Core 3.0 and later, values that are too large to represent are rounded to or as required by the IEEE 754 specification. In prior versions, including .NET Framework, parsing a value that was too large to represent resulted in failure. + Values that are too large to represent are rounded to or as required by the IEEE 754 specification. @@ -9608,7 +9588,7 @@ Tau is approximately 6.2831853071795864769. A string containing a number to convert. - When this method returns, contains the double-precision floating-point number equivalent of the parameter, if the conversion succeeded, or zero if the conversion failed. The conversion fails if the parameter is or or is not a number in a valid format. It also fails on .NET Framework if represents a number less than Double.MinValue or greater than Double.MaxValue. This parameter is passed uninitialized; any value originally supplied in will be overwritten. + When this method returns, contains the double-precision floating-point number equivalent of the parameter, if the conversion succeeded, or zero if the conversion failed. The conversion fails if the parameter is or or is not a number in a valid format. This parameter is passed uninitialized; any value originally supplied in will be overwritten. Converts the string representation of a number to its double-precision floating-point number equivalent. A return value indicates whether the conversion succeeded or failed. if was converted successfully; otherwise, . @@ -9616,20 +9596,20 @@ Tau is approximately 6.2831853071795864769. or as required by the IEEE 754 specification. In prior versions, including .NET Framework, parsing a value that was too large to represent resulted in failure. + Values that are too large to represent are rounded to or as required by the IEEE 754 specification. This overload differs from the method by returning a Boolean value that indicates whether the parse operation succeeded instead of returning the parsed numeric value. It eliminates the need to use exception handling to test for a in the event that `s` is invalid and cannot be successfully parsed. - The `s` parameter can contain the current culture's , , or symbol. This string comparison is case-insensitive in .NET Core 3.0 and later versions, but is case-sensitive in prior versions including .NET Framework. The `s` parameter can also be a string of the form: + The `s` parameter can contain the current culture's , , or symbol. This string comparison is case-insensitive. The `s` parameter can also be a string of the form: [ws][sign][integral-digits,]integral-digits[.[fractional-digits]][e[sign]exponential-digits][ws] Elements in square brackets are optional. The following table describes each element. -|Element|Description| -|-------------|-----------------| -|*ws*|A series of white-space characters.| -|*sign*|A negative sign or positive sign symbol.| +| Element | Description | +|---------|------------------------------------------| +| *ws* | A series of white-space characters. | +| *sign* | A negative sign or positive sign symbol. | |*integral-digits*|A series of numeric characters ranging from 0 to 9 that specify the integral part of the number. Integral-digits can be absent if there are fractional-digits.| |*,*|A culture-specific group separator symbol.| |*.*|A culture-specific decimal point symbol.| @@ -9643,15 +9623,13 @@ Tau is approximately 6.2831853071795864769. The `s` parameter is parsed using the formatting information in a object that is initialized for the current system culture. For more information, see . To parse a string using the formatting information of some other specified culture, use the method overload. - Ordinarily, if you pass the method a string that is created by calling the method, the original value is returned. However, because of a loss of precision, the values might not be equal. In addition, attempting to parse the string representation of either or fails to round-trip. On .NET Framework, it throws an . On .NET Core 3.0 and later versions, it returns if you attempt to parse , or if you attempt to parse . The following example provides an illustration. + Ordinarily, if you pass the method a string that is created by calling the method, the original value is returned. However, because of a loss of precision, the values might not be equal. In addition, attempting to parse the string representation of either or fails to round-trip.It returns if you attempt to parse , or if you attempt to parse . The following example provides an illustration. :::code language="csharp" source="~/snippets/csharp/System/Double/TryParse/tryparse2.cs" id="Snippet3"::: :::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 . +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 . @@ -9901,7 +9879,7 @@ If a separator is encountered in the `s` parameter during a parse operation, and Converts a character span containing the string representation of a number in a specified style and culture-specific format to its double-precision floating-point number equivalent. A return value indicates whether the conversion succeeded or failed. if was converted successfully; otherwise, . - In .NET Core 3.0 and later, values that are too large to represent are rounded to or as required by the IEEE 754 specification. In prior versions, including .NET Framework, parsing a value that was too large to represent resulted in failure. + Values that are too large to represent are rounded to or as required by the IEEE 754 specification. @@ -9960,7 +9938,7 @@ If a separator is encountered in the `s` parameter during a parse operation, and A string containing a number to convert. A bitwise combination of values that indicates the permitted format of . A typical value to specify is combined with . An that supplies culture-specific formatting information about . - When this method returns, contains a double-precision floating-point number equivalent of the numeric value or symbol contained in , if the conversion succeeded, or zero if the conversion failed. The conversion fails if the parameter is or or is not in a format compliant with , or if is not a valid combination of enumeration constants. It also fails on .NET Framework if represents a number less than SByte.MinValue or greater than SByte.MaxValue. This parameter is passed uninitialized; any value originally supplied in will be overwritten. + When this method returns, contains a double-precision floating-point number equivalent of the numeric value or symbol contained in , if the conversion succeeded, or zero if the conversion failed. The conversion fails if the parameter is or or is not in a format compliant with , or if is not a valid combination of enumeration constants. This parameter is passed uninitialized; any value originally supplied in will be overwritten. Converts the string representation of a number in a specified style and culture-specific format to its double-precision floating-point number equivalent. A return value indicates whether the conversion succeeded or failed. if was converted successfully; otherwise, . @@ -9968,17 +9946,17 @@ If a separator is encountered in the `s` parameter during a parse operation, and or as required by the IEEE 754 specification. In prior versions, including .NET Framework, parsing a value that was too large to represent resulted in failure. + Values that are too large to represent are rounded to or as required by the IEEE 754 specification. The method is like the method, except this method does not throw an exception if the conversion fails. If the conversion succeeds, the return value is `true` and the `result` parameter is set to the outcome of the conversion. If the conversion fails, the return value is `false` and the `result` parameter is set to zero. This eliminates the need to use exception handling to test for a in the event that `s` is invalid and cannot be successfully parsed. The `style` parameter defines the allowable format of the `s` parameter for the parse operation to succeed. It must be a combination of bit flags from the enumeration. The following members are not supported: -- +- -- +- - The `s` parameter can contain , , or symbol for the culture indicated by `provider`. This string comparison is case-insensitive in .NET Core 3.0 and later versions, but is case-sensitive in prior versions including .NET Framework. In addition, depending on the value of `style`, the `s` parameter may include the following elements: + The `s` parameter can contain , , or symbol for the culture indicated by `provider`. This string comparison is case-insensitive. In addition, depending on the value of `style`, the `s` parameter may include the following elements: [ws] [$] [sign][integral-digits,]integral-digits[.fractional-digits][e[sign]exponential-digits][ws] @@ -10022,15 +10000,13 @@ If a separator is encountered in the `s` parameter during a parse operation, and The conversion fails if the `s` parameter is `null` or not a numeric value, the `provider` parameter does not yield a object, or the `style` parameter is not a combination of bit flags from the enumeration. - Ordinarily, if you pass the method a string that is created by calling the method, the original value is returned. However, because of a loss of precision, the values might not be equal. In addition, attempting to parse the string representation of either or fails to round-trip. On .NET Framework, it throws an . On .NET Core 3.0 and later versions, it returns if you attempt to parse , or if you attempt to parse . The following example provides an illustration. + Ordinarily, if you pass the method a string that is created by calling the method, the original value is returned. However, because of a loss of precision, the values might not be equal. In addition, attempting to parse the string representation of either or fails to round-trip. It returns if you attempt to parse , or if you attempt to parse . The following example provides an illustration. :::code language="csharp" source="~/snippets/csharp/System/Double/TryParse/tryparse2.cs" id="Snippet3"::: :::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 . +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 83cf3a42143..b6e2e87cd0c 100644 --- a/xml/System/Environment.xml +++ b/xml/System/Environment.xml @@ -364,16 +364,11 @@ Calling the method differs from using your programming language's `return` statement in the following ways: -- always terminates an application. Using the `return` statement may terminate an application only if it is used in the application entry point, such as in the `Main` method. - -- terminates an application immediately, even if other threads are running. If the `return` statement is called in the application entry point, it causes an application to terminate only after all foreground threads have terminated. - -- requires the caller to have permission to call unmanaged code. The `return` statement does not. - +- always terminates an application. Using the `return` statement may terminate an application only if it is used in the application entry point, such as in the `Main` method. +- terminates an application immediately, even if other threads are running. If the `return` statement is called in the application entry point, it causes an application to terminate only after all foreground threads have terminated. +- requires the caller to have permission to call unmanaged code. The `return` statement does not. - If is called from a `try` or `catch` block, the code in any `finally` block does not execute. If the `return` statement is used, the code in the `finally` block does execute. -- If is called when code in a [constrained execution region](/dotnet/framework/performance/constrained-execution-regions) (CER) is running, the CER will not complete execution. If the `return` statement is used, the CER completes execution. - ]]> The caller does not have sufficient security permission to perform this function. @@ -433,7 +428,7 @@ Use a non-zero number to indicate an error. In your application, you can define your own error codes in an enumeration, and return the appropriate error code based on the scenario. For example, return a value of 1 to indicate that the required file is not present and a value of 2 to indicate that the file is in the wrong format. For a list of exit codes used by the Windows operating system, see [System Error Codes](/windows/win32/debug/system-error-codes) in the Windows documentation. ## Examples - The following is a simple app named Double.exe that doubles an integer value passed to it as a command-line argument. The value assigns error codes to the property to indicate error conditions. Note that you must add a reference to the System.Numerics.dll assembly to successfully compile the example. + The following is a simple app named Double.exe that doubles an integer value passed to it as a command-line argument. The value assigns error codes to the property to indicate error conditions. :::code language="csharp" source="~/snippets/csharp/System/Environment/ExitCode/double.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Environment/ExitCode/double.fs" id="Snippet1"::: @@ -1427,11 +1422,10 @@ 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. +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. +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. ]]> @@ -1667,7 +1661,7 @@ The following example creates environment variables for the is a constant customized specifically for the current platform and implementation of the .NET Framework. For more information about the escape characters in the property value, see [Character Escapes](/dotnet/standard/base-types/character-escapes-in-regular-expressions). + The property value of is a constant customized specifically for the current platform and implementation of .NET. For more information about the escape characters in the property value, see [Character Escapes](/dotnet/standard/base-types/character-escapes-in-regular-expressions). The functionality provided by is often what is meant by the terms newline, line feed, line break, carriage return, CRLF, and end of line. @@ -2441,7 +2435,7 @@ The elapsed time excludes any non-awake time, such as time spent in sleep mode, This value updates at the same frequency as the underlying interrupt timer for the system. > [!NOTE] -> On Windows, in .NET 10 and earlier versions, including .NET Framework, the elapsed time **includes** non-awake time. In addition, the value updates at a fixed cadence of 10-16ms (typically 15.5ms). +> On Windows, in .NET 10 and earlier versions, the elapsed time **includes** non-awake time. In addition, the value updates at a fixed cadence of 10-16ms (typically 15.5ms). ]]> @@ -2678,14 +2672,8 @@ This value updates at the same frequency as the underlying interrupt timer for t 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). +The property returns the .NET runtime version number. ## Examples The following example displays the version of the common language runtime. diff --git a/xml/System/Exception.xml b/xml/System/Exception.xml index 7498f3e1710..61b910aa357 100644 --- a/xml/System/Exception.xml +++ b/xml/System/Exception.xml @@ -603,7 +603,7 @@ The following example demonstrates how to add and retrieve information using the method exists to support the .NET Framework infrastructure, and internally invokes the fundamental method, . + The method exists to support the .NET infrastructure, and internally invokes the fundamental method, . ]]> @@ -719,11 +719,7 @@ The following example demonstrates how to add and retrieve information using the property's setter is protected, whereas its getter is public. In previous versions of the .NET Framework, both getter and setter are protected. - - + 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 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. ## Examples The following code example defines a derived `Exception` class that sets the `HResult` property to a custom value in its constructor. @@ -1133,11 +1129,6 @@ The following code example throws and then catches an ex ## Remarks If the method that throws this exception is not available and the stack trace is not a null reference (`Nothing` in Visual Basic), obtains the method from the stack trace. If the stack trace is a null reference, also returns a null reference. -> [!NOTE] -> The property may not accurately report the name of the method in which an exception was thrown if the exception handler handles an exception across application domain boundaries. - - - ## Examples The following code example throws an `Exception` and then catches it and displays the originating method using the `TargetSite` property. diff --git a/xml/System/FormatException.xml b/xml/System/FormatException.xml index c086295ec48..938345a8e64 100644 --- a/xml/System/FormatException.xml +++ b/xml/System/FormatException.xml @@ -69,103 +69,103 @@ - In a call to a method that converts a string to some other data type, the string doesn't conform to the required pattern. This typically occurs when calling some methods of the class and the `Parse` and `ParseExact` methods of some types. - In most cases, particularly if the string that you're converting is input by a user or read from a file, you should use a `try/catch` (`try/with` in F#) block and handle the exception if the conversion is unsuccessful. You can also replace the call to the conversion method with a call to a `TryParse` or `TryParseExact` method, if one exists. However, a exception that is thrown when you're trying to parse a predefined or hard-coded string indicates a program error. In this case, you should correct the error rather than handle the exception. + In most cases, particularly if the string that you're converting is input by a user or read from a file, you should use a `try/catch` (`try/with` in F#) block and handle the exception if the conversion is unsuccessful. You can also replace the call to the conversion method with a call to a `TryParse` or `TryParseExact` method, if one exists. However, a exception that is thrown when you're trying to parse a predefined or hard-coded string indicates a program error. In this case, you should correct the error rather than handle the exception. - The conversion of a string to the following types in the namespace can throw a exception: + The conversion of a string to the following types in the namespace can throw a exception: - - . The and methods require the string to be converted to be "True", "true", "False", or "false". Any other value throws a exception. + - . The and methods require the string to be converted to be "True", "true", "False", or "false". Any other value throws a exception. - - and . All date and time data is interpreted based on the formatting conventions of a particular culture: either the current culture (or, in some cases, the current application domain culture), the invariant culture, or a specified culture. When you call the and methods, date and time data must also conform *exactly* to a pattern specified by one or more [standard format strings](/dotnet/standard/base-types/standard-date-and-time-format-strings) or [custom format strings](/dotnet/standard/base-types/custom-date-and-time-format-strings) that are provided as arguments in the method call. If it doesn't conform to an expected culture-specific pattern, a exception is thrown. This means that date and time data saved in a culture-specific format on one system might not parse successfully on another system. + - and . All date and time data is interpreted based on the formatting conventions of a particular culture: either the current culture, the invariant culture, or a specified culture. When you call the and methods, date and time data must also conform *exactly* to a pattern specified by one or more [standard format strings](/dotnet/standard/base-types/standard-date-and-time-format-strings) or [custom format strings](/dotnet/standard/base-types/custom-date-and-time-format-strings) that are provided as arguments in the method call. If it doesn't conform to an expected culture-specific pattern, a exception is thrown. This means that date and time data saved in a culture-specific format on one system might not parse successfully on another system. - For more information about parsing dates and times, see [Parsing Date and Time Strings](/dotnet/standard/base-types/parsing-datetime) and the documentation for the method that threw the exception. + For more information about parsing dates and times, see [Parsing Date and Time Strings](/dotnet/standard/base-types/parsing-datetime) and the documentation for the method that threw the exception. - - **GUIDs.** The string representation of a GUID must consist of 32 hexadecimal digits (0-F), and must be in one of the five formats output by the method. For more information, see the method. + - **GUIDs.** The string representation of a GUID must consist of 32 hexadecimal digits (0-F), and must be in one of the five formats output by the method. For more information, see the method. - - **Numeric types, including all signed integers, unsigned integers, and floating-point types.** The string to be parsed must consist of the Latin digits 0-9. A positive or negative sign, decimal separator, group separators, and currency symbol may also be permitted. Trying to parse a string that contains any other character always throws a exception. + - **Numeric types, including all signed integers, unsigned integers, and floating-point types.** The string to be parsed must consist of the Latin digits 0-9. A positive or negative sign, decimal separator, group separators, and currency symbol may also be permitted. Trying to parse a string that contains any other character always throws a exception. - All numeric strings are interpreted based on the formatting conventions of a particular culture: either the current culture, the invariant culture, or a specified culture. As a result, a numeric string that is parsed by using the conventions of one culture might fail when using the conventions of another. + All numeric strings are interpreted based on the formatting conventions of a particular culture: either the current culture, the invariant culture, or a specified culture. As a result, a numeric string that is parsed by using the conventions of one culture might fail when using the conventions of another. - For more information about parsing numeric strings, see [Parsing Numeric Strings](/dotnet/standard/base-types/parsing-numeric) and the documentation for the specific method that threw the exception. + For more information about parsing numeric strings, see [Parsing Numeric Strings](/dotnet/standard/base-types/parsing-numeric) and the documentation for the specific method that threw the exception. - - **Time intervals.** The string to be parsed must be either in fixed culture-insensitive format or in a culture-sensitive format defined by the current culture, the invariant culture, or a specified culture. If the string isn't in an appropriate format, or if, at the minimum, the days, hours, and minutes components of the time interval aren't present, the parsing method throws a exception. For more information, see the documentation for the parsing method that threw the exception. + - **Time intervals.** The string to be parsed must be either in fixed culture-insensitive format or in a culture-sensitive format defined by the current culture, the invariant culture, or a specified culture. If the string isn't in an appropriate format, or if, at the minimum, the days, hours, and minutes components of the time interval aren't present, the parsing method throws a exception. For more information, see the documentation for the parsing method that threw the exception. - A type implements the interface, which supports format strings that define how an object is converted to its string representation, and an invalid format string is used. This is most common in a formatting operation. In the following example, the "Q" standard format string is used in a composite format string to format a number. However, "Q" is not a valid [standard format string](/dotnet/standard/base-types/standard-numeric-format-strings). - :::code language="csharp" source="~/snippets/csharp/System/FormatException/Overview/iformattable1.cs" id="Snippet7"::: - :::code language="fsharp" source="~/snippets/fsharp/System/FormatException/Overview/iformattable1.fs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/System/FormatException/Overview/iformattable1.vb" id="Snippet7"::: + :::code language="csharp" source="~/snippets/csharp/System/FormatException/Overview/iformattable1.cs" id="Snippet7"::: + :::code language="fsharp" source="~/snippets/fsharp/System/FormatException/Overview/iformattable1.fs" id="Snippet7"::: + :::code language="vb" source="~/snippets/visualbasic/System/FormatException/Overview/iformattable1.vb" id="Snippet7"::: - This exception results from a coding error. To correct the error, either remove the format string or substitute a valid one. The following example corrects the error by replacing the invalid format string with the "C" (currency) format string. + This exception results from a coding error. To correct the error, either remove the format string or substitute a valid one. The following example corrects the error by replacing the invalid format string with the "C" (currency) format string. - :::code language="csharp" source="~/snippets/csharp/System/FormatException/Overview/iformattable2.cs" id="Snippet8"::: - :::code language="fsharp" source="~/snippets/fsharp/System/FormatException/Overview/iformattable2.fs" id="Snippet8"::: - :::code language="vb" source="~/snippets/visualbasic/System/FormatException/Overview/iformattable2.vb" id="Snippet8"::: + :::code language="csharp" source="~/snippets/csharp/System/FormatException/Overview/iformattable2.cs" id="Snippet8"::: + :::code language="fsharp" source="~/snippets/fsharp/System/FormatException/Overview/iformattable2.fs" id="Snippet8"::: + :::code language="vb" source="~/snippets/visualbasic/System/FormatException/Overview/iformattable2.vb" id="Snippet8"::: - A exception can also be thrown by parsing methods, such as and , that require the string to be parsed to conform exactly to the pattern specified by a format string. In the following example, the string representation of a GUID is expected to conform to the pattern specified by the "G" standard format string. However, the structure's implementation of does not support the "G" format string. + A exception can also be thrown by parsing methods, such as and , that require the string to be parsed to conform exactly to the pattern specified by a format string. In the following example, the string representation of a GUID is expected to conform to the pattern specified by the "G" standard format string. However, the structure's implementation of does not support the "G" format string. - :::code language="csharp" source="~/snippets/csharp/System/FormatException/Overview/iformattable3.cs" id="Snippet9"::: - :::code language="fsharp" source="~/snippets/fsharp/System/FormatException/Overview/iformattable3.fs" id="Snippet9"::: - :::code language="vb" source="~/snippets/visualbasic/System/FormatException/Overview/iformattable3.vb" id="Snippet9"::: + :::code language="csharp" source="~/snippets/csharp/System/FormatException/Overview/iformattable3.cs" id="Snippet9"::: + :::code language="fsharp" source="~/snippets/fsharp/System/FormatException/Overview/iformattable3.fs" id="Snippet9"::: + :::code language="vb" source="~/snippets/visualbasic/System/FormatException/Overview/iformattable3.vb" id="Snippet9"::: - This exception also results from a coding error. To correct it, call a parsing method that doesn't require a precise format, such as or , or substitute a valid format string. The following example corrects the error by calling the method. + This exception also results from a coding error. To correct it, call a parsing method that doesn't require a precise format, such as or , or substitute a valid format string. The following example corrects the error by calling the method. - :::code language="csharp" source="~/snippets/csharp/System/FormatException/Overview/iformattable4.cs" id="Snippet10"::: - :::code language="fsharp" source="~/snippets/fsharp/System/FormatException/Overview/iformattable4.fs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/System/FormatException/Overview/iformattable4.vb" id="Snippet10"::: + :::code language="csharp" source="~/snippets/csharp/System/FormatException/Overview/iformattable4.cs" id="Snippet10"::: + :::code language="fsharp" source="~/snippets/fsharp/System/FormatException/Overview/iformattable4.fs" id="Snippet10"::: + :::code language="vb" source="~/snippets/visualbasic/System/FormatException/Overview/iformattable4.vb" id="Snippet10"::: - One or more of the indexes of the format items in a [composite format string](/dotnet/standard/base-types/composite-formatting) is greater than the indexes of the items in the object list or parameter array. In the following example, the largest index of a format item in the format string is 3. Because the indexes of items in the object list are zero-based, this format string would require the object list to have four items. Instead, it has only three, `dat`, `temp`, and `scale`, so the code results in a exception at run time:. - :::code language="csharp" source="~/snippets/csharp/System/FormatException/Overview/example1.cs" id="Snippet1"::: - :::code language="fsharp" source="~/snippets/fsharp/System/FormatException/Overview/example1.fs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System/FormatException/Overview/example1.vb" id="Snippet1"::: + :::code language="csharp" source="~/snippets/csharp/System/FormatException/Overview/example1.cs" id="Snippet1"::: + :::code language="fsharp" source="~/snippets/fsharp/System/FormatException/Overview/example1.fs" id="Snippet1"::: + :::code language="vb" source="~/snippets/visualbasic/System/FormatException/Overview/example1.vb" id="Snippet1"::: - In this case, the exception is a result of developer error. It should be corrected rather than handled in a `try/catch` block by making sure that each item in the object list corresponds to the index of a format item. To correct this example, change the index of the second format item to refer to the `dat` variable, and decrement the index of each subsequent format item by one. + In this case, the exception is a result of developer error. It should be corrected rather than handled in a `try/catch` block by making sure that each item in the object list corresponds to the index of a format item. To correct this example, change the index of the second format item to refer to the `dat` variable, and decrement the index of each subsequent format item by one. - :::code language="csharp" source="~/snippets/csharp/System/FormatException/Overview/example2.cs" id="Snippet2"::: - :::code language="fsharp" source="~/snippets/fsharp/System/FormatException/Overview/example2.fs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System/FormatException/Overview/example2.vb" id="Snippet2"::: + :::code language="csharp" source="~/snippets/csharp/System/FormatException/Overview/example2.cs" id="Snippet2"::: + :::code language="fsharp" source="~/snippets/fsharp/System/FormatException/Overview/example2.fs" id="Snippet2"::: + :::code language="vb" source="~/snippets/visualbasic/System/FormatException/Overview/example2.vb" id="Snippet2"::: - The composite format string isn't well-formed. When this happens, the exception is always a result of developer error. It should be corrected rather than handled in a `try/catch` block. - Trying to include literal braces in a string, as the following example does, will throw the exception. + Trying to include literal braces in a string, as the following example does, will throw the exception. - :::code language="csharp" source="~/snippets/csharp/System/FormatException/Overview/qa3.cs" id="Snippet23"::: - :::code language="fsharp" source="~/snippets/fsharp/System/FormatException/Overview/qa3.fs" id="Snippet23"::: - :::code language="vb" source="~/snippets/visualbasic/System/FormatException/Overview/qa3.vb" id="Snippet23"::: + :::code language="csharp" source="~/snippets/csharp/System/FormatException/Overview/qa3.cs" id="Snippet23"::: + :::code language="fsharp" source="~/snippets/fsharp/System/FormatException/Overview/qa3.fs" id="Snippet23"::: + :::code language="vb" source="~/snippets/visualbasic/System/FormatException/Overview/qa3.vb" id="Snippet23"::: - The recommended technique for including literal braces in a composite format string is to include them in the object list and use format items to insert them into the result string. For example, you can modify the previous composite format string as shown here. + The recommended technique for including literal braces in a composite format string is to include them in the object list and use format items to insert them into the result string. For example, you can modify the previous composite format string as shown here. - :::code language="csharp" source="~/snippets/csharp/System/FormatException/Overview/qa3.cs" id="Snippet24"::: - :::code language="fsharp" source="~/snippets/fsharp/System/FormatException/Overview/qa3.fs" id="Snippet24"::: - :::code language="vb" source="~/snippets/visualbasic/System/FormatException/Overview/qa3.vb" id="Snippet24"::: + :::code language="csharp" source="~/snippets/csharp/System/FormatException/Overview/qa3.cs" id="Snippet24"::: + :::code language="fsharp" source="~/snippets/fsharp/System/FormatException/Overview/qa3.fs" id="Snippet24"::: + :::code language="vb" source="~/snippets/visualbasic/System/FormatException/Overview/qa3.vb" id="Snippet24"::: - The exception is also thrown if your format string contains a typo. The following call to the method omits a closing brace and pairs an opening brace with a closing bracket. + The exception is also thrown if your format string contains a typo. The following call to the method omits a closing brace and pairs an opening brace with a closing bracket. - :::code language="csharp" source="~/snippets/csharp/System/FormatException/Overview/example3.cs" id="Snippet3"::: - :::code language="fsharp" source="~/snippets/fsharp/System/FormatException/Overview/example3.fs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/System/FormatException/Overview/example3.vb" id="Snippet3"::: + :::code language="csharp" source="~/snippets/csharp/System/FormatException/Overview/example3.cs" id="Snippet3"::: + :::code language="fsharp" source="~/snippets/fsharp/System/FormatException/Overview/example3.fs" id="Snippet3"::: + :::code language="vb" source="~/snippets/visualbasic/System/FormatException/Overview/example3.vb" id="Snippet3"::: - To correct the error, ensure that all opening and closing braces correspond. + To correct the error, ensure that all opening and closing braces correspond. - :::code language="csharp" source="~/snippets/csharp/System/FormatException/Overview/example3.cs" id="Snippet4"::: - :::code language="fsharp" source="~/snippets/fsharp/System/FormatException/Overview/example3.fs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/System/FormatException/Overview/example3.vb" id="Snippet4"::: + :::code language="csharp" source="~/snippets/csharp/System/FormatException/Overview/example3.cs" id="Snippet4"::: + :::code language="fsharp" source="~/snippets/fsharp/System/FormatException/Overview/example3.fs" id="Snippet4"::: + :::code language="vb" source="~/snippets/visualbasic/System/FormatException/Overview/example3.vb" id="Snippet4"::: -- You've supplied the object list in a composite formatting method as a strongly typed parameter array, and the exception indicates that the index of one or more format items exceeds the number of arguments in the object list. This occurs because no explicit conversion between array types exists, so instead the compiler treats the array as a single argument rather than as a parameter array. For example, the following call to the method throws a exception, although the highest index of the format items is 3, and the parameter array of type has four elements. +- You've supplied the object list in a composite formatting method as a strongly typed parameter array, and the exception indicates that the index of one or more format items exceeds the number of arguments in the object list. This occurs because no explicit conversion between array types exists, so instead the compiler treats the array as a single argument rather than as a parameter array. For example, the following call to the method throws a exception, although the highest index of the format items is 3, and the parameter array of type has four elements. - :::code language="csharp" source="~/snippets/csharp/System/FormatException/Overview/qa1.cs" id="Snippet5"::: - :::code language="fsharp" source="~/snippets/fsharp/System/FormatException/Overview/qa1.fs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/System/FormatException/Overview/qa1.vb" id="Snippet5"::: + :::code language="csharp" source="~/snippets/csharp/System/FormatException/Overview/qa1.cs" id="Snippet5"::: + :::code language="fsharp" source="~/snippets/fsharp/System/FormatException/Overview/qa1.fs" id="Snippet5"::: + :::code language="vb" source="~/snippets/visualbasic/System/FormatException/Overview/qa1.vb" id="Snippet5"::: - Instead of handling this exception, you should eliminate its cause. Because neither Visual Basic nor C# can convert an integer array to an object array, you have to perform the conversion yourself before calling the composite formatting method. The following example provides one implementation. + Instead of handling this exception, you should eliminate its cause. Because neither Visual Basic nor C# can convert an integer array to an object array, you have to perform the conversion yourself before calling the composite formatting method. The following example provides one implementation. - :::code language="csharp" source="~/snippets/csharp/System/FormatException/Overview/qa2.cs" id="Snippet6"::: - :::code language="fsharp" source="~/snippets/fsharp/System/FormatException/Overview/qa2.fs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/System/FormatException/Overview/qa2.vb" id="Snippet6"::: + :::code language="csharp" source="~/snippets/csharp/System/FormatException/Overview/qa2.cs" id="Snippet6"::: + :::code language="fsharp" source="~/snippets/fsharp/System/FormatException/Overview/qa2.fs" id="Snippet6"::: + :::code language="vb" source="~/snippets/visualbasic/System/FormatException/Overview/qa2.vb" id="Snippet6"::: - uses the HRESULT COR_E_FORMAT, which has the value 0x80131537. + uses the HRESULT COR_E_FORMAT, which has the value 0x80131537. - The class derives from and adds no unique members. For a list of initial property values for an instance of , see the constructors. +The class derives from and adds no unique members. For a list of initial property values for an instance of , see the constructors. ]]> diff --git a/xml/System/GC.xml b/xml/System/GC.xml index be92fa55753..7cb4debcad1 100644 --- a/xml/System/GC.xml +++ b/xml/System/GC.xml @@ -300,10 +300,8 @@ Skipping zero-initialization using this API only has a material performance bene ## Remarks This method cancels a garbage collection notification that was registered by using the method. You do not have to call this method before adjusting threshold parameter values in subsequent calls to the method. - - ## Examples - The following example cancels a garbage collection registration. This example is part of a larger example provided for the [Garbage Collection Notifications](/dotnet/standard/garbage-collection/notifications) topic. + The following example cancels a garbage collection registration. This example is part of a larger example provided for the [Garbage Collection Notifications](/dotnet/standard/garbage-collection/notifications) article. :::code language="csharp" source="~/snippets/csharp/System/GC/CancelFullGCNotification/Program.cs" id="Snippet7"::: :::code language="fsharp" source="~/snippets/fsharp/System/GC/CancelFullGCNotification/Program.fs" id="Snippet7"::: @@ -311,7 +309,7 @@ Skipping zero-initialization using this API only has a material performance bene ]]> - This member is not available when concurrent garbage collection is enabled. See the <gcConcurrent> runtime setting for information about how to disable concurrent garbage collection. + Concurrent garbage collection is enabled. Garbage Collection Notifications @@ -376,14 +374,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/GenericUriParser.xml b/xml/System/GenericUriParser.xml index 363b21fd28c..4dadfeb6be7 100644 --- a/xml/System/GenericUriParser.xml +++ b/xml/System/GenericUriParser.xml @@ -114,11 +114,11 @@ The type indicates the parser supports Internationalized Domain Name (IDN) parsing (IDN) of host names. Whether IDN is used is dictated by configuration values. - The configuration setting for the is indirectly controlled by the configuration setting that controls IRI processing in the class. IRI processing must be enabled for IDN processing to be possible. If IRI processing is disabled, then IDN processing will be set to the default setting where the .NET Framework 2.0 behavior is used for compatibility and IDN names are not used. + The configuration setting for the is indirectly controlled by the configuration setting that controls IRI processing in the class. IRI processing must be enabled for IDN processing to be possible. If IRI processing is disabled, then IDN processing will be set to the default setting where IDN names are not used. The Internationalized Domain Name (IDN) attribute only controls IDN processing. All other IRI processing (character normalization, for example) is performed by default. - For more information on IRI and IDN support, see the Remarks section for the class. + For more information on IRI and IDN support, see the Remarks section for the class. ]]> diff --git a/xml/System/GenericUriParserOptions.xml b/xml/System/GenericUriParserOptions.xml index 80c71a74fa8..eefb555c628 100644 --- a/xml/System/GenericUriParserOptions.xml +++ b/xml/System/GenericUriParserOptions.xml @@ -55,13 +55,13 @@ ## Remarks You can combine any of these options to configure a generic URI parser by passing the options as a parameter to the constructor. - The existing class has been extended to provide support for International Resource Identifiers (IRI) based on RFC 3987. Users upgrading from .NET Framework 2.0 won't see any behavior change unless they specifically enable IRI. This ensures application compatibility with prior versions of the .NET Framework. + The class provides support for International Resource Identifiers (IRI) based on RFC 3987. - The configuration setting for the is indirectly controlled by the configuration setting that controls IRI processing in the class. IRI processing must be enabled for IDN processing to be possible. If IRI processing is disabled, then IDN processing will be set to the default setting where the .NET Framework 2.0 behavior is used for compatibility and IDN names are not used. + The configuration setting for the is indirectly controlled by the configuration setting that controls IRI processing in the class. IRI processing must be enabled for IDN processing to be possible. If IRI processing is disabled, then IDN processing will be set to the default setting where IDN names are not used. The Internationalized Domain Name (IDN) attribute only controls IDN processing. All other IRI processing (character normalization, for example) is performed by default. - For more information on IRI support, see the Remarks section for the class. + For more information on IRI support, see the Remarks section for the class. ]]> diff --git a/xml/System/IAsyncResult.xml b/xml/System/IAsyncResult.xml index ece63a92bd5..33cd5a1769a 100644 --- a/xml/System/IAsyncResult.xml +++ b/xml/System/IAsyncResult.xml @@ -280,7 +280,7 @@ ]]> - Most implementers of the interface will not use this property and should return . Beginning with the .NET Framework 4.5, a task that is created with the method will not complete if this property is not implemented correctly. See Application Compatibility in 4.5. + Most implementers of the interface will not use this property and should return . A task that is created with the method will not complete if this property is not implemented correctly. See Application Compatibility in 4.5. Use this property to determine if the asynchronous operation completed synchronously. For example, this property can return for an asynchronous I/O operation if the I/O request was small. diff --git a/xml/System/IConvertible.xml b/xml/System/IConvertible.xml index e63390cabc0..d4e8f5b3224 100644 --- a/xml/System/IConvertible.xml +++ b/xml/System/IConvertible.xml @@ -77,7 +77,7 @@ Most conversion methods have a parameter of type that represents either the current culture () or a specific culture. For the most part, the implementations of the base types ignore this parameter. However, you can choose whether to use it in your code. - Type Conversion in the .NET Framework + Type Conversion in .NET diff --git a/xml/System/ICustomFormatter.xml b/xml/System/ICustomFormatter.xml index bf6af681383..434c809d6d6 100644 --- a/xml/System/ICustomFormatter.xml +++ b/xml/System/ICustomFormatter.xml @@ -53,15 +53,13 @@ ## Remarks The interface includes a single method, . When this interface is implemented by a reference or value type, the method returns a custom-formatted string representation of an object's value. - Typically, the interface is implemented with the interface to customize the behavior of two .NET Framework composite string formatting methods that include an parameter. Specifically, the interface can provide custom formatting of the value of an object passed to the and methods. + Typically, the interface is implemented with the interface to customize the behavior of two .NET composite string formatting methods that include an parameter. Specifically, the interface can provide custom formatting of the value of an object passed to the and methods. Providing a custom representation of an object's value requires that you do the following: -1. Define a class that implements the interface and its single member, the method. - -2. Define a class that implements the interface and its single member, the method. The method returns an instance of your implementation. Often, a single class implements both and . In that case, the class's `GetFormat` implementation just returns an instance of itself. - -3. Pass the implementation as the `provider` argument of the method or a comparable method. +1. Define a class that implements the interface and its single member, the method. +2. Define a class that implements the interface and its single member, the method. The method returns an instance of your implementation. Often, a single class implements both and . In that case, the class's `GetFormat` implementation just returns an instance of itself. +3. Pass the implementation as the `provider` argument of the method or a comparable method. The .NET library method will then use your custom formatting instead of its own. @@ -182,14 +180,12 @@ The `formatProvider` parameter is the implementation that provides formatting for `arg`. Typically, it is an instance of your implementation. If `formatProvider` is `null`, ignore that parameter. - Your implementation of the method must include the following functionality so the .NET Framework can provide formatting you do not support. If your format method does not support a format, determine whether the object being formatted implements the interface. If it does, invoke the method of that interface. Otherwise, invoke the default method of the underlying object. The following code illustrates this pattern. + Your implementation of the method must include the following functionality so .NET can provide formatting you do not support. If your format method does not support a format, determine whether the object being formatted implements the interface. If it does, invoke the method of that interface. Otherwise, invoke the default method of the underlying object. The following code illustrates this pattern. :::code language="csharp" source="~/snippets/csharp/System/ICustomFormatter/Overview/myformatter.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System/ICustomFormatter/Overview/myformatter.fs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System/ICustomFormatter/Overview/myformatter.vb" id="Snippet3"::: - - ## Examples The following example implements to allow binary, octal, and hexadecimal formatting of integral values. Its implementation determines whether the format parameter is one of the three supported format strings ("B" for binary, "O" for octal, and "H" for hexadecimal) and formats the `arg` parameter appropriately. Otherwise, if `arg` is not `null`, it calls the `arg` parameter's implementation, if one exists, or its parameterless `ToString` method, if one does not. If `arg` is `null`, the method returns . diff --git a/xml/System/IFormatProvider.xml b/xml/System/IFormatProvider.xml index 6a9c7ab3fe5..30c7de77c0c 100644 --- a/xml/System/IFormatProvider.xml +++ b/xml/System/IFormatProvider.xml @@ -57,7 +57,7 @@ implementations are often used implicitly by formatting and parsing methods. For example, the method implicitly uses an implementation that represents the system's current culture. implementations can also be specified explicitly by methods that have a parameter of type , such as and . - The .NET Framework includes the following three predefined implementations to provide culture-specific information that is used in formatting or parsing numeric and date and time values: +.NET includes the following three predefined implementations to provide culture-specific information that is used in formatting or parsing numeric and date and time values: - The class, which provides information that is used to format numbers, such as the currency, thousands separator, and decimal separator symbols for a particular culture. For information about the predefined format strings recognized by a object and used in numeric formatting operations, see [Standard Numeric Format Strings](/dotnet/standard/base-types/standard-numeric-format-strings) and [Custom Numeric Format Strings](/dotnet/standard/base-types/custom-numeric-format-strings). @@ -65,9 +65,7 @@ - The class, which represents a particular culture. Its method returns a culture-specific or object, depending on whether the object is used in a formatting or parsing operation that involves numbers or dates and times. - The .NET Framework also supports custom formatting. This typically involves the creation of a formatting class that implements both and . An instance of this class is then passed as a parameter to a method that performs a custom formatting operation, such as The example provides an illustration of such a custom implementation that formats a number as a 12-digit account number. - - +.NET also supports custom formatting. This typically involves the creation of a formatting class that implements both and . An instance of this class is then passed as a parameter to a method that performs a custom formatting operation, such as The example provides an illustration of such a custom implementation that formats a number as a 12-digit account number. ## Examples The following example illustrates how an implementation can change the representation of a date and time value. In this case, a single date is displayed by using objects that represent four different cultures. diff --git a/xml/System/IFormattable.xml b/xml/System/IFormattable.xml index 0b5b050465e..220fa61654e 100644 --- a/xml/System/IFormattable.xml +++ b/xml/System/IFormattable.xml @@ -53,34 +53,27 @@ ## Remarks The interface converts an object to its string representation based on a format string and a format provider. - A format string typically defines the general appearance of an object. For example, the .NET Framework supports the following: + A format string typically defines the general appearance of an object. For example, .NET supports the following: - Standard format strings for formatting enumeration values (see [Enumeration Format Strings](/dotnet/standard/base-types/enumeration-format-strings)). - - Standard and custom format strings for formatting numeric values (see [Standard Numeric Format Strings](/dotnet/standard/base-types/standard-numeric-format-strings) and [Custom Numeric Format Strings](/dotnet/standard/base-types/custom-numeric-format-strings)). - - Standard and custom format strings for formatting date and time values (see [Standard Date and Time Format Strings](/dotnet/standard/base-types/standard-date-and-time-format-strings) and [Custom Date and Time Format Strings](/dotnet/standard/base-types/custom-date-and-time-format-strings)). - - Standard and custom format strings for formatting time intervals (see [Standard TimeSpan Format Strings](/dotnet/standard/base-types/standard-timespan-format-strings) and [Custom TimeSpan Format Strings](/dotnet/standard/base-types/custom-timespan-format-strings)). You can also define your own format strings to support formatting of your application-defined types. - A format provider returns a formatting object that typically defines the symbols used in converting an object to its string representation. For example, when you convert a number to a currency value, a format provider defines the currency symbol that appears in the result string. The .NET Framework defines three format providers: + A format provider returns a formatting object that typically defines the symbols used in converting an object to its string representation. For example, when you convert a number to a currency value, a format provider defines the currency symbol that appears in the result string. .NET defines three format providers: - The class, which returns either a object for formatting numeric values, or a object for formatting date and time values. - - The class, which returns an instance of itself for formatting numeric values. - - The class, which returns an instance of itself for formatting date and time values. In addition, you can define your own custom format providers to supply culture-specific, profession-specific, or industry-specific information used in formatting. For more information about implementing custom formatting by using a custom format provider, see . - The interface defines a single method, , that supplies formatting services for the implementing type. The method can be called directly. In addition, it is called automatically by the and methods, and by methods that use the [composite formatting feature](/dotnet/standard/base-types/composite-formatting) in the .NET Framework. Such methods include , , and , among others. The method is called for each format item in the method's format string. + The interface defines a single method, , that supplies formatting services for the implementing type. The method can be called directly. In addition, it is called automatically by the and methods, and by methods that use the [composite formatting feature](/dotnet/standard/base-types/composite-formatting) in .NET. Such methods include , , and , among others. The method is called for each format item in the method's format string. The interface is implemented by the base data types. - - ## Examples The following example defines a `Temperature` class that implements the interface. The class supports four format specifiers: "G" and "C", which indicate that the temperature is to be displayed in Celsius; "F", which indicates that the temperature is to be displayed in Fahrenheit; and "K", which indicates that the temperature is to be displayed in Kelvin. In addition, the implementation also can handle a format string that is `null` or empty. The other two `ToString` methods defined by the `Temperature` class simply wrap a call to the implementation. @@ -172,33 +165,26 @@ method converts a value to a string representation that can be expressed in multiple ways. Its precise format depends on specific symbols or a specified order defined by specific cultures, professions, or industries. You can call the method directly. It is also called automatically by the and methods, and by methods that use the composite formatting feature in the .NET Framework, such as , , and . (For more information, see [Composite Formatting](/dotnet/standard/base-types/composite-formatting).) + The method converts a value to a string representation that can be expressed in multiple ways. Its precise format depends on specific symbols or a specified order defined by specific cultures, professions, or industries. You can call the method directly. It is also called automatically by the and methods, and by methods that use the composite formatting feature in .NET, such as , , and . (For more information, see [Composite Formatting](/dotnet/standard/base-types/composite-formatting).) Composite formatting methods call the method once for each format item in a format string. The parameters passed to the method depend on the specific formatting method that is called and on the content of the format item, as follows: - If the format item does not include a format string (for example, if the format item is simply `{0}`), it is passed `null` as the value of the parameter. - - If the format item includes a format string (for example, `{0:G}`), that format string is passed as the value of the parameter. - - If the original method call does not include an parameter, is passed as the value of the parameter. - - If the original method call includes an parameter, the provider that is supplied in the method call is passed as the value of the parameter. > [!NOTE] > An object's implementation is called by composite formatting methods only if they are not passed an format provider, or if the method of the custom format provider returns `null`. - The .NET Framework includes three format providers, all of which implement the interface: - -- supplies numeric formatting information, such as the characters to use for decimal and group separators, and the spelling and placement of currency symbols in monetary values. + The .NET includes three format providers, all of which implement the interface: -- supplies date-related and time-related formatting information, such as the position of the month, the day, and the year in a date pattern. - -- contains the default formatting information in a specific culture, including the numeric format information, and date-related and time-related formatting information. +- supplies numeric formatting information, such as the characters to use for decimal and group separators, and the spelling and placement of currency symbols in monetary values. +- supplies date-related and time-related formatting information, such as the position of the month, the day, and the year in a date pattern. +- contains the default formatting information in a specific culture, including the numeric format information, and date-related and time-related formatting information. In addition, you can define your own custom format provider. - - ## Examples The following example demonstrates a `Temperature` class that implements the method. This code example is part of a larger example provided for the class. diff --git a/xml/System/IntPtr.xml b/xml/System/IntPtr.xml index 5721ec108df..13084a44d0c 100644 --- a/xml/System/IntPtr.xml +++ b/xml/System/IntPtr.xml @@ -262,7 +262,7 @@ > [!NOTE] > Using as a pointer or a handle is error prone and unsafe. It is simply an integer type that can be used as an interchange format for pointers and handles due to being the same size. Outside of specific interchange requirements, such as for passing data to a language that doesn't support pointers, a correctly typed pointer should be used to represent pointers and should be used to represent handles. - This type implements the . In .NET 5 and later versions, this type also implements the interfaces. In .NET 7 and later versions, this type also implements the , , and interfaces. + This type implements the and interfaces. In .NET 7 and later versions, this type also implements the , , and interfaces. In C# starting from version 9.0, you can use the built-in `nint` type to define native-sized integers. This type is represented by the type internally and provides operations and conversions that are appropriate for integer types. For more information, see [nint and nuint types](/dotnet/csharp/language-reference/builtin-types/integral-numeric-types). diff --git a/xml/System/InvalidCastException.xml b/xml/System/InvalidCastException.xml index 8b6e7787d13..5afcd9fd6ea 100644 --- a/xml/System/InvalidCastException.xml +++ b/xml/System/InvalidCastException.xml @@ -64,7 +64,7 @@ For more information about this API, see Supplemental API remarks for InvalidCastException. Handling and Throwing Exceptions - Type Conversion in the .NET Framework + Type Conversion in .NET diff --git a/xml/System/LoaderOptimization.xml b/xml/System/LoaderOptimization.xml index bac207a3543..0abcdb92147 100644 --- a/xml/System/LoaderOptimization.xml +++ b/xml/System/LoaderOptimization.xml @@ -54,19 +54,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 e431bb14e05..33b7050b27a 100644 --- a/xml/System/LoaderOptimizationAttribute.xml +++ b/xml/System/LoaderOptimizationAttribute.xml @@ -71,9 +71,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/LocalDataStoreSlot.xml b/xml/System/LocalDataStoreSlot.xml index 3e012fa04c6..1db24f5591c 100644 --- a/xml/System/LocalDataStoreSlot.xml +++ b/xml/System/LocalDataStoreSlot.xml @@ -49,15 +49,15 @@ attribute. They provide better performance than data slots, and enable compile-time type checking. +.NET provides two mechanisms for using thread local storage (TLS): thread-relative static fields, and data slots. +- Thread-relative static fields are `static` fields (`Shared` fields in Visual Basic) that are marked with the attribute. They provide better performance than data slots, and enable compile-time type checking. - Data slots are slower and more awkward to use than thread-relative static fields. Also, data is stored as type , so you must cast it to the correct type before using it. However, you can use data slots when you have insufficient information at compile time to allocate static fields. For more information about using TLS, see [Thread Local Storage: Thread-Relative Static Fields and Data Slots](/dotnet/standard/threading/thread-local-storage-thread-relative-static-fields-and-data-slots). - Similarly, the .NET Framework provides two mechanisms for using context local storage: context-relative static fields and data slots. Context-relative static fields are static fields that are marked with the attribute. The trade-offs between using these two mechanisms are similar to the tradeoffs between using thread-relative static fields and data slots. + Similarly, .NET provides two mechanisms for using context local storage: context-relative static fields and data slots. Context-relative static fields are static fields that are marked with the attribute. The trade-offs between using these two mechanisms are similar to the tradeoffs between using thread-relative static fields and data slots. The structure serves as a local store memory mechanism that threads and contexts can use to store thread-specific and context-specific data, respectively. The common language runtime allocates a multi-slot data store array to each process when it is created. The thread or context calls various functions to allocate a data slot in the data store, to store and retrieve a data value in the slot, and to free a data slot for reuse after the thread or context object expires. diff --git a/xml/System/MarshalByRefObject.xml b/xml/System/MarshalByRefObject.xml index 43e0aca858f..99304dcaca1 100644 --- a/xml/System/MarshalByRefObject.xml +++ b/xml/System/MarshalByRefObject.xml @@ -65,32 +65,6 @@ When you derive an object from for use across application domain boundaries, you should not override any of its members, nor should you call its methods directly. The runtime recognizes that classes derived from should be marshaled across app domain boundaries. - - -## Examples - This section contains two code examples. The first code example shows how to create an instance of a class in another application domain. The second code example shows a simple class that can be used for remoting. - - **Example 1** - - The following code example shows the simplest way to execute code in another application domain. The example defines a class named `Worker` that inherits , with a method that displays the name of the application domain in which it is executing. The example creates instances of `Worker` in the default application domain and in a new application domain. - -> [!NOTE] -> The assembly that contains `Worker` must be loaded into both application domains, but it could load other assemblies that would exist only in the new application domain. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CreateInstanceAndUnwrap2/cpp/source.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System/AppDomain/CreateInstanceAndUnwrap/source.cs" id="Snippet1"::: - :::code language="fsharp" source="~/snippets/fsharp/System/AppDomain/CreateInstanceAndUnwrap/source.fs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System/AppDomain/CreateInstanceAndUnwrap/source.vb" id="Snippet1"::: - - **Example 2** - - The following example demonstrates a class derived from that is used later in remoting. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/RemotingServices.SetObjectUriForMarshal/CPP/source.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System/MarshalByRefObject/Overview/source.cs" id="Snippet1"::: - :::code language="fsharp" source="~/snippets/fsharp/System/MarshalByRefObject/Overview/source.fs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System/MarshalByRefObject/Overview/source.vb" id="Snippet1"::: - ]]> @@ -186,12 +160,9 @@ This method is marked obsolete starting in .NET 5. -For more information about lifetime services, see the class. - ]]> - The immediate caller does not have infrastructure permission. - .NET Core and .NET 5+ only: In all cases. + In all cases. @@ -247,20 +218,9 @@ For more information about lifetime services, see the class. - -## Examples - The following code example demonstrates creating a lease. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_Classic/classic MarshalByRefObject.InitializeLifetimeService Example/CPP/source.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System/MarshalByRefObject/InitializeLifetimeService/source.cs" id="Snippet1"::: - :::code language="fsharp" source="~/snippets/fsharp/System/MarshalByRefObject/InitializeLifetimeService/source.fs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System/MarshalByRefObject/InitializeLifetimeService/source.vb" id="Snippet1"::: - ]]> - The immediate caller does not have infrastructure permission. - .NET Core and .NET 5+ only: In all cases. + In all cases. diff --git a/xml/System/Math.xml b/xml/System/Math.xml index b5fb36078d7..38ae1629db5 100644 --- a/xml/System/Math.xml +++ b/xml/System/Math.xml @@ -6141,7 +6141,7 @@ The method supports two rounding conventions for handl Midpoint values are rounded to the nearest even number. For example, both 3.75 and 3.85 round to 3.8, and both -3.75 and -3.85 round to -3.8. This form of rounding is represented by the enumeration member. > [!NOTE] -> In .NET Core 3.0 and later versions, three additional rounding strategies are available through the enumeration. These strategies are used in all cases, not just for midpoint values as and are. +> Three additional rounding strategies are available through the enumeration. These strategies are used in all cases, not just for midpoint values as and are. Rounding away from zero is the most widely known form of rounding, while rounding to nearest even is the standard in financial and statistical operations. It conforms to IEEE Standard 754, section 4. When used in multiple rounding operations, rounding to nearest even reduces the rounding error that is caused by consistently rounding midpoint values in a single direction. In some cases, this rounding error can be significant. diff --git a/xml/System/MethodAccessException.xml b/xml/System/MethodAccessException.xml index cfffa1db032..bd3db2505e7 100644 --- a/xml/System/MethodAccessException.xml +++ b/xml/System/MethodAccessException.xml @@ -52,7 +52,7 @@ - The exception that is thrown when there is an invalid attempt to access a method, such as accessing a private method from partially trusted code. + The exception that is thrown when there is an invalid attempt to access a method. [!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/NonSerializedAttribute.xml b/xml/System/NonSerializedAttribute.xml index ddece3f08fc..0b51a7dffa3 100644 --- a/xml/System/NonSerializedAttribute.xml +++ b/xml/System/NonSerializedAttribute.xml @@ -71,40 +71,7 @@ Indicates that a field of a serializable class should not be serialized. This class cannot be inherited. - - or classes to serialize an object, use the attribute to prevent a field from being serialized. For example, you can use this attribute to prevent the serialization of sensitive data. - - The target objects for the attribute are public and private fields of a serializable class. By default, classes are not serializable unless they are marked with . During the serialization process all the public and private fields of a class are serialized by default. Fields marked with are excluded during serialization. If you are using the class to serialize an object, use the class to get the same functionality. Alternatively, implement the interface to explicitly control the serialization process. Note that classes that implement must still be marked with . - - To apply the class to an event, set the attribute location to field, as shown in the following C# code. - -```csharp -[field:NonSerializedAttribute()] -public event ChangedEventHandler Changed; -``` - - If a field is not serialized, but it still requires a default value that must be supplied after deserialization, you can create a method that supplies the field with a value, then apply the to the method. - - For more information about using attributes, see [Attributes](/dotnet/standard/attributes/). - -> [!NOTE] -> This attribute does not apply to JSON serialization using . - -## Examples - The following example demonstrates SOAP serialization of an object marked with the attribute, and the behavior of a field marked with the in the serialized object. - -> [!NOTE] -> The code uses the class to serialize the object. The class is found in the system.runtime.serialization.formatters.soap.dll file, which is not loaded by default into a project. To run the code, you must add a reference to the DLL to your project. - - :::code language="csharp" source="~/snippets/csharp/System/NonSerializedAttribute/Overview/s.cs" id="Snippet1"::: - :::code language="fsharp" source="~/snippets/fsharp/System/NonSerializedAttribute/Overview/s.fs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System/NonSerializedAttribute/Overview/s.vb" id="Snippet1"::: - - ]]> - + To be added. diff --git a/xml/System/OperatingSystem.xml b/xml/System/OperatingSystem.xml index 0c8caeb5bc1..62dc9c9e063 100644 --- a/xml/System/OperatingSystem.xml +++ b/xml/System/OperatingSystem.xml @@ -1376,12 +1376,10 @@ For a list of Windows operating system versions and their corresponding version is the same as the value returned by the method. However, an implementation of the .NET Framework for a different platform might return a more appropriate string for that platform. + By default, the value returned by is the same as the value returned by the method. However, an implementation of .NET for a different platform might return a more appropriate string for that platform. For a list of Windows operating system versions and their corresponding version numbers, see [Operating System Version](/windows/win32/sysinfo/operating-system-version). - - ## Examples The following code example demonstrates the property. diff --git a/xml/System/OutOfMemoryException.xml b/xml/System/OutOfMemoryException.xml index ca3b5f18770..bdae1b80fc3 100644 --- a/xml/System/OutOfMemoryException.xml +++ b/xml/System/OutOfMemoryException.xml @@ -98,7 +98,6 @@ You are attempting to increase the length of a You can do either of the following to address the error: - Replace the call to the constructor with a call any other constructor overload. The maximum capacity of your object will be set to its default value, which is . - - Call the constructor with a `maxCapacity` value that is large enough to accommodate any expansions to the object. **Your app runs as a 32-bit process.** @@ -115,7 +114,7 @@ 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. +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.** @@ -124,9 +123,7 @@ When data structures or data sets that reside in memory become so large that the To prevent the exceptions, you must modify your application so that less data is resident in memory, or the data is divided into segments that require smaller memory allocations. For example: - If you are retrieving all of the data from a database and then filtering it in your app to minimize trips to the server, you should modify your queries to return only the subset of data that your app needs. When working with large tables, multiple queries are almost always more efficient than retrieving all of the data in a single table and then manipulating it. - - If you are executing queries that users create dynamically, you should ensure that the number of records returned by the query is limited. - - If you are using large arrays or other collection objects whose size results in an exception, you should modify your application to work the data in subsets rather than to work with it all at once. The following example gets a array that consists of 200 million floating-point values and then calculates their mean. The output from the example shows that, because the example stores the entire array in memory before it calculates the mean, an is thrown. diff --git a/xml/System/PlatformID.xml b/xml/System/PlatformID.xml index 3a9504b46c1..cc4ec3f1c72 100644 --- a/xml/System/PlatformID.xml +++ b/xml/System/PlatformID.xml @@ -119,7 +119,7 @@ 6 - The operating system is Macintosh. This value was returned by Silverlight. On .NET Core, its replacement is `Unix`. + The operating system is Macintosh. This value was returned by Silverlight. Its replacement is `Unix`. diff --git a/xml/System/Progress`1.xml b/xml/System/Progress`1.xml index 203b2af0b3b..bb670289ed7 100644 --- a/xml/System/Progress`1.xml +++ b/xml/System/Progress`1.xml @@ -83,7 +83,7 @@ ## Remarks Any handler provided to the constructor or event handlers registered with the event are invoked through a instance captured when the instance is constructed. If there is no current at the time of construction, the callbacks will be invoked on the . - For more information and a code example, see the article [Async in 4.5: Enabling Progress and Cancellation in Async APIs](https://devblogs.microsoft.com/dotnet/async-in-4-5-enabling-progress-and-cancellation-in-async-apis/) in the .NET Framework blog. + For more information and a code example, see the blog post [Async in 4.5: Enabling Progress and Cancellation in Async APIs](https://devblogs.microsoft.com/dotnet/async-in-4-5-enabling-progress-and-cancellation-in-async-apis/). ]]> diff --git a/xml/System/Random.xml b/xml/System/Random.xml index 8bc6522d412..908f60e7a63 100644 --- a/xml/System/Random.xml +++ b/xml/System/Random.xml @@ -88,7 +88,7 @@ The following example generates a random integer that it uses as an index to ret ]]> - In .NET Framework 2.0 and later, the behavior of the , , and methods have changed so that these methods do not necessarily call the derived class implementation of the method. As a result, classes derived from that target .NET Framework 2.0 and later should also override these three methods. + The , , and methods don't necessarily call the derived class implementation of the method. As a result, classes derived from should also override these three methods. The implementation of the random number generator in the class isn't guaranteed to remain the same across major versions of .NET. As a result, you shouldn't assume that the same seed will result in the same pseudo-random sequence in different versions of .NET. @@ -152,14 +152,15 @@ 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 .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. +The default seed value is produced by the thread-static, pseudo-random number generator, so different objects created in close succession produce different sets of 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. +<<<<<<< HEAD +======= ## Examples @@ -169,6 +170,7 @@ The following example uses the parameterless constructor to instantiate three >>>>>> a616b87eb03a89aa522fa6635e20af8ab7093d32 ]]> @@ -224,15 +226,7 @@ The following example uses the parameterless constructor to instantiate three objects causes each instance to produce identical sequences of random numbers. This is often done when testing apps that rely on random number generators. - If your application requires different random number sequences, invoke this constructor repeatedly with different seed values. One way to produce a unique seed value is to make it time-dependent. For example, derive the seed value from the system clock, as the overload does. However, the system clock might not have sufficient resolution to provide different invocations of this constructor with a different seed value. On the .NET Framework, this results in random number generators that generate identical sequences of pseudo-random numbers, as illustrated by the first two objects in the following example. To prevent this, apply an algorithm to differentiate the seed value in each invocation, or call the method to ensure that you provide each constructor with a different seed value. - - :::code language="csharp" source="~/snippets/csharp/System/Random/.ctor/ctor4.cs" id="Snippet4"::: - :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Random.Ctor/FS/ctor4.fs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/System/Random/.ctor/ctor4.vb" id="Snippet4"::: - - Another option is to instantiate a single object that you use to generate all the random numbers in your application. This yields slightly better performance, since instantiating a random number generator is fairly expensive. - - + If your application requires different random number sequences, invoke this constructor repeatedly with different seed values. One way to produce a unique seed value is to make it time-dependent. For example, derive the seed value from the system clock, as the overload does. Another option is to instantiate a single object that you use to generate all the random numbers in your application. This yields slightly better performance, since instantiating a random number generator is fairly expensive. ## Examples The following example creates objects with the class constructor that takes a seed parameter and generates a sequence of random integers and doubles. The example illustrates that the same sequence is generated when the object is created again with the constructor and seed parameter. @@ -770,7 +764,7 @@ The following example uses the parameterless constructor to instantiate three is greater than . - Starting with the .NET Framework version 2.0, if you derive a class from and override the method, the distribution provided by the derived class implementation of the method is not used in calls to the base class implementation of the method overload if the difference between the and parameters is greater than Int32.MaxValue. Instead, the uniform distribution returned by the base class is used. This behavior improves the overall performance of the class. To modify this behavior to call the method in the derived class, you must also override the method overload. + If you derive a class from and override the method, the distribution provided by the derived class implementation of the method is not used in calls to the base class implementation of the method overload if the difference between the and parameters is greater than Int32.MaxValue. Instead, the uniform distribution returned by the base class is used. This behavior improves the overall performance of the class. To modify this behavior to call the method in the derived class, you must also override the method overload. @@ -845,7 +839,7 @@ The following example uses the parameterless constructor to instantiate three is . - Starting with the .NET Framework version 2.0, if you derive a class from and override the method, the distribution provided by the derived class implementation of the method is not used in calls to the base class implementation of the method. Instead, the uniform distribution returned by the base class is used. This behavior improves the overall performance of the class. To modify this behavior to call the method in the derived class, you must also override the method. + If you derive a class from and override the method, the distribution provided by the derived class implementation of the method is not used in calls to the base class implementation of the method. Instead, the uniform distribution returned by the base class is used. This behavior improves the overall performance of the class. To modify this behavior to call the method in the derived class, you must also override the method. @@ -1172,8 +1166,6 @@ Each element of the span of bytes is set to a random number greater than or equa > [!IMPORTANT] > The method is `protected`, which means that it is accessible only within the class and its derived classes. To generate a random number between 0 and 1 from a instance, call the method. - - ## Examples The following example derives a class from and overrides the method to generate a distribution of random numbers. This distribution is different than the uniform distribution generated by the method of the base class. @@ -1184,12 +1176,10 @@ Each element of the span of bytes is set to a random number greater than or equa ]]> - Starting with the .NET Framework version 2.0, if you derive a class from and override the method, the distribution provided by the derived class implementation of the method is not used in calls to the base class implementation of the following methods: + If you derive a class from and override the method, the distribution provided by the derived class implementation of the method is not used in calls to the base class implementation of the following methods: - The method. - - The method. - - The method, if ( - ) is greater than Int32.MaxValue. Instead, the uniform distribution provided by the base class is used. This behavior improves the overall performance of the class. To modify this behavior to call the implementation of the method in the derived class, you must also override the behavior of these three members. The example provides an illustration. diff --git a/xml/System/ResolveEventArgs.xml b/xml/System/ResolveEventArgs.xml index 8cabaac4b34..f60db5b248d 100644 --- a/xml/System/ResolveEventArgs.xml +++ b/xml/System/ResolveEventArgs.xml @@ -58,8 +58,7 @@ When the loader cannot resolve an assembly reference and a handler has been provided for the appropriate loader resolution event, the event is raised and the contains information about the item to be resolved. - The property contains the name of the item to be resolved. - -- Beginning with the .NET Framework 4, the property contains the assembly that requested an assembly that can provide the named item. For more information, see the property. +- The property contains the assembly that requested an assembly that can provide the named item. For more information, see the property. ]]> diff --git a/xml/System/ResolveEventHandler.xml b/xml/System/ResolveEventHandler.xml index 7039637724c..65613c25bad 100644 --- a/xml/System/ResolveEventHandler.xml +++ b/xml/System/ResolveEventHandler.xml @@ -79,7 +79,7 @@ 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. > [!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. +> 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 6454a966220..32205d73c38 100644 --- a/xml/System/STAThreadAttribute.xml +++ b/xml/System/STAThreadAttribute.xml @@ -63,13 +63,13 @@ 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. diff --git a/xml/System/Single.xml b/xml/System/Single.xml index 0222ccd9335..ca37ec02219 100644 --- a/xml/System/Single.xml +++ b/xml/System/Single.xml @@ -1792,9 +1792,7 @@ This is known as Euler's number and is approximately 2.7182818284590452354. > [!NOTE] > Because defines the minimum expression of a positive value whose range is near zero, the margin of difference must be greater than . Typically, it is many times greater than . - The precision of floating-point numbers beyond the documented precision is specific to the implementation and version of the .NET Framework. Consequently, a comparison of two particular numbers might change between versions of the .NET Framework because the precision of the numbers' internal representation might change. - - + The precision of floating-point numbers beyond the documented precision is specific to the implementation and version of .NET. Consequently, a comparison of two particular numbers might change between versions of .NET because the precision of the numbers' internal representation might change. ## Examples The following code example demonstrates the method. @@ -4561,7 +4559,7 @@ For this method matches the IEEE 754:201 Converts the string representation of a number to its single-precision floating-point number equivalent. - In .NET Core 3.0 and later, values that are too large to represent are rounded to or as required by the IEEE 754 specification. In prior versions, including .NET Framework, parsing a value that was too large to represent resulted in failure. + Values that are too large to represent are rounded to or as required by the IEEE 754 specification. @@ -4612,17 +4610,17 @@ For this method matches the IEEE 754:201 or as required by the IEEE 754 specification. In prior versions, including .NET Framework, parsing a value that was too large to represent resulted in failure. + Values that are too large to represent are rounded to or as required by the IEEE 754 specification. - The `s` parameter can contain the current culture's , , or symbol. This string comparison is case-insensitive in .NET Core 3.0 and later versions, but is case-sensitive in prior versions including .NET Framework. The `s` parameter can also be a string of the form: + The `s` parameter can contain the current culture's , , or symbol. This string comparison is case-insensitive. The `s` parameter can also be a string of the form: [*ws*][*sign*] [*integral-digits*[*,*]]*integral-digits*[*.*[*fractional-digits*]][e[*sign*]*exponential-digits*][*ws*] Elements in square brackets ([ and ]) are optional. The following table describes each element. -|Element|Description| -|-------------|-----------------| -|*ws*|A series of white space characters.| +| Element | Description | +|---------|-------------------------------------| +| *ws* | A series of white space characters. | |*sign*|A negative sign symbol or a positive sign symbol. Valid sign characters are determined by the and properties of the current culture. Only a leading sign can be used.| |*integral-digits*|A series of digits ranging from 0 to 9 that specify the integral part of the number. Runs of *integral-digits* can be partitioned by a group-separator symbol. For example, in some cultures a comma (,) separates groups of thousands. The *integral-digits* element can be absent if the string contains the *fractional-digits* element.| |*,*|A culture-specific thousands separator symbol.| @@ -4637,7 +4635,7 @@ For this method matches the IEEE 754:201 Ordinarily, if you pass the method a string that is created by calling the method, the original value is returned. However, because of a loss of precision, the values may not be equal. -If `s` is out of range of the data type, the method throws an on .NET Framework. On .NET Core 3.0 and later versions, it returns if `s` is less than and if `s` is greater than . +If `s` is out of range of the data type, the method returns if `s` is less than and if `s` is greater than . 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 . @@ -4654,8 +4652,6 @@ If a separator is encountered in the `s` parameter during a parse operation, and is . does not represent a number in a valid format. - - .NET Framework only: represents a number less than Single.MinValue or greater than Single.MaxValue. Parsing Numeric Strings in .NET @@ -4799,7 +4795,7 @@ If a separator is encountered in the `s` parameter during a parse operation, and or as required by the IEEE 754 specification. In prior versions, including .NET Framework, parsing a value that was too large to represent resulted in failure. + Values that are too large to represent are rounded to or as required by the IEEE 754 specification. The `style` parameter defines the style elements (such as white space, thousands separators, and currency symbols) that are allowed in the `s` parameter for the parse operation to succeed. It must be a combination of bit flags from the enumeration. The following members are not supported: @@ -4807,7 +4803,7 @@ If a separator is encountered in the `s` parameter during a parse operation, and - - The `s` parameter can contain the current culture's , , or symbol. This string comparison is case-insensitive in .NET Core 3.0 and later versions, but is case-sensitive in prior versions including .NET Framework. Depending on the value of `style`, the `s` parameter can also take the form: + The `s` parameter can contain the current culture's , , or symbol. This string comparison is case-insensitive. Depending on the value of `style`, the `s` parameter can also take the form: [*ws*][*$*][*sign*][*integral-digits*[*,*]]*integral-digits*[*.*[*fractional-digits*]][E[*sign*]*exponential-digits*][*ws*] @@ -4868,7 +4864,7 @@ If a separator is encountered in the `s` parameter during a parse operation, and Ordinarily, if you pass the method a string that is created by calling the method, the original value is returned. However, because of a loss of precision, the values may not be equal. -If `s` is out of range of the data type, the method throws an on .NET Framework. On .NET Core 3.0 and later versions, it returns if `s` is less than and if `s` is greater than . +If `s` is out of range of the data type, the method returns if `s` is less than and if `s` is greater than . 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 . @@ -4885,8 +4881,6 @@ If a separator is encountered in the `s` parameter during a parse operation, and is . is not a number in a valid format. - - .NET Framework only: represents a number that is less than Single.MinValue or greater than Single.MaxValue. is not a value. @@ -4960,11 +4954,11 @@ If a separator is encountered in the `s` parameter during a parse operation, and or as required by the IEEE 754 specification. In prior versions, including .NET Framework, parsing a value that was too large to represent resulted in failure. + Values that are too large to represent are rounded to or as required by the IEEE 754 specification. This overload is typically used to convert text that can be formatted in a variety of ways to a value. For example, it can be used to convert the text entered by a user into an HTML text box to a numeric value. - The `s` parameter is interpreted using a combination of the and flags. The `s` parameter can contain , , or symbol for the culture specified by `provider`. This string comparison is case-insensitive in .NET Core 3.0 and later versions, but is case-sensitive in prior versions including .NET Framework. The `s` parameter can contain a string of the form: + The `s` parameter is interpreted using a combination of the and flags. The `s` parameter can contain , , or symbol for the culture specified by `provider`. This string comparison is case-insensitive. The `s` parameter can contain a string of the form: [*ws*][*sign*]*integral-digits*[*.*[*fractional-digits*]][E[*sign*]*exponential-digits*][*ws*] @@ -4992,7 +4986,7 @@ If a separator is encountered in the `s` parameter during a parse operation, and If `provider` is `null` or a cannot be obtained, the formatting information for the current system culture is used. -If `s` is out of range of the data type, the method throws an on .NET Framework. On .NET Core 3.0 and later versions, it returns if `s` is less than and if `s` is greater than . +If `s` is out of range of the data type, the method returns if `s` is less than and if `s` is greater than . 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 . @@ -5010,8 +5004,6 @@ Some examples of `s` are "100", "-123,456,789", "123.45e+6", "+500", "5e2", "3.1 is . does not represent a number in a valid format. - - .NET Framework only: represents a number less than Single.MinValue or greater than Single.MaxValue. Parsing Numeric Strings in .NET @@ -5113,7 +5105,7 @@ Some examples of `s` are "100", "-123,456,789", "123.45e+6", "+500", "5e2", "3.1 or as required by the IEEE 754 specification. In prior versions, including .NET Framework, parsing a value that was too large to represent resulted in failure. +Values that are too large to represent are rounded to or as required by the IEEE 754 specification. If `s` is out of range of the data type, the method returns if `s` is less than and if `s` is greater than . @@ -5193,7 +5185,7 @@ If `s` is out of range of the data type, the method returns or as required by the IEEE 754 specification. In prior versions, including .NET Framework, parsing a value that was too large to represent resulted in failure. + Values that are too large to represent are rounded to or as required by the IEEE 754 specification. The `style` parameter defines the style elements (such as white space, thousands separators, and currency symbols) that are allowed in the `s` parameter for the parse operation to succeed. It must be a combination of bit flags from the enumeration. The following members are not supported: @@ -5201,7 +5193,7 @@ If `s` is out of range of the data type, the method returns - - The `s` parameter can contain , , or symbol for the culture specified by `provider`. This string comparison is case-insensitive in .NET Core 3.0 and later versions, but is case-sensitive in prior versions including .NET Framework. Depending on the value of `style`, the `s` parameter can also take the form: + The `s` parameter can contain , , or symbol for the culture specified by `provider`. This string comparison is case-insensitive. Depending on the value of `style`, the `s` parameter can also take the form: [*ws*] [*$*] [*sign*][*integral-digits*,]*integral-digits*[.[*fractional-digits*]][E[*sign*]*exponential-digits*][*ws*] @@ -5251,7 +5243,7 @@ If `s` is out of range of the data type, the method returns If `provider` is `null`, the object for the current culture is used. -If `s` is out of range of the data type, the method throws an on .NET Framework. On .NET Core 3.0 and later versions, it returns if `s` is less than and if `s` is greater than . +If `s` is out of range of the data type, the method returns if `s` is less than and if `s` is greater than . 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 . @@ -5274,8 +5266,6 @@ If a separator is encountered in the `s` parameter during a parse operation, and -or- is the value. - - .NET Framework only: represents a number that is less than Single.MinValue or greater than Single.MaxValue. Parsing Numeric Strings in .NET @@ -9469,7 +9459,7 @@ Tau is approximately 6.2831853071795864769. Converts the string representation of a number to its single-precision floating-point number equivalent. A return value indicates whether the conversion succeeded or failed. - In .NET Core 3.0 and later, values that are too large to represent are rounded to or as required by the IEEE 754 specification. In prior versions, including .NET Framework, parsing a value that was too large to represent resulted in failure. + Values that are too large to represent are rounded to or as required by the IEEE 754 specification. @@ -9543,7 +9533,7 @@ Tau is approximately 6.2831853071795864769. Converts the string representation of a number in a character span to its single-precision floating-point number equivalent. A return value indicates whether the conversion succeeded or failed. if was converted successfully; otherwise, . - In .NET Core 3.0 and later, values that are too large to represent are rounded to or as required by the IEEE 754 specification. In prior versions, including .NET Framework, parsing a value that was too large to represent resulted in failure. + Values that are too large to represent are rounded to or as required by the IEEE 754 specification. @@ -9596,7 +9586,7 @@ Tau is approximately 6.2831853071795864769. A string representing a number to convert. - When this method returns, contains single-precision floating-point number equivalent to the numeric value or symbol contained in , if the conversion succeeded, or zero if the conversion failed. The conversion fails if the parameter is or or is not a number in a valid format. It also fails on .NET Framework if represents a number less than Single.MinValue or greater than Single.MaxValue. This parameter is passed uninitialized; any value originally supplied in will be overwritten. + When this method returns, contains single-precision floating-point number equivalent to the numeric value or symbol contained in , if the conversion succeeded, or zero if the conversion failed. The conversion fails if the parameter is or or is not a number in a valid format. This parameter is passed uninitialized; any value originally supplied in will be overwritten. Converts the string representation of a number to its single-precision floating-point number equivalent. A return value indicates whether the conversion succeeded or failed. if was converted successfully; otherwise, . @@ -9604,11 +9594,11 @@ Tau is approximately 6.2831853071795864769. or as required by the IEEE 754 specification. In prior versions, including .NET Framework, parsing a value that was too large to represent resulted in failure. + Values that are too large to represent are rounded to or as required by the IEEE 754 specification. This overload differs from the method by returning a Boolean value that indicates whether the parse operation succeeded instead of returning the parsed numeric value. It eliminates the need to use exception handling to test for a in the event that `s` is invalid and cannot be successfully parsed. - The `s` parameter can contain , , or symbol. This string comparison is case-insensitive in .NET Core 3.0 and later versions, but is case-sensitive in prior versions including .NET Framework. The `s` parameter can also be a string of the form: + The `s` parameter can contain , , or symbol. This string comparison is case-insensitive. The `s` parameter can also be a string of the form: [ws][sign][integral-digits,]integral-digits[.[fractional-digits]][e[sign]exponential-digits][ws] @@ -9631,12 +9621,10 @@ Tau is approximately 6.2831853071795864769. Ordinarily, if you pass the method a string that is created by calling the method, the original value is returned. However, because of a loss of precision, the values may not be equal. -If `s` is out of range of the data type, the method returns `false` on .NET Framework. On .NET Core 3.0 and later versions, it returns if `s` is less than and if `s` is greater than . +If `s` is out of range of the data type, the method returns if `s` is less than and if `s` is greater than . 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 . - - ## Examples The following example uses the method to convert the string representations of numeric values to values. It assumes that en-US is the current culture. @@ -9881,7 +9869,7 @@ If a separator is encountered in the `s` parameter during a parse operation, and Converts the span representation of a number in a specified style and culture-specific format to its single-precision floating-point number equivalent. A return value indicates whether the conversion succeeded or failed. if was converted successfully; otherwise, . - In .NET Core 3.0 and later, values that are too large to represent are rounded to or as required by the IEEE 754 specification. In prior versions, including .NET Framework, parsing a value that was too large to represent resulted in failure. + Values that are too large to represent are rounded to or as required by the IEEE 754 specification. @@ -9939,7 +9927,7 @@ If a separator is encountered in the `s` parameter during a parse operation, and A string representing a number to convert. A bitwise combination of enumeration values that indicates the permitted format of . A typical value to specify is combined with . An object that supplies culture-specific formatting information about . - When this method returns, contains the single-precision floating-point number equivalent to the numeric value or symbol contained in , if the conversion succeeded, or zero if the conversion failed. The conversion fails if the parameter is or , is not in a format compliant with , or if is not a valid combination of enumeration constants. It also fails on .NET Framework if represents a number less than Single.MinValue or greater than Single.MaxValue. This parameter is passed uninitialized; any value originally supplied in will be overwritten. + When this method returns, contains the single-precision floating-point number equivalent to the numeric value or symbol contained in , if the conversion succeeded, or zero if the conversion failed. The conversion fails if the parameter is or , is not in a format compliant with , or if is not a valid combination of enumeration constants. This parameter is passed uninitialized; any value originally supplied in will be overwritten. Converts the string representation of a number in a specified style and culture-specific format to its single-precision floating-point number equivalent. A return value indicates whether the conversion succeeded or failed. if was converted successfully; otherwise, . @@ -9947,7 +9935,7 @@ If a separator is encountered in the `s` parameter during a parse operation, and or as required by the IEEE 754 specification. In prior versions, including .NET Framework, parsing a value that was too large to represent resulted in failure. + Values that are too large to represent are rounded to or as required by the IEEE 754 specification. This overload differs from the method by returning a Boolean value that indicates whether the parse operation succeeded instead of returning the parsed numeric value. It eliminates the need to use exception handling to test for a in the event that `s` is invalid and cannot be successfully parsed. @@ -9957,7 +9945,7 @@ If a separator is encountered in the `s` parameter during a parse operation, and - - The `s` parameter can contain , , or symbol for the culture indicated by `provider`. This string comparison is case-insensitive in .NET Core 3.0 and later versions, but is case-sensitive in prior versions including .NET Framework. In addition, depending on the value of `style`, the `s` parameter may include the following elements: + The `s` parameter can contain , , or symbol for the culture indicated by `provider`. This string comparison is case-insensitive. In addition, depending on the value of `style`, the `s` parameter may include the following elements: [ws] [$] [sign][integral-digits,]integral-digits[.fractional-digits][e[sign]exponential-digits][ws] @@ -10007,7 +9995,7 @@ If a separator is encountered in the `s` parameter during a parse operation, and If `provider` is `null`, the formatting of `s` is interpreted based on the object of the current culture. -If `s` is out of range of the data type, the method throws an on .NET Framework. On .NET Core 3.0 and later versions, it returns if `s` is less than and if `s` is greater than . +If `s` is out of range of the data type, the method returns if `s` is less than and if `s` is greater than . 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/String.xml b/xml/System/String.xml index cb1b6970865..336139cf114 100644 --- a/xml/System/String.xml +++ b/xml/System/String.xml @@ -98,7 +98,6 @@ Represents text as a sequence of UTF-16 code units. For more information about this API, see Supplemental API remarks for String. - Sorting Weight Tables for Windows (.NET Framework and .NET Core only) Default Unicode Collation Element Tables This type is thread safe. @@ -981,7 +980,7 @@ In the following example, the `ReverseStringComparer` class demonstrates how you ]]> - Character sets include ignorable characters. The method does not consider such characters when it performs a culture-sensitive comparison. For example, if the following code is run on the .NET Framework 4 or later, a culture-sensitive comparison of "animal" with "ani-mal" (using a soft hyphen, or U+00AD) indicates that the two strings are equivalent. + Character sets include ignorable characters. The method does not consider such characters when it performs a culture-sensitive comparison. For example, a culture-sensitive comparison of "animal" with "ani-mal" (using a soft hyphen, or U+00AD) indicates that the two strings are equivalent. :::code language="csharp" source="~/snippets/csharp/System/String/Compare/compare21.cs" id="Snippet21"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Compare/compare21.fs" id="Snippet21"::: @@ -1326,7 +1325,7 @@ The following example demonstrates how culture can affect a comparison. In Czech ]]> - Character sets include ignorable characters. The method does not consider such characters when it performs a culture-sensitive comparison. For example, if the following code is run on the .NET Framework 4 or later, a case-insensitive comparison of "animal" with "Ani-mal" (using a soft hyphen, or U+00AD) using the invariant culture indicates that the two strings are equivalent. + Character sets include ignorable characters. The method does not consider such characters when it performs a culture-sensitive comparison. For example, a case-insensitive comparison of "animal" with "Ani-mal" (using a soft hyphen, or U+00AD) using the invariant culture indicates that the two strings are equivalent. :::code language="csharp" source="~/snippets/csharp/System/String/Compare/compare23.cs" id="Snippet23"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Compare/compare23.fs" id="Snippet23"::: @@ -2417,7 +2416,7 @@ The following example uses the method with an is not a . - Character sets include ignorable characters. The method does not consider such characters when it performs a culture-sensitive comparison. For example, if the following code is run on the .NET Framework 4 or later, a comparison of "animal" with "ani-mal" (using a soft hyphen, or U+00AD) indicates that the two strings are equivalent. + Character sets include ignorable characters. The method does not consider such characters when it performs a culture-sensitive comparison. For example, a comparison of "animal" with "ani-mal" (using a soft hyphen, or U+00AD) indicates that the two strings are equivalent. :::code language="csharp" source="~/snippets/csharp/System/String/CompareTo/compareto1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/CompareTo/compareto1.fs" id="Snippet1"::: @@ -2528,7 +2527,7 @@ The following example demonstrates generic and non-generic versions of the Compa ]]> - Character sets include ignorable characters. The method does not consider such characters when it performs a culture-sensitive comparison. For example, if the following code is run on the .NET Framework 4 or later, a comparison of "animal" with "ani-mal" (using a soft hyphen, or U+00AD) indicates that the two strings are equivalent. + Character sets include ignorable characters. The method does not consider such characters when it performs a culture-sensitive comparison. For example, a comparison of "animal" with "ani-mal" (using a soft hyphen, or U+00AD) indicates that the two strings are equivalent. :::code language="csharp" source="~/snippets/csharp/System/String/CompareTo/compareto2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/CompareTo/compareto2.fs" id="Snippet2"::: @@ -3650,11 +3649,7 @@ This method performs an ordinal (case-sensitive and culture-insensitive) compari ## Remarks This method performs an ordinal (case-sensitive and culture-insensitive) comparison. The search begins at the first character position of this string and continues through the last character position. -To perform a culture-sensitive or ordinal case-insensitive comparison: - -- On .NET Core 2.1 and later versions: Call the overload instead. - -- On .NET Framework: Create a custom method. The following example illustrates one such approach. It defines a extension method that includes a parameter and indicates whether a string contains a substring when using the specified form of string comparison. +To perform a culture-sensitive or ordinal case-insensitive comparison, call the overload instead. :::code language="csharp" source="~/snippets/csharp/System/String/Contains/ContainsExt1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Contains/ContainsExt1.fs" id="Snippet1"::: @@ -3885,7 +3880,7 @@ The following example determines whether the string "fox" is a substring of a fa The `Copy` method returns a object that has the same value as the original string but represents a different object reference. It differs from an assignment operation, which assigns an existing string reference to an additional object variable. > [!IMPORTANT] -> Starting with .NET Core 3.0, this method is obsolete. However, we do not recommend its use in any .NET implementation. In particular, because of changes in string interning in .NET Core 3.0, in some cases the `Copy` method doesn't create a new string but simply returns a reference to an existing interned string. +> This method is obsolete. In some cases, the `Copy` method doesn't create a new string but simply returns a reference to an existing interned string. Depending on *why* you want to call the `Copy` method, there are a number of alternatives: @@ -6429,47 +6424,16 @@ The behavior of is dependent on its implementa > [!IMPORTANT] > If two string objects are equal, the method returns identical values. However, there is not a unique hash code value for each unique string value. Different strings can return the same hash code. > -> The hash code itself is not guaranteed to be stable. Hash codes for identical strings can differ across .NET implementations, across .NET versions, and across .NET platforms (such as 32-bit and 64-bit) for a single version of .NET. In some cases, they can even differ by application domain. This implies that two subsequent runs of the same program may return different hash codes. +> The hash code itself is not guaranteed to be stable. Hash codes for identical strings can differ across .NET implementations, across .NET versions, and across .NET platforms (such as 32-bit and 64-bit) for a single version of .NET. This implies that two subsequent runs of the same program may return different hash codes. > -> As a result, hash codes should never be used outside of the application domain in which they were created, they should never be used as key fields in a collection, and they should never be persisted. +> As a result, hash codes should never be used as key fields in a collection, and they should never be persisted. > > Finally, don't use the hash code instead of a value returned by a cryptographic hashing function if you need a cryptographically strong hash. For cryptographic hashes, use a class derived from the or class. > > 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"::: - -When you run the example without supplying a configuration file, it displays output similar to the following. Note that the hash codes for the string are identical in the two application domains. - -```txt -String 'This is a string.' in domain 'PerDomain.exe': 941BCEAC -String 'This is a string.' in domain 'NewDomain': 941BCEAC -``` - -However, if you add the following configuration file to the example's directory and then run the example, the hash codes for the same string will differ by application domain. - -```xml - - - - - - -``` - -When the configuration file is present, the example displays the following output: - -```txt -String 'This is a string.' in domain 'PerDomain.exe': 5435776D -String 'This is a string.' in domain 'NewDomain': 75CC8236 -``` - > [!IMPORTANT] -> Hash codes are used to insert and retrieve keyed objects from hash tables efficiently. However, hash codes don't uniquely identify strings. Identical strings have equal hash codes, but the common language runtime can also assign the same hash code to different strings. In addition, hash codes can vary by version of .NET, by platform within a single version, and by application domain. Because of this, you should not serialize or persist hash code values, nor should you use them as keys in a hash table or dictionary. +> Hash codes are used to insert and retrieve keyed objects from hash tables efficiently. However, hash codes don't uniquely identify strings. Identical strings have equal hash codes, but the common language runtime can also assign the same hash code to different strings. In addition, hash codes can vary by version of .NET, and by platform within a single version. Because of this, you should not serialize or persist hash code values, and you shouldn't use them as keys in a hash table or dictionary. For additional information about the use of hash codes and the `GetHashCode` method, see . @@ -6483,10 +6447,9 @@ 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. + The value returned by is platform-dependent. - <UseRandomizedStringHashAlgorithm> Element @@ -6846,7 +6809,7 @@ Index numbering starts from zero. This method performs a word (case-sensitive and culture-sensitive) search using the current culture. The search begins at the first character position of this instance and continues until the last character position. -Character sets include ignorable characters, which are characters that are not considered when performing a linguistic or culture-sensitive comparison. In a culture-sensitive search, if `value` contains an ignorable character, the result is equivalent to searching with that character removed. If `value` consists only of one or more ignorable characters, the method always returns 0 (zero) to indicate that the match is found at the beginning of the current instance. In the following example, the method is used to find three substrings (a soft hyphen (U+00AD), a soft hyphen followed by "n", and a soft hyphen followed by "m") in two strings. Only one of the strings contains a soft hyphen. If the example is run on the .NET Framework 4 or later, in each case, because the soft hyphen is an ignorable character, the result is the same as if the soft hyphen had not been included in `value`. When searching for a soft hyphen only, the method returns 0 (zero) to indicate that it has found a match at the beginning of the string. +Character sets include ignorable characters, which are characters that are not considered when performing a linguistic or culture-sensitive comparison. In a culture-sensitive search, if `value` contains an ignorable character, the result is equivalent to searching with that character removed. If `value` consists only of one or more ignorable characters, the method always returns 0 (zero) to indicate that the match is found at the beginning of the current instance. In the following example, the method is used to find three substrings (a soft hyphen (U+00AD), a soft hyphen followed by "n", and a soft hyphen followed by "m") in two strings. Only one of the strings contains a soft hyphen. Because the soft hyphen is an ignorable character, the result is the same as if the soft hyphen had not been included in `value`. When searching for a soft hyphen only, the method returns 0 (zero) to indicate that it has found a match at the beginning of the string. :::code language="csharp" source="~/snippets/csharp/System/String/IndexOf/ignorable21.cs" id="Snippet21"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/IndexOf/ignorable21.fs" id="Snippet21"::: @@ -7089,7 +7052,7 @@ Index numbering starts from 0. The `startIndex` parameter can range from 0 to th This method performs a word (case-sensitive and culture-sensitive) search using the current culture. The search begins at the `startIndex` character position of this instance and continues until the last character position. -Character sets include ignorable characters, which are characters that are not considered when performing a linguistic or culture-sensitive comparison. In a culture-sensitive search, if `value` contains an ignorable character, the result is equivalent to searching with that character removed. If `value` consists only of one or more ignorable characters, the method always returns `startIndex`, which is the character position at which the search begins. In the following example, the method is used to find the position of a soft hyphen (U+00AD) followed by an "m" in two strings. Only one of the strings contains the required substring. If the example is run on the .NET Framework 4 or later, in both cases, because the soft hyphen is an ignorable character, the method returns the index of "m" in the string. Note that in the case of the first string, which includes the soft hyphen followed by an "m", the method fails to return the index of the soft hyphen but instead returns the index of the "m". +Character sets include ignorable characters, which are characters that are not considered when performing a linguistic or culture-sensitive comparison. In a culture-sensitive search, if `value` contains an ignorable character, the result is equivalent to searching with that character removed. If `value` consists only of one or more ignorable characters, the method always returns `startIndex`, which is the character position at which the search begins. In the following example, the method is used to find the position of a soft hyphen (U+00AD) followed by an "m" in two strings. Only one of the strings contains the required substring. Because the soft hyphen is an ignorable character, the method returns the index of "m" in the string. Note that in the case of the first string, which includes the soft hyphen followed by an "m", the method fails to return the index of the soft hyphen but instead returns the index of the "m". :::code language="csharp" source="~/snippets/csharp/System/String/IndexOf/ignorable22.cs" id="Snippet22"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/IndexOf/ignorable22.fs" id="Snippet22"::: @@ -7187,7 +7150,7 @@ The following example demonstrates three overloads of the Character sets include ignorable characters, which are characters that are not considered when performing a linguistic or culture-sensitive comparison. In a culture-sensitive search (that is, if is not or ), if contains an ignorable character, the result is equivalent to searching with that character removed. If consists only of one or more ignorable characters, the method always returns 0 (zero) to indicate that the match is found at the beginning of the current instance. -In the following example, the method is used to find three substrings (a soft hyphen (U+00AD), a soft hyphen followed by "n", and a soft hyphen followed by "m") in two strings. Only one of the strings contains a soft hyphen. If the example is run on the .NET Framework 4 or later, because the soft hyphen is an ignorable character, a culture-sensitive search returns the same value that it would return if the soft hyphen were not included in the search string. An ordinal search, however, successfully finds the soft hyphen in one string and reports that it is absent from the second string. +In the following example, the method is used to find three substrings (a soft hyphen (U+00AD), a soft hyphen followed by "n", and a soft hyphen followed by "m") in two strings. Only one of the strings contains a soft hyphen. Because the soft hyphen is an ignorable character, a culture-sensitive search returns the same value that it would return if the soft hyphen were not included in the search string. An ordinal search, however, successfully finds the soft hyphen in one string and reports that it is absent from the second string. :::code language="csharp" source="~/snippets/csharp/System/String/IndexOf/ignorable26.cs" id="Snippet26"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/IndexOf/ignorable26.fs" id="Snippet26"::: @@ -7436,7 +7399,7 @@ Index numbering starts from 0 (zero). The `startIndex` parameter can range from This method performs a word (case-sensitive and culture-sensitive) search using the current culture. The search begins at `startIndex` and continues to `startIndex` + `count` -1. The character at `startIndex` + `count` is not included in the search. -Character sets include ignorable characters, which are characters that are not considered when performing a linguistic or culture-sensitive comparison. In a culture-sensitive search, if `value` contains an ignorable character, the result is equivalent to searching with that character removed. If `value` consists only of one or more ignorable characters, the method always returns `startIndex`, which is the character position at which the search begins. In the following example, the method is used to find the position of a soft hyphen (U+00AD) followed by an "m" starting in the third through sixth character positions in two strings. Only one of the strings contains the required substring. If the example is run on the .NET Framework 4 or later, in both cases, because the soft hyphen is an ignorable character, the method returns the index of "m" in the string when it performs a culture-sensitive comparison. Note that in the case of the first string, which includes the soft hyphen followed by an "m", the method fails to return the index of the soft hyphen but instead returns the index of the "m". +Character sets include ignorable characters, which are characters that are not considered when performing a linguistic or culture-sensitive comparison. In a culture-sensitive search, if `value` contains an ignorable character, the result is equivalent to searching with that character removed. If `value` consists only of one or more ignorable characters, the method always returns `startIndex`, which is the character position at which the search begins. In the following example, the method is used to find the position of a soft hyphen (U+00AD) followed by an "m" starting in the third through sixth character positions in two strings. Only one of the strings contains the required substring. Because the soft hyphen is an ignorable character, the method returns the index of "m" in the string when it performs a culture-sensitive comparison. Note that in the case of the first string, which includes the soft hyphen followed by an "m", the method fails to return the index of the soft hyphen but instead returns the index of the "m". :::code language="csharp" source="~/snippets/csharp/System/String/IndexOf/ignorable23.cs" id="Snippet23"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/IndexOf/ignorable23.fs" id="Snippet23"::: @@ -7546,7 +7509,7 @@ The following example demonstrates three overloads of the Character sets include ignorable characters, which are characters that are not considered when performing a linguistic or culture-sensitive comparison. In a culture-sensitive search (that is, if is not or ), if contains an ignorable character, the result is equivalent to searching with that character removed. If consists only of one or more ignorable characters, the method always returns , which is the character position at which the search begins. -In the following example, the method is used to find the position of a soft hyphen (U+00AD) followed by an "m" starting with the third character position in two strings. Only one of the strings contains the required substring. If the example is run on the .NET Framework 4 or later, in both cases, because the soft hyphen is an ignorable character, the method returns the index of "m" in the string when it performs a culture-sensitive comparison. Note that in the case of the first string, which includes the soft hyphen followed by an "m", the method fails to return the index of the soft hyphen but instead returns the index of the "m". The method returns the index of the soft hyphen in the first string only when it performs an ordinal comparison. +In the following example, the method is used to find the position of a soft hyphen (U+00AD) followed by an "m" starting with the third character position in two strings. Only one of the strings contains the required substring. Because the soft hyphen is an ignorable character, the method returns the index of "m" in the string when it performs a culture-sensitive comparison. Note that in the case of the first string, which includes the soft hyphen followed by an "m", the method fails to return the index of the soft hyphen but instead returns the index of the "m". The method returns the index of the soft hyphen in the first string only when it performs an ordinal comparison. :::code language="csharp" source="~/snippets/csharp/System/String/IndexOf/ignorable25.cs" id="Snippet25"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/IndexOf/ignorable25.fs" id="Snippet25"::: @@ -7746,7 +7709,7 @@ The following example demonstrates three overloads of the Character sets include ignorable characters, which are characters that are not considered when performing a linguistic or culture-sensitive comparison. In a culture-sensitive search (that is, if is not or ), if contains an ignorable character, the result is equivalent to searching with that character removed. If consists only of one or more ignorable characters, the method always returns , which is the character position at which the search begins. -In the following example, the method is used to find the position of a soft hyphen (U+00AD) followed by an "m" starting in the third through sixth character positions in two strings. Only one of the strings contains the required substring. If the example is run on the .NET Framework 4 or later, in both cases, because the soft hyphen is an ignorable character, the method returns the index of "m" in the string when it performs a culture-sensitive comparison. When it performs an ordinal comparison, however, it finds the substring only in the first string. Note that in the case of the first string, which includes the soft hyphen followed by an "m", the method fails to return the index of the soft hyphen but instead returns the index of the "m" when it performs a culture-sensitive comparison. The method returns the index of the soft hyphen in the first string only when it performs an ordinal comparison. +In the following example, the method is used to find the position of a soft hyphen (U+00AD) followed by an "m" starting in the third through sixth character positions in two strings. Only one of the strings contains the required substring. Because the soft hyphen is an ignorable character, the method returns the index of "m" in the string when it performs a culture-sensitive comparison. When it performs an ordinal comparison, however, it finds the substring only in the first string. Note that in the case of the first string, which includes the soft hyphen followed by an "m", the method fails to return the index of the soft hyphen but instead returns the index of the "m" when it performs a culture-sensitive comparison. The method returns the index of the soft hyphen in the first string only when it performs an ordinal comparison. :::code language="csharp" source="~/snippets/csharp/System/String/IndexOf/ignorable24.cs" id="Snippet24"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/IndexOf/ignorable24.fs" id="Snippet24"::: @@ -8938,15 +8901,7 @@ The following example uses the Sieve of Eratosthenes algorithm to calculate the The string to use as a separator. is included in the returned string only if has more than one element. An array that contains the elements to concatenate. Concatenates the elements of an object array, using the specified separator between each element. - A string that consists of the elements of delimited by the string. - --or- - - if has zero elements. - --or- - -.NET Framework only: if the first element of is . + A string that consists of the elements of delimited by the string, or if has zero elements. is . The length of the resulting string overflows the maximum allowed length (Int32.MaxValue). - - .NET Framework only: If the first element of is , the method does not concatenate the elements in but instead returns . A number of workarounds for this issue are available. The easiest is to assign a value of to the first element of the array, as the following example shows. - -:::code language="csharp" source="~/snippets/csharp/System/String/Join/joinfix1.cs" id="Snippet6"::: -:::code language="fsharp" source="~/snippets/fsharp/System/String/Join/joinfix1.fs" id="Snippet6"::: -:::code language="vb" source="~/snippets/visualbasic/System/String/Join/joinfix1.vb" id="Snippet6"::: - @@ -9635,7 +9583,7 @@ This method performs a word (case-sensitive and culture-sensitive) search using Character sets include ignorable characters, which are characters that are not considered when performing a linguistic or culture-sensitive comparison. In a culture-sensitive search, if `value` contains an ignorable character, the result is equivalent to searching with that character removed. -In the following example, the method is used to find two substrings (a soft hyphen followed by "n" and a soft hyphen followed by "m") in two strings. Only one of the strings contains a soft hyphen. If the example is run on .NET Framework 4 or later, in each case, because the soft hyphen is an ignorable character, the result is the same as if the soft hyphen had not been included in `value`. +In the following example, the method is used to find two substrings (a soft hyphen followed by "n" and a soft hyphen followed by "m") in two strings. Only one of the strings contains a soft hyphen. Because the soft hyphen is an ignorable character, the result is the same as if the soft hyphen had not been included in `value`. :::code language="csharp" source="~/snippets/csharp/System/String/LastIndexOf/lastindexof21.cs" id="Snippet21"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/LastIndexOf/lastindexof21.fs" id="Snippet21"::: @@ -9852,7 +9800,7 @@ The search begins at the `startIndex` character position of this instance and pr This method performs a word (case-sensitive and culture-sensitive) search using the current culture. -Character sets include ignorable characters, which are characters that are not considered when performing a linguistic or culture-sensitive comparison. In a culture-sensitive search, if `value` contains an ignorable character, the result is equivalent to searching with that character removed. In the following example, the method is used to find a substring that includes a soft hyphen (U+00AD) and that precedes or includes the final "m" in a string. If the example is run on .NET Framework 4 or later, because the soft hyphen in the search string is ignored, calling the method to find a substring that consists of the soft hyphen and "m" returns the position of the "m" in the string, whereas calling it to find a substring that consists of the soft hyphen and "n" returns the position of the "n". +Character sets include ignorable characters, which are characters that are not considered when performing a linguistic or culture-sensitive comparison. In a culture-sensitive search, if `value` contains an ignorable character, the result is equivalent to searching with that character removed. In the following example, the method is used to find a substring that includes a soft hyphen (U+00AD) and that precedes or includes the final "m" in a string. Because the soft hyphen in the search string is ignored, calling the method to find a substring that consists of the soft hyphen and "m" returns the position of the "m" in the string, whereas calling it to find a substring that consists of the soft hyphen and "n" returns the position of the "n". :::code language="csharp" source="~/snippets/csharp/System/String/LastIndexOf/lastindexof22.cs" id="Snippet22"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/LastIndexOf/lastindexof22.fs" id="Snippet22"::: @@ -9959,7 +9907,7 @@ The following example demonstrates three overloads of the Character sets include ignorable characters, which are characters that are not considered when performing a linguistic or culture-sensitive comparison. In a culture-sensitive search (that is, if is not or ), if contains an ignorable character, the result is equivalent to searching with that character removed. -In the following example, the method is used to find two substrings (a soft hyphen followed by "n", and a soft hyphen followed by "m") in two strings. Only one of the strings contains a soft hyphen. If the example is run on .NET Framework 4 or later, because the soft hyphen is an ignorable character, a culture-sensitive search returns the same value that it would return if the soft hyphen were not included in the search string. An ordinal search, however, successfully finds the soft hyphen in one string and reports that it is absent from the second string. +In the following example, the method is used to find two substrings (a soft hyphen followed by "n", and a soft hyphen followed by "m") in two strings. Only one of the strings contains a soft hyphen. Because the soft hyphen is an ignorable character, a culture-sensitive search returns the same value that it would return if the soft hyphen were not included in the search string. An ordinal search, however, successfully finds the soft hyphen in one string and reports that it is absent from the second string. :::code language="csharp" source="~/snippets/csharp/System/String/LastIndexOf/lastindexof26.cs" id="Snippet26"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/LastIndexOf/lastindexof26.fs" id="Snippet26"::: @@ -10333,7 +10281,7 @@ The current instance equals , and Character sets include ignorable characters, which are characters that are not considered when performing a linguistic or culture-sensitive comparison. In a culture-sensitive search (that is, if is not or ), if contains an ignorable character, the result is equivalent to searching with that character removed. -In the following example, the method is used to find the position of a soft hyphen (U+00AD) followed by an "m", starting with the final "m" in two strings. Only one of the strings contains the required substring. If the example is run on .NET Framework 4 or later, in both cases, because the soft hyphen is an ignorable character, the method returns the index of "m" in the string when it performs a culture-sensitive comparison. Note that in the case of the first string, which includes the soft hyphen followed by an "m", the method returns the index of the "m" and not the index of the soft hyphen. The method returns the index of the soft hyphen in the first string only when it performs an ordinal comparison. +In the following example, the method is used to find the position of a soft hyphen (U+00AD) followed by an "m", starting with the final "m" in two strings. Only one of the strings contains the required substring. Because the soft hyphen is an ignorable character, the method returns the index of "m" in the string when it performs a culture-sensitive comparison. Note that in the case of the first string, which includes the soft hyphen followed by an "m", the method returns the index of the "m" and not the index of the soft hyphen. The method returns the index of the soft hyphen in the first string only when it performs an ordinal comparison. :::code language="csharp" source="~/snippets/csharp/System/String/LastIndexOf/lastindexof25.cs" id="Snippet25"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/LastIndexOf/lastindexof25.fs" id="Snippet25"::: @@ -10549,7 +10497,7 @@ The current instance equals and Character sets include ignorable characters, which are characters that are not considered when performing a linguistic or culture-sensitive comparison. In a culture-sensitive search (that is, if is not or ), if contains an ignorable character, the result is equivalent to searching with that character removed. -In the following example, the method is used to find the position of a soft hyphen (U+00AD) followed by an "m" in all but the first character position before the final "m" in two strings. Only one of the strings contains the required substring. If the example is run on .NET Framework 4 or later, in both cases, because the soft hyphen is an ignorable character, the method returns the index of "m" in the string when it performs a culture-sensitive comparison. When it performs an ordinal comparison, however, it finds the substring only in the first string. Note that in the case of the first string, which includes the soft hyphen followed by an "m", the method returns the index of the "m" when it performs a culture-sensitive comparison. The method returns the index of the soft hyphen in the first string only when it performs an ordinal comparison. +In the following example, the method is used to find the position of a soft hyphen (U+00AD) followed by an "m" in all but the first character position before the final "m" in two strings. Only one of the strings contains the required substring. Because the soft hyphen is an ignorable character, the method returns the index of "m" in the string when it performs a culture-sensitive comparison. When it performs an ordinal comparison, however, it finds the substring only in the first string. Note that in the case of the first string, which includes the soft hyphen followed by an "m", the method returns the index of the "m" when it performs a culture-sensitive comparison. The method returns the index of the soft hyphen in the first string only when it performs an ordinal comparison. :::code language="csharp" source="~/snippets/csharp/System/String/LastIndexOf/lastindexof24.cs" id="Snippet24"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/LastIndexOf/lastindexof24.fs" id="Snippet24"::: @@ -11624,7 +11572,8 @@ 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. @@ -11704,7 +11653,8 @@ 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`. @@ -12371,9 +12321,6 @@ The following example demonstrates how to extract individual words from a block ]]> - - In .NET Framework 3.5 and earlier versions, if the method is passed a that is or contains no characters, the method uses a slightly different set of white-space characters to split the string than the method does to trim the string. Starting with .NET Framework 4, both methods use an identical set of Unicode white-space characters. - @@ -12573,9 +12520,6 @@ The following example demonstrates how `count` can be used to limit the number o is negative. - - In .NET Framework 3.5 and earlier versions, if the method is passed a that is or contains no characters, the method uses a slightly different set of white-space characters to split the string than the method does to trim the string. Starting with .NET Framework 4, both methods use an identical set of Unicode white-space characters. - @@ -12697,9 +12641,6 @@ The following example uses the enumeration to i is not one of the values. - - In .NET Framework 3.5 and earlier versions, if the method is passed a that is or contains no characters, the method uses a slightly different set of white-space characters to split the string than the method does to trim the string. Starting with .NET Framework 4, both methods use an identical set of Unicode white-space characters. - @@ -12879,9 +12820,6 @@ Note that the method is called with the `options` argument set to is not one of the values. - - In .NET Framework 3.5 and earlier versions, if the method is passed a that is or contains no characters, the method uses a slightly different set of white-space characters to split the string than the method does to trim the string. Starting with .NET Framework 4, both methods use an identical set of Unicode white-space characters. - @@ -13064,9 +13002,6 @@ The following example uses the enumeration to i is negative. is not one of the values. - - In .NET Framework 3.5 and earlier versions, if the method is passed a that is or contains no characters, the method uses a slightly different set of white-space characters to split the string than the method does to trim the string. Starting with .NET Framework 4, both methods use an identical set of Unicode white-space characters. - @@ -13244,9 +13179,6 @@ The following example uses the enumeration to i is negative. is not one of the values. - - In .NET Framework 3.5 and earlier versions, if the method is passed a that is or contains no characters, the method uses a slightly different set of white-space characters to split the string than the method does to trim the string. Starting with .NET Framework 4, both methods use an identical set of Unicode white-space characters. - @@ -16019,9 +15951,6 @@ The following example uses the - - The .NET Framework 3.5 SP1 and earlier versions maintain an internal list of white-space characters that this method trims. Starting with the .NET Framework 4, the method trims all Unicode white-space characters (that is, characters that produce a return value when they are passed to the method). Because of this change, the method in the .NET Framework 3.5 SP1 and earlier versions removes two characters, ZERO WIDTH SPACE (U+200B) and ZERO WIDTH NO-BREAK SPACE (U+FEFF), that the method in the .NET Framework 4 and later versions does not remove. In addition, the method in the .NET Framework 3.5 SP1 and earlier versions does not trim three Unicode white-space characters: MONGOLIAN VOWEL SEPARATOR (U+180E), NARROW NO-BREAK SPACE (U+202F), and MEDIUM MATHEMATICAL SPACE (U+205F). - @@ -16158,9 +16087,6 @@ The following example uses the `Trim(System.Char[])` method to remove space, ast ]]> - - The .NET Framework 3.5 SP1 and earlier versions maintains an internal list of white-space characters that this method trims if is or an empty array. Starting with the .NET Framework 4, if is or an empty array, the method trims all Unicode white-space characters (that is, characters that produce a return value when they are passed to the method). Because of this change, the method in the .NET Framework 3.5 SP1 and earlier versions removes two characters, ZERO WIDTH SPACE (U+200B) and ZERO WIDTH NO-BREAK SPACE (U+FEFF), that the method in the .NET Framework 4and later versions does not remove. In addition, the method in the .NET Framework 3.5 SP1 and earlier versions does not trim three Unicode white-space characters: MONGOLIAN VOWEL SEPARATOR (U+180E), NARROW NO-BREAK SPACE (U+202F), and MEDIUM MATHEMATICAL SPACE (U+205F). - @@ -16369,9 +16295,6 @@ The following example demonstrates how you can use the `TrimEnd(System.Char[])` ]]> - - The .NET Framework 3.5 SP1 and earlier versions maintains an internal list of white-space characters that this method trims if is or an empty array. Starting with the .NET Framework 4, if is or an empty array, the method trims all Unicode white-space characters (that is, characters that produce a return value when they are passed to the method). Because of this change, the method in the .NET Framework 3.5 SP1 and earlier versions removes two characters, ZERO WIDTH SPACE (U+200B) and ZERO WIDTH NO-BREAK SPACE (U+FEFF), that the method in the .NET Framework 4 and later versions does not remove. In addition, the method in the .NET Framework 3.5 SP1 and earlier versions does not trim three Unicode white-space characters: MONGOLIAN VOWEL SEPARATOR (U+180E), NARROW NO-BREAK SPACE (U+202F), and MEDIUM MATHEMATICAL SPACE (U+205F). - @@ -16592,9 +16515,6 @@ The following example then illustrates a call to the `StripComments` method. ]]> - - The .NET Framework 3.5 SP1 and earlier versions maintains an internal list of white-space characters that this method trims if is or an empty array. Starting with the .NET Framework 4, if is or an empty array, the method trims all Unicode white-space characters (that is, characters that produce a return value when they are passed to the method). Because of this change, the method in the .NET Framework 3.5 SP1 and earlier versions removes two characters, ZERO WIDTH SPACE (U+200B) and ZERO WIDTH NO-BREAK SPACE (U+FEFF), that the method in the .NET Framework 4 and later versions does not remove. In addition, the method in the .NET Framework 3.5 SP1 and earlier versions does not trim three Unicode white-space characters: MONGOLIAN VOWEL SEPARATOR (U+180E), NARROW NO-BREAK SPACE (U+202F), and MEDIUM MATHEMATICAL SPACE (U+205F). - diff --git a/xml/System/StringComparer.xml b/xml/System/StringComparer.xml index 609d04820eb..7dfb14942b9 100644 --- a/xml/System/StringComparer.xml +++ b/xml/System/StringComparer.xml @@ -808,7 +808,7 @@ The following example demonstrates the properties and the method is more efficient than the method because the `obj` parameter does not have to be unboxed to perform the operation. - The method allocates an amount of memory that is proportional to the size of `obj` to calculate the hash code of `obj`. In the case of large strings, trying to retrieve the hash code can throw an . Instead, you can use an alternate algorithm that allocates a fixed amount of memory when calculating hash codes. To use this algorithm, add the [](/dotnet/framework/configure-apps/file-schema/runtime/netfx45-cultureawarecomparergethashcode-longstrings-element) element to the [\](/dotnet/framework/configure-apps/file-schema/runtime/runtime-element) section of your application's configuration file. + The method allocates an amount of memory that is proportional to the size of `obj` to calculate the hash code of `obj`. In the case of large strings, trying to retrieve the hash code can throw an . ]]> @@ -874,7 +874,7 @@ The following example demonstrates the properties and the method is more efficient than the method because the `obj` parameter does not have to be unboxed to perform the operation. - The method allocates an amount of memory that is proportional to the size of `obj` to calculate the hash code of `obj`. In the case of large strings, trying to retrieve the hash code can throw an . Instead, you can use an alternate algorithm that allocates a fixed amount of memory when calculating hash codes. To use this algorithm, add the [](/dotnet/framework/configure-apps/file-schema/runtime/netfx45-cultureawarecomparergethashcode-longstrings-element) element to the [\](/dotnet/framework/configure-apps/file-schema/runtime/runtime-element) section of your application's configuration file. + The method allocates an amount of memory that is proportional to the size of `obj` to calculate the hash code of `obj`. In the case of large strings, trying to retrieve the hash code can throw an . ]]> diff --git a/xml/System/StringSplitOptions.xml b/xml/System/StringSplitOptions.xml index cb34db75911..6431d733a28 100644 --- a/xml/System/StringSplitOptions.xml +++ b/xml/System/StringSplitOptions.xml @@ -62,8 +62,6 @@ The method returns an a Specify the `None` field to invoke the default behavior of the method, which is not to trim white-space characters and to include empty substrings. -The `TrimEntries` field is only available in .NET 5 and later versions. - ## Examples The following example shows how the `StringSplitOptions` enumeration is used to include or exclude substrings generated by the method: @@ -199,7 +197,7 @@ If and 2 - Trim white-space characters from each substring in the result. This field is available in .NET 5 and later versions only. + Trim white-space characters from each substring in the result. If and are specified together, then substrings that consist only of white-space characters are also removed from the result. diff --git a/xml/System/TimeSpan.xml b/xml/System/TimeSpan.xml index 0bf7cdba12f..11d92838e49 100644 --- a/xml/System/TimeSpan.xml +++ b/xml/System/TimeSpan.xml @@ -5351,7 +5351,7 @@ The value of this constant is 10. ]]> - Support for formatting values was added in the .NET Framework 4. However, the method overload remains culture-insensitive. Its behavior remains unchanged from previous versions of the .NET Framework. To control the formatting of a value, call the or overload. + The method overload is culture-insensitive. To control the formatting of a value, call the or overload. diff --git a/xml/System/TimeZone.xml b/xml/System/TimeZone.xml index 61bd43f5c4d..1f08f87b7c2 100644 --- a/xml/System/TimeZone.xml +++ b/xml/System/TimeZone.xml @@ -75,7 +75,7 @@ ]]> - In addition to providing implementations for its members (those marked in Visual Basic), it is important that classes derived from override the default behavior of the method. This is because the default behavior of in the .NET Framework version 2.0 does not depend on a call to , as it did in the .NET Framework versions 1.0 and 1.1. For details, see the method. + In addition to providing implementations for its members (those marked in Visual Basic), it is important that classes derived from override the default behavior of the method. For details, see the method. diff --git a/xml/System/TimeZoneInfo.xml b/xml/System/TimeZoneInfo.xml index d32e00709e2..cafca13d322 100644 --- a/xml/System/TimeZoneInfo.xml +++ b/xml/System/TimeZoneInfo.xml @@ -965,12 +965,10 @@ 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. +> 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/Tuple.xml b/xml/System/Tuple.xml index 467cc846e7e..6953e4f50d2 100644 --- a/xml/System/Tuple.xml +++ b/xml/System/Tuple.xml @@ -57,19 +57,16 @@ property of a object. + A tuple is a data structure that has a specific number and sequence of elements. An example of a tuple is a data structure with three elements (known as a 3-tuple or triple) that is used to store an identifier such as a person's name in the first element, a year in the second element, and the person's income for that year in the third element. .NET directly supports tuples with one to seven elements. In addition, you can create tuples of eight or more elements by nesting tuple objects in the property of a object. Tuples are commonly used in four ways: - To represent a single set of data. For example, a tuple can represent a database record, and its components can represent individual fields of the record. - - To provide easy access to, and manipulation of, a data set. - - To return multiple values from a method without using `out` parameters (in C#) or `ByRef` parameters (in Visual Basic). - - To pass multiple values to a method through a single parameter. For example, the method has a single parameter that lets you supply one value to the method that the thread executes at startup time. If you supply a object as the method argument, you can supply the thread's startup routine with three items of data. - The class does not itself represent a tuple. Instead, it is a class that provides static methods for creating instances of the tuple types that are supported by the .NET Framework. It provides helper methods that you can call to instantiate tuple objects without having to explicitly specify the type of each tuple component. + The class does not itself represent a tuple. Instead, it is a class that provides static methods for creating instances of the tuple types that are supported by .NET. It provides helper methods that you can call to instantiate tuple objects without having to explicitly specify the type of each tuple component. Although you can create an instance of a tuple class by calling its class constructor, the code to do so can be cumbersome. The following example uses a class constructor to create a 7-tuple or septuple that contains population data for New York City for each census from 1950 through 2000. @@ -86,9 +83,7 @@ The helper methods directly support the creation of tuple objects that have from one to eight components (that is, singletons through octuples). Although there is no practical limit to the number of components a tuple may have, helper methods are not available to create a tuple with nine or more components. To create such a tuple, you must call the constructor. > [!NOTE] -> For additional information and examples that use tuples, see the documentation for the individual tuple types in the .NET Framework. These are listed in the See Also section at the end of this topic. - - +> For additional information and examples that use tuples, see the documentation for the individual tuple types in .NET, which are listed in the See Also section. ## Examples The following example creates an 8-tuple (octuple) that contains prime numbers that are less than 20. diff --git a/xml/System/TupleExtensions.xml b/xml/System/TupleExtensions.xml index b983fde86ef..6f1a1054e62 100644 --- a/xml/System/TupleExtensions.xml +++ b/xml/System/TupleExtensions.xml @@ -993,7 +993,7 @@ ## Remarks This method is implemented primarily to support the tuple language features in C#. - Because the .NET Framework tuple types implement tuples with more than 7 elements by nesting a tuple in , `item8` is an element in a nested tuple. + Because the .NET tuple types implement tuples with more than 7 elements by nesting a tuple in , `item8` is an element in a nested tuple. ]]> @@ -1159,7 +1159,7 @@ ## Remarks This method is implemented primarily to support the tuple language features in C#. - Because the .NET Framework tuple types implement tuples with more than 7 elements by nesting a tuple in , `item8` and `item9` are elements of nested tuples. + Because the .NET tuple types implement tuples with more than 7 elements by nesting a tuple in , `item8` and `item9` are elements of nested tuples. ]]> @@ -1336,7 +1336,7 @@ ## Remarks This method is implemented primarily to support the tuple language features in C#. - Because the .NET Framework tuple types implement tuples with more than 7 elements by nesting a tuple in , `item8` through `item10` are elements of nested tuples. + Because the .NET tuple types implement tuples with more than 7 elements by nesting a tuple in , `item8` through `item10` are elements of nested tuples. ]]> @@ -1524,7 +1524,7 @@ ## Remarks This method is implemented primarily to support the tuple language features in C#. - Because the .NET Framework tuple types implement tuples with more than 7 elements by nesting a tuple in , `item8` through `item11` are elements of nested tuples. + Because the .NET tuple types implement tuples with more than 7 elements by nesting a tuple in , `item8` through `item11` are elements of nested tuples. ]]> @@ -1723,7 +1723,7 @@ ## Remarks This method is implemented primarily to support the tuple language features in C#. - Because the .NET Framework tuple types implement tuples with more than 7 elements by nesting a tuple in , `item8` through `item12` are elements of nested tuples. + Because the .NET tuple types implement tuples with more than 7 elements by nesting a tuple in , `item8` through `item12` are elements of nested tuples. ]]> @@ -1933,7 +1933,7 @@ ## Remarks This method is implemented primarily to support the tuple language features in C#. - Because the .NET Framework tuple types implement tuples with more than 7 elements by nesting a tuple in , `item8` through `item13` are elements of nested tuples. + Because the .NET tuple types implement tuples with more than 7 elements by nesting a tuple in , `item8` through `item13` are elements of nested tuples. ]]> @@ -2377,7 +2377,7 @@ ## Remarks This method is implemented primarily to support the tuple language features in C#. - Because the .NET Framework tuple types implement tuples with more than 7 elements by nesting a tuple in , `item8` through `item15` are elements of nested tuples. + Because the .NET tuple types implement tuples with more than 7 elements by nesting a tuple in , `item8` through `item15` are elements of nested tuples. ]]> @@ -2620,7 +2620,7 @@ ## Remarks This method is implemented primarily to support the tuple language features in C#. - Because the .NET Framework tuple types implement tuples with more than 7 elements by nesting a tuple in , `item8` through `item16` are elements of nested tuples. + Because the .NET tuple types implement tuples with more than 7 elements by nesting a tuple in , `item8` through `item16` are elements of nested tuples. ]]> @@ -2874,7 +2874,7 @@ ## Remarks This method is implemented primarily to support the tuple language features in C#. - Because the .NET Framework tuple types implement tuples with more than 7 elements by nesting a tuple in , `item8` through `item17` are elements of nested tuples. + Because the .NET tuple types implement tuples with more than 7 elements by nesting a tuple in , `item8` through `item17` are elements of nested tuples. ]]> @@ -3139,7 +3139,7 @@ ## Remarks This method is implemented primarily to support the tuple language features in C#. - Because the .NET Framework tuple types implement tuples with more than 7 elements by nesting a tuple in , `item8` through `item18` are elements of nested tuples. + Because the .NET tuple types implement tuples with more than 7 elements by nesting a tuple in , `item8` through `item18` are elements of nested tuples. ]]> @@ -3415,7 +3415,7 @@ ## Remarks This method is implemented primarily to support the tuple language features in C#. - Because the .NET Framework tuple types implement tuples with more than 7 elements by nesting a tuple in , `item8` through `item19` are elements of nested tuples. + Because the .NET tuple types implement tuples with more than 7 elements by nesting a tuple in , `item8` through `item19` are elements of nested tuples. ]]> @@ -3991,7 +3991,7 @@ ## Remarks This method is implemented primarily to support the tuple language features in C#. - Because the .NET Framework tuple types implement tuples with more than 7 elements by nesting a tuple in , `item8` through `item21` are elements of nested tuples. + Because the .NET tuple types implement tuples with more than 7 elements by nesting a tuple in , `item8` through `item21` are elements of nested tuples. ]]> diff --git a/xml/System/Type.xml b/xml/System/Type.xml index 6c5098e239e..4330e0d6f85 100644 --- a/xml/System/Type.xml +++ b/xml/System/Type.xml @@ -218,19 +218,10 @@ The code example uses the to invoke the object represents an unassigned generic parameter `T`, this property returns the assembly that contains the generic type that defines `T`. - If the property is not available on a particular .NET implementation, such as .NET Core or the Universal Windows Platform, use the property instead. + If the property is not available, use the property instead. This property is read-only. - - -## Examples - The following example displays the assembly name associated with the class and the fully qualified name of the type. - - :::code language="csharp" source="~/snippets/csharp/System/Type/Assembly/type_assembly.cs" id="Snippet1"::: - :::code language="fsharp" source="~/snippets/fsharp/System/Type/Assembly/type_assembly.fs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System/Type/Assembly/type_assembly.vb" id="Snippet1"::: - ]]> @@ -635,13 +626,8 @@ 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. - - ## Examples The following code example defines a class that has a generic method, assigns a type argument to the method, and invokes the resulting constructed generic method. It also displays information about the generic method definition and the constructed method. When displaying information about the type parameters of the generic method definition, in the `DisplayGenericMethodInfo` method, the example code shows the value of the property for the method's generic type parameter. @@ -2308,11 +2294,11 @@ The `filter` argument can be a custom delegate of type [!NOTE] > You cannot omit parameters when looking up constructors and methods. You can only omit parameters when invoking. @@ -2591,11 +2577,11 @@ False |Nested Type|No|No| |Property|Not applicable|The common type system rule is that the inheritance is the same as that of the methods that implement the property. Reflection treats properties as hide-by-name-and-signature. See note 2 below.| -1. Hide-by-name-and-signature considers all of the parts of the signature, including custom modifiers, return types, parameter types, sentinels, and unmanaged calling conventions. This is a binary comparison. +1. Hide-by-name-and-signature considers all of the parts of the signature, including custom modifiers, return types, parameter types, sentinels, and unmanaged calling conventions. This is a binary comparison. -2. For reflection, properties and events are hide-by-name-and-signature. If you have a property with both a get and a set accessor in the base class, but the derived class has only a get accessor, the derived class property hides the base class property, and you will not be able to access the setter on the base class. +2. For reflection, properties and events are hide-by-name-and-signature. If you have a property with both a get and a set accessor in the base class, but the derived class has only a get accessor, the derived class property hides the base class property, and you will not be able to access the setter on the base class. -3. Custom attributes are not part of the common type system. +3. Custom attributes are not part of the common type system. This method overload calls the method overload, with | (` Or ` in Visual Basic). It will not find class initializers (static constructor). To find class initializers, use an overload that takes , and specify | (` Or ` in Visual Basic). You can also get the class initializer using the property. @@ -2762,11 +2748,11 @@ If the current represents a generic type parameter, the represents a constructed generic type, this method returns the objects with the type parameters replaced by the appropriate type arguments. For example, if class `C` has a property `P` that returns `T`, calling on `C` returns `int P` in C# (`Property P As Integer` in Visual Basic). @@ -3182,11 +3168,11 @@ If the current represents a generic type parameter, the represents a constructed generic type, this method returns the with the type parameters replaced by the appropriate type arguments. @@ -3402,11 +3388,11 @@ If the current represents a generic type parameter, the represents a constructed generic type, this method returns the objects with the type parameters replaced by the appropriate type arguments. @@ -3709,11 +3695,11 @@ If the current represents a generic type parameter, the filter flags can be used to define which fields to include in the search: @@ -3834,11 +3820,11 @@ If the current represents a generic type parameter, the represents a constructed generic type, this method returns the objects with the type parameters replaced by the appropriate type arguments. @@ -4276,7 +4262,7 @@ In .NET 6 and earlier versions, the method does no ]]> - The current type is not a generic type. That is, returns . + The current type is not a generic type. That is, returns . The invoked method is not supported in the base class. Derived classes must provide an implementation. @@ -4801,11 +4787,11 @@ The current instance or argument is an open ge |Nested Type|No|No| |Property|Not applicable|The common type system rule is that the inheritance is the same as that of the methods that implement the property. Reflection treats properties as hide-by-name-and-signature. See note 2 below.| -1. Hide-by-name-and-signature considers all of the parts of the signature, including custom modifiers, return types, parameter types, sentinels, and unmanaged calling conventions. This is a binary comparison. +1. Hide-by-name-and-signature considers all of the parts of the signature, including custom modifiers, return types, parameter types, sentinels, and unmanaged calling conventions. This is a binary comparison. -2. For reflection, properties and events are hide-by-name-and-signature. If you have a property with both a get and a set accessor in the base class, but the derived class has only a get accessor, the derived class property hides the base class property, and you will not be able to access the setter on the base class. +2. For reflection, properties and events are hide-by-name-and-signature. If you have a property with both a get and a set accessor in the base class, but the derived class has only a get accessor, the derived class property hides the base class property, and you will not be able to access the setter on the base class. -3. Custom attributes are not part of the common type system. +3. Custom attributes are not part of the common type system. If the current represents a constructed generic type, this method returns the with the type parameters replaced by the appropriate type arguments. @@ -5161,11 +5147,11 @@ Members include properties, methods, constructors, fields, events, and nested ty |Nested Type|No|No| |Property|Not applicable|The common type system rule is that the inheritance is the same as that of the methods that implement the property. Reflection treats properties as hide-by-name-and-signature. See note 2 below.| -1. Hide-by-name-and-signature considers all of the parts of the signature, including custom modifiers, return types, parameter types, sentinels, and unmanaged calling conventions. This is a binary comparison. +1. Hide-by-name-and-signature considers all of the parts of the signature, including custom modifiers, return types, parameter types, sentinels, and unmanaged calling conventions. This is a binary comparison. -2. For reflection, properties and events are hide-by-name-and-signature. If you have a property with both a get and a set accessor in the base class, but the derived class has only a get accessor, the derived class property hides the base class property, and you will not be able to access the setter on the base class. +2. For reflection, properties and events are hide-by-name-and-signature. If you have a property with both a get and a set accessor in the base class, but the derived class has only a get accessor, the derived class property hides the base class property, and you will not be able to access the setter on the base class. -3. Custom attributes are not part of the common type system. +3. Custom attributes are not part of the common type system. If the current represents a constructed generic type, this method returns the objects with the type parameters replaced by the appropriate type arguments. @@ -5421,7 +5407,7 @@ This method can be used to find a constructed generic member given a member from ## Remarks The search for `name` is case-sensitive. The search includes public static and public instance methods. - If a method is overloaded and has more than one public method, the method throws an exception. In the following example, an exception is thrown because there is more than one public overload of the method. On the other hand, because the `Person.ToString` method overrides and therefore is not overloaded, the method is able to retrieve the object. + If a method is overloaded and has more than one public method, the method throws an exception. In the following example, an exception is thrown because there is more than one public overload of the method. On the other hand, because the `Person.ToString` method overrides and therefore is not overloaded, the method is able to retrieve the object. :::code language="csharp" source="~/snippets/csharp/System/Type/GetMethod/GetMethodWithOverloads2.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/GetMethod/GetMethodWithOverloads2.fs" id="Snippet3"::: @@ -6448,11 +6434,11 @@ One of the elements in the array is property, for compatibility reasons. You can also load types by creating an object and passing it to an appropriate overload of the method. You can then use the method to load types from the assembly. See also . -|Delimiter|Meaning| -|---------------|-------------| -|Backslash (\\)|Escape character.| -|Backtick (`)|Precedes one or more digits representing the number of type parameters, located at the end of the name of a generic type.| -|Brackets ([])|Enclose a generic type argument list, for a constructed generic type; within a type argument list, enclose an assembly-qualified type.| -|Comma (,)|Precedes the Assembly name.| -|Period (.)|Denotes namespace identifiers.| -|Plus sign (+)|Precedes a nested class.| +| Delimiter | Meaning | +|----------------|--------------------------------| +| Backslash (\\) | Escape character. | +| Backtick (`) | Precedes one or more digits representing the number of type parameters, located at the end of the name of a generic type. | +| Brackets ([]) | Enclose a generic type argument list, for a constructed generic type; within a type argument list, enclose an assembly-qualified type. | +| Comma (,) | Precedes the Assembly name. | +| Period (.) | Denotes namespace identifiers. | +| Plus sign (+) | Precedes a nested class. | For example, the fully qualified name for a class might look like this: @@ -8834,11 +8816,11 @@ Type.GetType("System.Collections.Generic.Dictionary`2[System.String,[MyType,MyAs The following table shows the syntax you use with `GetType` for various types. -|To Get|Use| -|------------|---------| -|A nullable |``Type.GetType("System.Nullable`1[System.Int32]")``| -|An unmanaged pointer to `MyType`|`Type.GetType("MyType*")`| -|An unmanaged pointer to a pointer to `MyType`|`Type.GetType("MyType**")`| +| To Get | Use | +|-----------------------------------------------|-----------------------------------------------------| +| A nullable | ``Type.GetType("System.Nullable`1[System.Int32]")`` | +| An unmanaged pointer to `MyType` | `Type.GetType("MyType*")` | +| An unmanaged pointer to a pointer to `MyType` | `Type.GetType("MyType**")` | |A managed pointer or reference to `MyType`|`Type.GetType("MyType&")`. Note that unlike pointers, references are limited to one level.| |A parent class and a nested class|`Type.GetType("MyParentClass+MyNestedClass")`| |A one-dimensional array with a lower bound of 0|`Type.GetType("MyType[]")`| @@ -8954,30 +8936,26 @@ 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 . +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`. The following table shows what members of a base class are returned by the `Get` methods when reflecting on a type. -|Member Type|Static|Non-Static| -|-----------------|------------|-----------------| -|Constructor|No|No| -|Field|No|Yes. A field is always hide-by-name-and-signature.| +| Member Type | Static | Non-Static | +|-------------|--------|----------------------------------------------------| +| Constructor | No | No | +| Field | No | Yes. A field is always hide-by-name-and-signature. | |Event|Not applicable|The common type system rule is that the inheritance is the same as that of the methods that implement the property. Reflection treats properties as hide-by-name-and-signature. See note 2 below.| |Method|No|Yes. A method (both virtual and non-virtual) can be hide-by-name or hide-by-name-and-signature.| |Nested Type|No|No| |Property|Not applicable|The common type system rule is that the inheritance is the same as that of the methods that implement the property. Reflection treats properties as hide-by-name-and-signature. See note 2 below.| -1. Hide-by-name-and-signature considers all of the parts of the signature, including custom modifiers, return types, parameter types, sentinels, and unmanaged calling conventions. This is a binary comparison. +1. Hide-by-name-and-signature considers all of the parts of the signature, including custom modifiers, return types, parameter types, sentinels, and unmanaged calling conventions. This is a binary comparison. -2. For reflection, properties and events are hide-by-name-and-signature. If you have a property with both a get and a set accessor in the base class, but the derived class has only a get accessor, the derived class property hides the base class property, and you will not be able to access the setter on the base class. +2. For reflection, properties and events are hide-by-name-and-signature. If you have a property with both a get and a set accessor in the base class, but the derived class has only a get accessor, the derived class property hides the base class property, and you will not be able to access the setter on the base class. -3. Custom attributes are not part of the common type system. +3. Custom attributes are not part of the common type system. Arrays or COM types are not searched for unless they have already been loaded into the table of available classes. @@ -9190,30 +9168,26 @@ 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 . +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`. The following table shows what members of a base class are returned by the `Get` methods when reflecting on a type. -|Member Type|Static|Non-Static| -|-----------------|------------|-----------------| -|Constructor|No|No| -|Field|No|Yes. A field is always hide-by-name-and-signature.| -|Event|Not applicable|The common type system rule is that the inheritance is the same as that of the methods that implement the property. Reflection treats properties as hide-by-name-and-signature. See note 2 below.| -|Method|No|Yes. A method (both virtual and non-virtual) can be hide-by-name or hide-by-name-and-signature.| -|Nested Type|No|No| -|Property|Not applicable|The common type system rule is that the inheritance is the same as that of the methods that implement the property. Reflection treats properties as hide-by-name-and-signature. See note 2 below.| +| Member Type | Static | Non-Static | +|-------------|--------|----------------------------------------------------| +| Constructor | No | No | +| Field | No | Yes. A field is always hide-by-name-and-signature. | +| Event | Not applicable | The common type system rule is that the inheritance is the same as that of the methods that implement the property. Reflection treats properties as hide-by-name-and-signature. See note 2 below. | +| Method | No | Yes. A method (both virtual and non-virtual) can be hide-by-name or hide-by-name-and-signature. | +| Nested Type | No | No | +| Property | Not applicable | The common type system rule is that the inheritance is the same as that of the methods that implement the property. Reflection treats properties as hide-by-name-and-signature. See note 2 below. | -1. Hide-by-name-and-signature considers all of the parts of the signature, including custom modifiers, return types, parameter types, sentinels, and unmanaged calling conventions. This is a binary comparison. +1. Hide-by-name-and-signature considers all of the parts of the signature, including custom modifiers, return types, parameter types, sentinels, and unmanaged calling conventions. This is a binary comparison. -2. For reflection, properties and events are hide-by-name-and-signature. If you have a property with both a get and a set accessor in the base class, but the derived class has only a get accessor, the derived class property hides the base class property, and you will not be able to access the setter on the base class. +2. For reflection, properties and events are hide-by-name-and-signature. If you have a property with both a get and a set accessor in the base class, but the derived class has only a get accessor, the derived class property hides the base class property, and you will not be able to access the setter on the base class. -3. Custom attributes are not part of the common type system. +3. Custom attributes are not part of the common type system. Arrays or COM types are not searched for unless they have already been loaded into the table of available classes. @@ -9226,14 +9200,14 @@ Type.GetType("System.Collections.Generic.Dictionary`2[System.String,[MyType,MyAs > [!NOTE] > Processor architecture is part of assembly identity, and can be specified as part of assembly name strings. For example, "ProcessorArchitecture=msil". However, it's not included in the string returned by the property, for compatibility reasons. You can also load types by creating an object and passing it to an appropriate overload of the method. You can then use the method to load types from the assembly. See also . -|Delimiter|Meaning| -|---------------|-------------| -|Backslash (\\)|Escape character.| -|Backtick (`)|Precedes one or more digits representing the number of type parameters, located at the end of the name of a generic type.| -|Brackets ([])|Enclose a generic type argument list, for a constructed generic type; within a type argument list, enclose an assembly-qualified type.| -|Comma (,)|Precedes the Assembly name.| -|Period (.)|Denotes namespace identifiers.| -|Plus sign (+)|Precedes a nested class.| +| Delimiter | Meaning | +|----------------|-------------------| +| Backslash (\\) | Escape character. | +| Backtick (`) | Precedes one or more digits representing the number of type parameters, located at the end of the name of a generic type. | +| Brackets ([]) | Enclose a generic type argument list, for a constructed generic type; within a type argument list, enclose an assembly-qualified type. | +| Comma (,) | Precedes the Assembly name. | +| Period (.) | Denotes namespace identifiers. | +| Plus sign (+) | Precedes a nested class. | For example, the fully qualified name for a class might look like this: @@ -9279,11 +9253,11 @@ Type.GetType("System.Collections.Generic.Dictionary`2[System.String,[MyType,MyAs The following table shows the syntax you use with `GetType` for various types. -|To Get|Use| -|------------|---------| -|A nullable |``Type.GetType("System.Nullable`1[System.Int32]")``| -|An unmanaged pointer to `MyType`|`Type.GetType("MyType*")`| -|An unmanaged pointer to a pointer to `MyType`|`Type.GetType("MyType**")`| +| To Get | Use | +|-----------------------------------------------|-----------------------------------------------------| +| A nullable | ``Type.GetType("System.Nullable`1[System.Int32]")`` | +| An unmanaged pointer to `MyType` | `Type.GetType("MyType*")` | +| An unmanaged pointer to a pointer to `MyType` | `Type.GetType("MyType**")` | |A managed pointer or reference to `MyType`|`Type.GetType("MyType&")`. Note that unlike pointers, references are limited to one level.| |A parent class and a nested class|`Type.GetType("MyParentClass+MyNestedClass")`| |A one-dimensional array with a lower bound of 0|`Type.GetType("MyArray[]")`| @@ -9694,7 +9668,8 @@ Calling this method overload is the same as calling the . + +If `assemblyResolver` is null, then assembly loads triggered by this API are affected by the current value of . For more information about this API, see [Supplemental API remarks for Type.GetType](/dotnet/fundamentals/runtime-libraries/system-type-gettype). ]]> @@ -10000,23 +9975,20 @@ Calling this method overload is the same as calling the method supports late-bound access to unmanaged COM objects from .NET Framework apps when you know the COM object's class identifier (CLSID). The class identifier for COM classes is defined in the HKEY_CLASSES_ROOT\CLSID key of the registry. You can retrieve the value of the property to determine whether the type returned by this method is a COM object. + The method supports late-bound access to unmanaged COM objects from .NET apps when you know the COM object's class identifier (CLSID). The class identifier for COM classes is defined in the HKEY_CLASSES_ROOT\CLSID key of the registry. You can retrieve the value of the property to determine whether the type returned by this method is a COM object. > [!TIP] > You can call the method for late-bound access to COM objects whose programmatic identifier (ProgID) you know. Instantiating an unmanaged COM object from its CLSID is a two-step process: -1. Get a object that represents the`__ComObject` that corresponds to the CLSID by calling the method. - -2. Call the method to instantiate the COM object. +1. Get a object that represents the`__ComObject` that corresponds to the CLSID by calling the method. +2. Call the method to instantiate the COM object. See the example for an illustration. The overload ignores any exception that may occur when instantiating a object based on the `clsid` argument. Note that no exception is thrown if `clsid` is not found in the registry. - - ## Examples The following example uses the CLSID of the Microsoft Word [Application object](/office/vba/api/word.application) to retrieve a COM type that represents the Microsoft Word application. It then instantiates the type by calling the method, and closes it by calling the [Application.Quit](/office/vba/api/word.application.quit(method)) method. @@ -10027,7 +9999,7 @@ Calling this method overload is the same as calling the - This method is intended for use when working with COM objects, not with .NET Framework objects. All managed objects, including those that are visible to COM (that is, their attribute is ) have a GUID that is returned by the property. Although the method returns a object that corresponds to the GUID for .NET Framework objects, you can't use that object to create a type instance by calling the method, as the following example shows. + This method is intended for use when working with COM objects, not with .NET objects. All managed objects, including those that are visible to COM (that is, their attribute is ) have a GUID that is returned by the property. Although the method returns a object that corresponds to the GUID for .NET objects, you can't use that object to create a type instance by calling the method, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System/Type/GetTypeFromCLSID/gettypefromclsid11.cs" id="Snippet11"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/GetTypeFromCLSID/gettypefromclsid11.fs" id="Snippet11"::: @@ -10103,23 +10075,20 @@ Calling this method overload is the same as calling the method supports late-bound access to unmanaged COM objects from .NET Framework apps when you know the COM object's class identifier (CLSID). The class identifier for COM classes is defined in the HKEY_CLASSES_ROOT\CLSID key of the registry. You can retrieve the value of the property to determine whether the type returned by this method is a COM object. + The method supports late-bound access to unmanaged COM objects from .NET apps when you know the COM object's class identifier (CLSID). The class identifier for COM classes is defined in the HKEY_CLASSES_ROOT\CLSID key of the registry. You can retrieve the value of the property to determine whether the type returned by this method is a COM object. > [!TIP] > You can call the method for late-bound access to COM objects whose programmatic identifier (ProgID) you know. Instantiating an unmanaged COM object from its CLSID is a two-step process: -1. Get a object that represents the `__ComObject` that corresponds to the CLSID by calling the method. - -2. Call the method to instantiate the COM object. +1. Get a object that represents the `__ComObject` that corresponds to the CLSID by calling the method. +2. Call the method to instantiate the COM object. See the example for an illustration. Exceptions such as will be thrown when specifying `true` for `throwOnError`, but it will not fail for unregistered CLSIDs. - - ## Examples The following example uses the CLSID of the Microsoft Word [Application object](/office/vba/api/word.application) to retrieve a COM type that represents the Microsoft Word application. It then instantiates the type by calling the method, and closes it by calling the [Application.Quit](/office/vba/api/word.application.quit(method)) method. An exception is thrown if an error occurs while loading the type. @@ -10130,7 +10099,7 @@ Calling this method overload is the same as calling the - This method is intended for use when working with COM objects, not with .NET Framework objects. All managed objects, including those that are visible to COM (that is, their attribute is ) have a GUID that is returned by the property. Although the method returns a object that corresponds to the GUID for .NET Framework objects, you can't use that object to create a type instance by calling the method, as the following example shows. + This method is intended for use when working with COM objects, not with .NET objects. All managed objects, including those that are visible to COM (that is, their attribute is ) have a GUID that is returned by the property. Although the method returns a object that corresponds to the GUID for .NET objects, you can't use that object to create a type instance by calling the method, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System/Type/GetTypeFromCLSID/gettypefromclsid11.cs" id="Snippet11"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/GetTypeFromCLSID/gettypefromclsid11.fs" id="Snippet11"::: @@ -10201,18 +10170,15 @@ Calling this method overload is the same as calling the method supports late-bound access to unmanaged COM objects from .NET Framework apps when you know the COM object's class identifier (CLSID). The class identifier for COM classes is defined in the HKEY_CLASSES_ROOT\CLSID key of the registry. You can retrieve the value of the property to determine whether the type returned by this method is a COM object. + The method supports late-bound access to unmanaged COM objects from .NET apps when you know the COM object's class identifier (CLSID). The class identifier for COM classes is defined in the HKEY_CLASSES_ROOT\CLSID key of the registry. You can retrieve the value of the property to determine whether the type returned by this method is a COM object. > [!TIP] > You can call the method for late-bound access to COM objects whose programmatic identifier (ProgID) you know. Instantiating an unmanaged COM object from its CLSID is a two-step process: -1. Get a object that represents the `__ComObject` that corresponds to the CLSID by calling the method. - -2. Call the method to instantiate the COM object. - - +1. Get a object that represents the `__ComObject` that corresponds to the CLSID by calling the method. +2. Call the method to instantiate the COM object. ## Examples The following example uses the CLSID of the Microsoft Word [Application object](/office/vba/api/word.application) to retrieve a COM type that represents the Microsoft Word application from a server named computer17.central.contoso.com. It then instantiates the type by calling the method, and closes it by calling the [Application.Quit](/office/vba/api/word.application.quit(method)) method. @@ -10224,7 +10190,7 @@ Calling this method overload is the same as calling the - This method is intended for use when working with COM objects, not with .NET Framework objects. All managed objects, including those that are visible to COM (that is, their attribute is ) have a GUID that is returned by the property. Although the method returns a object that corresponds to the GUID for .NET Framework objects, you can't use that object to create a type instance by calling the method, as the following example shows. + This method is intended for use when working with COM objects, not with .NET objects. All managed objects, including those that are visible to COM (that is, their attribute is ) have a GUID that is returned by the property. Although the method returns a object that corresponds to the GUID for .NET objects, you can't use that object to create a type instance by calling the method, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System/Type/GetTypeFromCLSID/gettypefromclsid11.cs" id="Snippet11"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/GetTypeFromCLSID/gettypefromclsid11.fs" id="Snippet11"::: @@ -10302,21 +10268,18 @@ Calling this method overload is the same as calling the method supports late-bound access to unmanaged COM objects from .NET Framework apps when you know the COM object's class identifier (CLSID). The class identifier for COM classes is defined in the HKEY_CLASSES_ROOT\CLSID key of the registry. You can retrieve the value of the property to determine whether the type returned by this method is a COM object. + The method supports late-bound access to unmanaged COM objects from .NET apps when you know the COM object's class identifier (CLSID). The class identifier for COM classes is defined in the HKEY_CLASSES_ROOT\CLSID key of the registry. You can retrieve the value of the property to determine whether the type returned by this method is a COM object. > [!TIP] > You can call the method for late-bound access to COM objects whose programmatic identifier (ProgID) you know. Instantiating an unmanaged COM object from its CLSID is a two-step process: -1. Get a object that represents the `__ComObject` that corresponds to the CLSID by calling the method. - -2. Call the method to instantiate the COM object. +1. Get a object that represents the `__ComObject` that corresponds to the CLSID by calling the method. +2. Call the method to instantiate the COM object. Exceptions such as will be thrown when specifying `true` for `throwOnError`, but it will not fail for unregistered CLSIDs. - - ## Examples The following example uses the CLSID of the Microsoft Word [Application object](/office/vba/api/word.application) to retrieve a COM type that represents the Microsoft Word application from a server named computer17.central.contoso.com. It then instantiates the type by calling the method, and closes it by calling the [Application.Quit](/office/vba/api/word.application.quit(method)) method. An exception is thrown if an error occurs while loading the type. @@ -10327,7 +10290,7 @@ Calling this method overload is the same as calling the - This method is intended for use when working with COM objects, not with .NET Framework objects. All managed objects, including those that are visible to COM (that is, their attribute is ) have a GUID that is returned by the property. Although the method returns a object that corresponds to the GUID for a particular managed object, you can't use that object to create a type instance by calling the method, as the following example shows. + This method is intended for use when working with COM objects, not with .NET objects. All managed objects, including those that are visible to COM (that is, their attribute is ) have a GUID that is returned by the property. Although the method returns a object that corresponds to the GUID for a particular managed object, you can't use that object to create a type instance by calling the method, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System/Type/GetTypeFromCLSID/gettypefromclsid11.cs" id="Snippet11"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/GetTypeFromCLSID/gettypefromclsid11.fs" id="Snippet11"::: @@ -10391,11 +10354,6 @@ Calling this method overload is the same as calling the method to get a object from a provided by the method. @@ -10485,7 +10443,7 @@ Calling this method overload is the same as calling the @@ -10565,9 +10523,7 @@ 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. @@ -11405,11 +11347,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. - ]]> @@ -11648,11 +11585,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. - ]]> @@ -12566,7 +12498,7 @@ Byref-like structures are declared using `ref struct` keyword in C#. An instance @@ -12980,7 +12912,8 @@ 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. + +The common language runtime supports the embedding of type information for COM types directly into managed assemblies, instead of requiring the managed assemblies to obtain type information for COM types from interop assemblies. Because the embedded type information includes only the types and members that are actually used by a managed assembly, two managed assemblies might have very different views of the same COM type. Each managed assembly has a different 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. @@ -14729,25 +14662,21 @@ Byref-like structures are declared using `ref struct` keyword in C#. An instance ## Remarks The , , and properties report the transparency level of the type at its current trust level, as determined by the common language runtime (CLR). The combinations of these properties are shown in the following table: -|Security level|IsSecurityCritical|IsSecuritySafeCritical|IsSecurityTransparent| -|--------------------|------------------------|----------------------------|---------------------------| -|Critical|`true`|`false`|`false`| -|Safe critical|`true`|`true`|`false`| -|Transparent|`false`|`false`|`true`| +| Security level | IsSecurityCritical | IsSecuritySafeCritical | IsSecurityTransparent | +|----------------|--------------------|------------------------|-----------------------| +| Critical | `true` | `false` | `false` | +| Safe critical | `true` | `true` | `false` | +| Transparent | `false` | `false` | `true` | Using these properties is much simpler than examining the security annotations of an assembly and its types, checking the current trust level, and attempting to duplicate the runtime's rules. -> [!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). + For more information about reflection and transparency, see [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection) ]]> Security Considerations for Reflection - Security Changes in the .NET Framework @@ -14794,25 +14723,21 @@ Byref-like structures are declared using `ref struct` keyword in C#. An instance ## Remarks The , , and properties report the transparency level of the type at its current trust level, as determined by the common language runtime (CLR). The combinations of these properties are shown in the following table: -|Security level|IsSecurityCritical|IsSecuritySafeCritical|IsSecurityTransparent| -|--------------------|------------------------|----------------------------|---------------------------| -|Critical|`true`|`false`|`false`| -|Safe critical|`true`|`true`|`false`| -|Transparent|`false`|`false`|`true`| +| Security level | IsSecurityCritical | IsSecuritySafeCritical | IsSecurityTransparent | +|----------------|--------------------|------------------------|-----------------------| +| Critical | `true` | `false` | `false` | +| Safe critical | `true` | `true` | `false` | +| Transparent | `false` | `false` | `true` | Using these properties is much simpler than examining the security annotations of an assembly and its types, checking the current trust level, and attempting to duplicate the runtime's rules. -> [!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). + For more information about reflection and transparency, see [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection). ]]> Security Considerations for Reflection - Security Changes in the .NET Framework @@ -14861,17 +14786,13 @@ Byref-like structures are declared using `ref struct` keyword in C#. An instance The , , and properties report the transparency level of the type at its current trust level, as determined by the common language runtime (CLR). Using these properties is much simpler than examining the security annotations of an assembly and its types, checking the current trust level, and attempting to duplicate the runtime's rules. -> [!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). + For more information about reflection and transparency, see [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection). ]]> Security Considerations for Reflection - Security Changes in the .NET Framework @@ -16679,77 +16600,13 @@ The following example uses the method to cre The assembly-qualified name of the to get. - to throw a if the type cannot be found; to return if the type cannot be found. Specifying also suppresses some other exception conditions, but not all of them. See the Exceptions section. + to throw a if the type cannot be found; to return if the type cannot be found. Specifying also suppresses some other exception conditions, but not all of them. to perform a case-insensitive search for ; to perform a case-sensitive search for . Gets the with the specified name, specifying whether to perform a case-sensitive search and whether to throw an exception if the type is not found. The type is loaded for reflection only, not for execution. - The type with the specified name, if found; otherwise, . If the type is not found, the parameter specifies whether is returned or an exception is thrown. In some cases, an exception is thrown regardless of the value of . See the Exceptions section. - - method is equivalent to first loading the assembly for reflection only, using the method, and then loading the type by calling the assembly's method. For information about assembly-qualified names, see the property. For additional details on specifying type names, see the method overload. - - If the assembly is already loaded for execution, another copy is loaded into the reflection-only context. - - The `throwIfNotFound` 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 `throwIfNotFound`. For example, if the assembly is not valid, a is thrown even if `throwIfNotFound` is `false`. - - For more information about using the reflection-only context, see [How to: Load Assemblies into the Reflection-Only Context](/dotnet/framework/reflection-and-codedom/how-to-load-assemblies-into-the-reflection-only-context). - - ]]> - - - is . - A class initializer is invoked and throws an exception. - - is and the type is not found. - - -or- - - is and contains invalid characters, such as an embedded tab. - - -or- - - is and is an empty string. - - -or- - - is and represents an array type with an invalid size. - - -or- - - represents an array of objects. - - does not include the assembly name. - - -or- - - is and contains invalid syntax; for example, "MyType[,*,]". - - -or- - - represents a generic type that has a pointer type, a type, or as one of its type arguments. - - -or- - - represents a generic type that has an incorrect number of type arguments. - - -or- - - represents a generic type, and one of its type arguments does not satisfy the constraints for the corresponding type parameter. - - is and the assembly or one of its dependencies was not found. - The assembly or one of its dependencies was found, but could not be loaded. - The assembly or one of its dependencies is not a valid assembly for the currently loaded runtime. - .NET Core and .NET 5+ only: In all cases. - - - - - - - Specifying Fully Qualified Type Names - How to: Load Assemblies into the Reflection-Only Context + The type with the specified name, if found; otherwise, . If the type is not found, the parameter specifies whether is returned or an exception is thrown. In some cases, an exception is thrown regardless of the value of . + To be added. + In all cases. @@ -16931,9 +16788,8 @@ The following example uses the method to cre is thrown when a method attempts to cast an object to a type that is not accessible from the method. For example, an anonymously hosted dynamic method cannot access a security-critical type because the method is [transparent](/dotnet/framework/misc/security-transparent-code). If the method contains a instruction that casts an object to a security-critical type, or to a generic type that has a security-critical type as one of its type parameters, is thrown by the JIT compiler. - - Similarly, is thrown for a dynamic method that uses an internal type from another assembly. A method might not have access to its containing type, its return type, or one of its parameter types. - - Apps compiled by using the .NET Native tool chain may throw a [MissingMetadataException](/windows/uwp/dotnet-native/missingmetadataexception-class-net-native) exception at run time. `MissingMetadataException` is an internal-only exception type derived from . The exception indicates that metadata needed for the successful execution of an app is not present at run time. You should not use a `try`/`catch` block to handle the exception. Instead, you should determine what metadata is missing and modify your app's runtime directives file to ensure that it is present at run time. + is thrown when a method attempts to cast an object to a type that is not accessible from the method. For example, is thrown for a dynamic method that uses an internal type from another assembly. A method might not have access to its containing type, its return type, or one of its parameter types. ]]> diff --git a/xml/System/TypedReference.xml b/xml/System/TypedReference.xml index d2ee9c47c1d..8e7dc9778d1 100644 --- a/xml/System/TypedReference.xml +++ b/xml/System/TypedReference.xml @@ -272,11 +272,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/UIntPtr.xml b/xml/System/UIntPtr.xml index c0efd24d0c2..57c03dc09da 100644 --- a/xml/System/UIntPtr.xml +++ b/xml/System/UIntPtr.xml @@ -264,7 +264,7 @@ > [!NOTE] > Using as a pointer or a handle is error prone and unsafe. It is simply an integer type that can be used as an interchange format for pointers and handles due to being the same size. Outside of specific interchange requirements, such as for passing data to a language that doesn't support pointers, a correctly typed pointer should be used to represent pointers and should be used to represent handles. - This type implements the . In .NET 5 and later versions, this type also implements the interfaces. In .NET 7 and later versions, this type also implements the , , and interfaces. + This type implements the and interfaces. In .NET 7 and later versions, this type also implements the , , and interfaces. In C# starting from version 9.0, you can use the built-in `nuint` type to define native-sized integers. This type is represented by the type internally and provides operations and conversions that are appropriate for integer types. For more information, see [nint and nuint types](/dotnet/csharp/language-reference/builtin-types/integral-numeric-types). diff --git a/xml/System/Uri.xml b/xml/System/Uri.xml index 2ae2d3259da..837723a9ca6 100644 --- a/xml/System/Uri.xml +++ b/xml/System/Uri.xml @@ -109,7 +109,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 @@ -1531,47 +1530,6 @@ 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. @@ -1649,9 +1607,6 @@ If you used an escaped string to construct this instance (for example, `"http:// For more information on IRI support, see the Remarks section for the class. -> [!NOTE] -> In the .NET Framework versions 1.0 and 1.1, the is also ignored. - > [!NOTE] > The method can be overridden in a derived class; use caution as a malicious entity could modify the method. You should not use this method to perform security checks unless you know that this instance came from a trusted source. @@ -1859,7 +1814,6 @@ If you used an escaped string to construct this instance (for example, `"http:// is . - .NET Framework only: The length of exceeds 32766 characters. @@ -2016,7 +1970,6 @@ If you used an escaped string to construct this instance (for example, `"http:// is . - .NET Framework only: The length of exceeds 32766 characters. @@ -2676,7 +2629,7 @@ The following examples show a URI and the results of calling for the hostname. - The deprecated property is dependent on *app.config* settings, which cannot be changed by Windows Store applications. IdnHost is provided as the preferred alternative to using , because is guaranteed to always be DNS safe, no matter what the current *app.config* settings might be. +IdnHost is provided as the preferred alternative to using the deprecated property, because is guaranteed to always be DNS safe. If you used an escaped string to construct this instance (for example, `"http://[fe80::200:39ff:fe36:1a2d%254]/temp/example.htm"`), then IdnHost returns an escaped string. You should unescape any escaped string returned from IdnHost before using that string for DNS resolution. Be aware that if you used an invalid unescaped string to construct this instance (for example, "http://[fe80::200:39ff:fe36:1a2d%4]/temp/example.htm"), then IdnHost returns an unescaped string. @@ -5198,9 +5151,7 @@ The following examples show a URI and the results of calling instance and determines whether the scheme is . @@ -5673,9 +5624,6 @@ 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 . diff --git a/xml/System/UriBuilder.xml b/xml/System/UriBuilder.xml index ef91e2420bf..39c104ca7a4 100644 --- a/xml/System/UriBuilder.xml +++ b/xml/System/UriBuilder.xml @@ -693,13 +693,7 @@ ## Remarks -The property contains any text following a fragment marker (#) in the URI, including the marker itself. When setting the property: - -- In .NET Framework, the fragment marker is always prepended to the string, even if one is already present. -- In .NET 5 (and .NET Core) and later versions, the fragment marker is prepended to the string if it's not already present. - -> [!NOTE] -> To append a value to an existing fragment in .NET Framework, you must remove the leading fragment marker before setting the property with the new value. This is because .NET Framework always prepends the fragment marker when setting the property. .NET 5 (and .NET Core) and later versions are tolerant to a leading fragment marker, and will only prepend one if necessary. +The property contains any text following a fragment marker (#) in the URI, including the marker itself. When setting the property, the fragment marker is prepended to the string if it's not already present. ## Examples The following example creates the URI `"http://www.contoso.com/index.htm#main"`. @@ -1040,16 +1034,10 @@ The property contains any text following a fra ## Remarks -The property contains any query information included in the URI. Query information is separated from the path information by a question mark (?) and continues to the end of the URI. The query information that's returned includes the leading question mark. When setting the property: - -- In .NET Framework, a question mark is always prepended to the string, even if the string already starts with a question mark. -- In .NET 5 (and .NET Core) and later versions, a question mark is prepended to the string if it's not already present. +The property contains any query information included in the URI. Query information is separated from the path information by a question mark (?) and continues to the end of the URI. The query information that's returned includes the leading question mark. When setting the property, a question mark is prepended to the string if it's not already present. The query information is escaped according to RFC 2396. -> [!NOTE] -> To append a value to existing query information in .NET Framework, you must remove the leading question mark before setting the property with the new value. This is because .NET Framework always prepends the question mark when setting the property. .NET 5 (and .NET Core) and later versions are tolerant to a leading question mark, and will only prepend one if necessary. - ## Examples The following example sets the property. diff --git a/xml/System/ValueType.xml b/xml/System/ValueType.xml index dfc2f09b220..b35243d5a24 100644 --- a/xml/System/ValueType.xml +++ b/xml/System/ValueType.xml @@ -65,7 +65,7 @@ Although is the implicit base class for value types, you cannot create a class that inherits from directly. Instead, individual compilers provide a language keyword or construct (such as `struct` in C# and `Structure`…`End Structure` in Visual Basic) to support the creation of value types. - Aside from serving as the base class for value types in the .NET Framework, the structure is generally not used directly in code. However, it can be used as a parameter in method calls to restrict possible arguments to value types instead of all objects, or to permit a method to handle a number of different value types. The following example illustrates how prevents reference types from being passed to methods. It defines a class named `Utility` that contains four methods: `IsNumeric`, which indicates whether its argument is a number; `IsInteger`, which indicates whether its argument is an integer; `IsFloat`, which indicates whether its argument is a floating-point number; and `Compare`, which indicates the relationship between two numeric values. In each case, the method parameters are of type , and reference types are prevented from being passed to the methods. + Aside from serving as the base class for value types in .NET, the structure is generally not used directly in code. However, it can be used as a parameter in method calls to restrict possible arguments to value types instead of all objects, or to permit a method to handle a number of different value types. The following example illustrates how prevents reference types from being passed to methods. It defines a class named `Utility` that contains four methods: `IsNumeric`, which indicates whether its argument is a number; `IsInteger`, which indicates whether its argument is an integer; `IsFloat`, which indicates whether its argument is a floating-point number; and `Compare`, which indicates the relationship between two numeric values. In each case, the method parameters are of type , and reference types are prevented from being passed to the methods. :::code language="csharp" source="~/snippets/csharp/System/ValueType/Overview/example1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/ValueType/Overview/example1.fs" id="Snippet1"::: diff --git a/xml/System/Version.xml b/xml/System/Version.xml index 02ead3547cc..138e0cfaa80 100644 --- a/xml/System/Version.xml +++ b/xml/System/Version.xml @@ -1027,10 +1027,6 @@ The following example uses the ## Remarks Suppose you release an interim version of your application to temporarily correct a problem until you can release a permanent solution. The temporary version does not warrant a new revision number, but it does need to be identified as a different version. In this case, encode the identification information in the high and low 16-bit portions of the 32-bit revision number. Use the property to obtain the entire revision number, use the property to obtain the high 16 bits, and use the property to obtain the low 16 bits. - Starting in the .NET Framework version 2.0, the Windows NT operating system uses the property to encode the service pack number. - - - ## Examples The following code example demonstrates the constructor, and the , , , , , and properties. @@ -1432,7 +1428,6 @@ The following example uses the ]]> - .NET Framework only: is . @@ -1488,7 +1483,6 @@ The following example uses the ]]> - .NET Framework only: is . From 64c7f6b05eaeec02438b6072855bf356db98cc75 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Fri, 29 May 2026 15:14:42 -0700 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- xml/System/AppDomain.xml | 2 +- xml/System/ArgumentNullException.xml | 2 +- xml/System/Array.xml | 2 +- xml/System/IFormattable.xml | 2 +- xml/System/Uri.xml | 1 - 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/xml/System/AppDomain.xml b/xml/System/AppDomain.xml index 42aa011c9de..34bda1e4285 100644 --- a/xml/System/AppDomain.xml +++ b/xml/System/AppDomain.xml @@ -3339,7 +3339,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. - in call cases. + in all cases. To be added. diff --git a/xml/System/ArgumentNullException.xml b/xml/System/ArgumentNullException.xml index 2480e27a16d..d9adc2b9475 100644 --- a/xml/System/ArgumentNullException.xml +++ b/xml/System/ArgumentNullException.xml @@ -199,7 +199,7 @@ | Property | Value | |-----------------------------------------|-----------------------------------------------| | | A null reference (`Nothing` in Visual Basic). | -| | A localized error message string that identifies the null argument. For example, if the `paramName` argument is "arg1", the English language message string is `Value cannot be null. (Parameter name: 'arg1') | + || | A localized error message string that identifies the null argument. For example, if the `paramName` argument is "arg1", the English language message string is `Value cannot be null. (Parameter name: 'arg1')`. | | | The parameter name string. | ]]> diff --git a/xml/System/Array.xml b/xml/System/Array.xml index 1f0c88a5769..bdec11df88a 100644 --- a/xml/System/Array.xml +++ b/xml/System/Array.xml @@ -91,7 +91,7 @@ Unlike the classes in the namespaces, has a fixed capacity. To increase the capacity, you must create a new object with the required capacity, copy the elements from the old object to the new one, and delete the old . - 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).ent) configuration element to `true` in the run-time environment. + | 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). 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 . diff --git a/xml/System/IFormattable.xml b/xml/System/IFormattable.xml index 220fa61654e..474df6da7a6 100644 --- a/xml/System/IFormattable.xml +++ b/xml/System/IFormattable.xml @@ -177,7 +177,7 @@ > [!NOTE] > An object's implementation is called by composite formatting methods only if they are not passed an format provider, or if the method of the custom format provider returns `null`. - The .NET includes three format providers, all of which implement the interface: + 180 | .NET includes three format providers, all of which implement the interface: - supplies numeric formatting information, such as the characters to use for decimal and group separators, and the spelling and placement of currency symbols in monetary values. - supplies date-related and time-related formatting information, such as the position of the month, the day, and the year in a date pattern. diff --git a/xml/System/Uri.xml b/xml/System/Uri.xml index 837723a9ca6..dcd4428aa3d 100644 --- a/xml/System/Uri.xml +++ b/xml/System/Uri.xml @@ -5151,7 +5151,6 @@ IdnHost is provided as the preferred alternative to using the deprecated instance and determines whether the scheme is . From 388148ce0e18beb6ec7ea9d035686b77d3a9b923 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Fri, 29 May 2026 15:20:57 -0700 Subject: [PATCH 3/3] remove conflict markers --- xml/System/Random.xml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/xml/System/Random.xml b/xml/System/Random.xml index 908f60e7a63..77b637a8d19 100644 --- a/xml/System/Random.xml +++ b/xml/System/Random.xml @@ -159,18 +159,6 @@ The default seed value is produced by the thread-static, pseudo-random number ge Once you've instantiated the random number generator, you call individual methods, such as or , to generate random numbers. -<<<<<<< HEAD -======= - - -## 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. - - :::code language="csharp" source="~/snippets/csharp/System/Random/.ctor/ctor1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System/Random/.ctor/ctor1.vb" id="Snippet2"::: - ->>>>>>> a616b87eb03a89aa522fa6635e20af8ab7093d32 ]]>