From 20eb01cee0ae4e628c4eea79828452e5ae0612f3 Mon Sep 17 00:00:00 2001 From: Eduardo Velarde <32459232+eduardo-vp@users.noreply.github.com> Date: Fri, 15 Aug 2025 10:20:40 -0700 Subject: [PATCH 1/4] Update SemaphoreSlim TimeSpan milliseconds limit (#11677) --- xml/System.Threading/SemaphoreSlim.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xml/System.Threading/SemaphoreSlim.xml b/xml/System.Threading/SemaphoreSlim.xml index 76112dc2704..a1b0f8b7a9c 100644 --- a/xml/System.Threading/SemaphoreSlim.xml +++ b/xml/System.Threading/SemaphoreSlim.xml @@ -826,7 +826,7 @@ If a thread or task is blocked when calling is greater than Int32.MaxValue. +In .NET 9 and earlier versions, is greater than Int32.MaxValue. The semaphoreSlim instance has been disposed. Semaphore and SemaphoreSlim @@ -988,9 +988,9 @@ If `cancellationToken` is cancelled, the method throws an is a negative number other than -1, which represents an infinite timeout. --or-. +-or- - is greater than Int32.MaxValue. +In .NET 9 and earlier versions, is greater than Int32.MaxValue. The semaphoreSlim instance has been disposed. -or- @@ -1225,7 +1225,7 @@ The that created is greater than Int32.MaxValue. +In .NET 9 and earlier versions, is greater than Int32.MaxValue. @@ -1356,7 +1356,7 @@ The that created is greater than Int32.MaxValue. +In .NET 9 and earlier versions, is greater than Int32.MaxValue. was canceled. The has been disposed. From b6b66b56b99dc820c393c9153029d3619ea1f360 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Fri, 15 Aug 2025 18:23:24 +0100 Subject: [PATCH 2/4] Use `nint` for native-sized integers in `Interlocked` (#11643) --- xml/System.Threading/Interlocked.xml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/xml/System.Threading/Interlocked.xml b/xml/System.Threading/Interlocked.xml index 564e4065953..bd14b540549 100644 --- a/xml/System.Threading/Interlocked.xml +++ b/xml/System.Threading/Interlocked.xml @@ -858,10 +858,10 @@ - The destination , whose value is compared with the value of and possibly replaced by . - The that replaces the destination value if the comparison results in equality. - The that is compared to the value at . - Compares two platform-specific handles or pointers for equality and, if they are equal, replaces the first one, as an atomic operation. + The destination, whose value is compared with the value of and possibly replaced by . + The value that replaces the destination value if the comparison results in equality. + The value that is compared to the value at . + Compares two native-sized signed integers for equality and, if they are equal, replaces the first one, as an atomic operation. The original value in . - The destination , whose value is compared with the value of and possibly replaced by . - The that replaces the destination value if the comparison results in equality. - The that is compared to the value at . - Compares two platform-specific handles or pointers for equality and, if they are equal, replaces the first one, as an atomic operation. + The destination, whose value is compared with the value of and possibly replaced by . + The value that replaces the destination value if the comparison results in equality. + The value that is compared to the value at . + Compares two native-sized unsigned integers for equality and, if they are equal, replaces the first one, as an atomic operation. The original value in . To be added. The address of is a pointer. @@ -1919,7 +1919,7 @@ If `comparand` and the value in `location1` are equal by reference, then `value` The variable to set to the specified value. The value to which the parameter is set. - Sets a platform-specific handle or pointer to a specified value and returns the original value, as an atomic operation. + Sets a native-sized signed integer to a specified value and returns the original value, as an atomic operation. The original value of . To be added. The address of is a pointer. @@ -2274,7 +2274,7 @@ If `comparand` and the value in `location1` are equal by reference, then `value` The variable to set to the specified value. The value to which the parameter is set. - Sets a platform-specific handle or pointer to a specified value and returns the original value, as an atomic operation. + Sets a native-sized unsigned integer to a specified value and returns the original value, as an atomic operation. The original value of . To be added. The address of is a pointer. From 6b70ef7084bb1c49bae12d2d518efe91f9a5e976 Mon Sep 17 00:00:00 2001 From: David Wrighton Date: Fri, 15 Aug 2025 12:07:30 -0700 Subject: [PATCH 3/4] Add documentation to the various reflection apis which directly interact with CurrentContextualReflectionContext (#11687) --- .../AssemblyBuilder.xml | 6 ++-- xml/System.Reflection/Assembly.xml | 12 ++++++-- xml/System/Activator.xml | 6 ++++ xml/System/Type.xml | 28 ++++++++++++++----- 4 files changed, 40 insertions(+), 12 deletions(-) diff --git a/xml/System.Reflection.Emit/AssemblyBuilder.xml b/xml/System.Reflection.Emit/AssemblyBuilder.xml index 1da51f68ab2..2cd9b40b713 100644 --- a/xml/System.Reflection.Emit/AssemblyBuilder.xml +++ b/xml/System.Reflection.Emit/AssemblyBuilder.xml @@ -442,7 +442,7 @@ The following code example shows how to define and use a dynamic assembly. The e The access rights of the assembly. Defines a dynamic assembly that has the specified name and access rights. An object that represents the new assembly. - To be added. + .NET 6+ only: If the property is null, then the assembly is created in the of the function that calls DefineDynamicAssembly. Otherwise, it's created with the specified in . @@ -505,9 +505,9 @@ The following code example shows how to define and use a dynamic assembly. The e The name of the assembly. The access rights of the assembly. A collection that contains the attributes of the assembly. - Defines a new assembly that has the specified name, access rights, and attributes. + Defines a dynamic assembly that has the specified name, access rights, and attributes. An object that represents the new assembly. - To be added. + .NET 6+ only: If the property is null, then the assembly is created in the of the function that calls DefineDynamicAssembly. Otherwise, it's created with the specified in . diff --git a/xml/System.Reflection/Assembly.xml b/xml/System.Reflection/Assembly.xml index 25e7071cfd7..3c7efbac93b 100644 --- a/xml/System.Reflection/Assembly.xml +++ b/xml/System.Reflection/Assembly.xml @@ -3241,6 +3241,8 @@ Note: In .NET for Win ## Remarks This method only searches the current assembly instance. The `name` parameter includes the namespace but not the assembly. To search other assemblies for a type, use the method overload, which can optionally include an assembly display name as part of the type name. + In .NET Core/.NET 5+, if there are assembly-qualified generic type parameters in the type name string, those assembly references will be loaded by the of the method that called Assembly.GetType, or by the context if it's set. + > [!NOTE] > If the type has been forwarded to another assembly, it is still returned by this method. For information on type forwarding, see [Type Forwarding in the Common Language Runtime](/dotnet/standard/assembly/type-forwarding). @@ -3345,6 +3347,8 @@ Note: In .NET for Win ## Remarks This method only searches the current assembly instance. The `name` parameter includes the namespace but not the assembly. To search other assemblies for a type, use the method overload, which can optionally include an assembly display name as part of the type name. + In .NET Core/.NET 5+, if there are assembly-qualified generic type parameters in the type name string, those assembly references will be loaded by the of the method that called Assembly.GetType, or by the context if it's set. + > [!NOTE] > If the type has been forwarded to another assembly, it is still returned by this method. For information on type forwarding, see [Type Forwarding in the Common Language Runtime](/dotnet/standard/assembly/type-forwarding). @@ -3450,6 +3454,8 @@ Note: In .NET for Win ## Remarks This method only searches the current assembly instance. The `name` parameter includes the namespace but not the assembly. To search other assemblies for a type, use the method overload, which can optionally include an assembly display name as part of the type name. + In .NET Core/.NET 5+, if there are assembly-qualified generic type parameters in the type name string, those assembly references will be loaded by the of the method that called Assembly.GetType, or by the context if it's set. + > [!NOTE] > If the type has been forwarded to another assembly, it is still returned by this method. For information on type forwarding, see [Type Forwarding in the Common Language Runtime](/dotnet/standard/assembly/type-forwarding). @@ -4097,7 +4103,7 @@ This property is marked obsolete starting in .NET 5, and generates a compile-tim ## Remarks -In .NET Core/.NET 5+, the target assembly will be loaded into the current . For more information on assembly loading, see [Managed assembly loading algorithm](/dotnet/core/dependency-loading/loading-managed#algorithm"). + In .NET Core/.NET 5+, the target assembly will be loaded into the current or into the context if it's set. For more information on assembly loading, see [Managed assembly loading algorithm](/dotnet/core/dependency-loading/loading-managed#algorithm). > [!NOTE] > **.NET Framework only:** For information about loading assemblies from remote locations, see [``](/dotnet/framework/configure-apps/file-schema/runtime/loadfromremotesources-element). @@ -4191,7 +4197,7 @@ Note: In .NET for Win ## Remarks -In .NET Core/5+, the target assembly is loaded into the current . For more information on assembly loading, see [Managed assembly loading algorithm](/dotnet/core/dependency-loading/loading-managed#algorithm"). + In .NET Core/.NET 5+, the target assembly will be loaded into the current or into the context if it's set. For more information on assembly loading, see [Managed assembly loading algorithm](/dotnet/core/dependency-loading/loading-managed#algorithm). To load the correct assembly, it's recommended to call the `Load` method by passing the long form of the assembly name. The long form of an assembly name consists of its simple name (such as "System" for the System.dll assembly) along with its version, culture, public key token, and optionally its processor architecture. It corresponds to the assembly's property. The following example illustrates the use of a long name to load the System.dll assembly for .NET Framework 4: @@ -5571,6 +5577,8 @@ The assembly is loaded into the default AssemblyLoadContext. For more informatio Applications that load assemblies with this method will be affected by upgrades of those assemblies. Therefore, do not use this method; redesign the application to use the method overload or the method overload. + In .NET Core/5+, the target assembly is loaded into the current or the if it's set. + This method first calls . If the assembly is not found, this method returns the assembly from the global assembly cache that has the same simple name, and the highest version number. ]]> diff --git a/xml/System/Activator.xml b/xml/System/Activator.xml index 21ac5a3d008..7f714692cce 100644 --- a/xml/System/Activator.xml +++ b/xml/System/Activator.xml @@ -574,6 +574,8 @@ Note: In .NET for Win 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. @@ -1018,6 +1020,8 @@ Note: In .NET for Win ## 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 . + > [!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. @@ -1493,6 +1497,8 @@ 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 . + > [!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/Type.xml b/xml/System/Type.xml index 15373d20539..e09aa681d65 100644 --- a/xml/System/Type.xml +++ b/xml/System/Type.xml @@ -9036,9 +9036,11 @@ You can use the method to obtain a [!NOTE] > If `typeName` cannot be found, the call to the method returns `null`. It does not throw an exception. To control whether an exception is thrown, call an overload of the method that has a `throwOnError` parameter. - 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`. + .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. - To use `GetType` on a dynamic module, subscribe to the event and call `GetType` before saving. Otherwise, you will get two copies of the assembly in memory. + On .NET Core 3.0 and later versions, assembly loads triggered by this API are affected by the current value of . The following table shows what members of a base class are returned by the `Get` methods when reflecting on a type. @@ -9244,9 +9246,11 @@ Note: In .NET for Win ## 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. - `GetType` only works on assemblies loaded from disk. If you call `GetType` 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`. + .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. - To use `GetType` on a dynamic module, subscribe to the event and call `GetType` before saving. Otherwise, you will get two copies of the assembly in memory. + On .NET Core 3.0 and later versions, assembly loads triggered by this API are affected by the current value of . The `throwOnError` parameter specifies what happens when the type is not found, and also suppresses certain other exception conditions, as described in the Exceptions section. Some exceptions are thrown regardless of the value of `throwOnError`. For example, if the type is found but cannot be loaded, a is thrown even if `throwOnError` is `false`. @@ -9479,9 +9483,11 @@ Note: In .NET for Win ## 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. - `GetType` only works on assemblies loaded from disk. If you call `GetType` 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`. + .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. - To use `GetType` on a dynamic module, subscribe to the event and call `GetType` before saving. Otherwise, you will get two copies of the assembly in memory. + On .NET Core 3.0 and later versions, assembly loads triggered by this API are affected by the current value of . The `throwOnError` parameter specifies what happens when the type is not found, and also suppresses certain other exception conditions, as described in the Exceptions section. Some exceptions are thrown regardless of the value of `throwOnError`. For example, if the type is found but cannot be loaded, a is thrown even if `throwOnError` is `false`. @@ -9974,7 +9980,15 @@ Calling this method overload is the same as calling the to perform a case-insensitive search for , to perform a case-sensitive search for . Gets the type with the specified name, specifying whether to perform a case-sensitive search and whether to throw an exception if the type is not found, and optionally providing custom methods to resolve the assembly and the type. The type with the specified name. 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. - For more information about this API, see Supplemental API remarks for Type.GetType. + + . + + For more information about this API, see [Supplemental API remarks for Type.GetType](/dotnet/fundamentals/runtime-libraries/system-type-gettype). + ]]> + is . A class initializer is invoked and throws an exception. From a640c04b669a835df6d3dc2981bc04d121dce265 Mon Sep 17 00:00:00 2001 From: Eric Mutta Date: Sat, 16 Aug 2025 00:15:39 +0300 Subject: [PATCH 4/4] Fix typo in ZipArchiveEntry.xml (#11685) --- xml/System.IO.Compression/ZipArchiveEntry.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xml/System.IO.Compression/ZipArchiveEntry.xml b/xml/System.IO.Compression/ZipArchiveEntry.xml index ceac7bd0260..b94d089d3ab 100644 --- a/xml/System.IO.Compression/ZipArchiveEntry.xml +++ b/xml/System.IO.Compression/ZipArchiveEntry.xml @@ -409,7 +409,7 @@ If the comment byte length is larger than , it will -or- The archive mode is set to and the entry has been opened. - An attempt was made to set this property to a value that is either earlier than 1980 January 1 0:00:00 (midnight) or later than 2107 December 31 23:59:58 (one second before midnight). + An attempt was made to set this property to a value that is either earlier than 1980 January 1 0:00:00 (midnight) or later than 2107 December 31 23:59:58 (two seconds before midnight).