Remove .NET Framework remarks (System.Reflection)#12654
Open
gewarren wants to merge 1 commit into
Open
Conversation
Contributor
|
@gewarren - This PR edits one or more files whose 'source of truth' for documentation is not in this repo. Please make documentation updates in the /// comments in the dotnet/runtime repo (or dotnet/extensions repo) instead. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the .NET API reference XML for System.Reflection (and related Reflection.Emit/Context/Metadata areas) to remove or soften .NET Framework-specific guidance (for example, app domains, CAS/partial trust notes, and framework-version conditionals) now that .NET Framework reference docs live in a separate repo.
Changes:
- Removes/rewrites remarks that were explicitly tied to .NET Framework versions, Windows Store app subsets, app domains, and partial-trust/CAS scenarios.
- Normalizes some wording to be framework-agnostic (for example, “.NET and COM”), and trims outdated framework-conditional exceptions.
- Adds expanded conceptual remarks + an example for
System.Reflection.Context.CustomReflectionContext.
Reviewed changes
Copilot reviewed 32 out of 32 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| xml/System.Reflection/TypeInfo.xml | Removes Windows Store/.NET Framework-specific remarks; keeps core TypeInfo guidance. |
| xml/System.Reflection/TypeDelegator.xml | Updates wording to remove “.NET Framework” branding and tweaks formatting. |
| xml/System.Reflection/TypeAttributes.xml | Removes “.NET Framework” phrasing in enum field summaries. |
| xml/System.Reflection/StrongNameKeyPair.xml | Removes framework/CAS-specific exceptions and normalizes PNSE wording. |
| xml/System.Reflection/PropertyInfo.xml | Removes some .NET Framework-version-specific statements and reformats remarks. |
| xml/System.Reflection/Module.xml | Removes .NET Framework-specific clarification about modules. |
| xml/System.Reflection/MethodImplAttributes.xml | Reformats remarks and removes framework-version availability note. |
| xml/System.Reflection/MethodBase.xml | Removes app-domain/CAS-specific narrative and normalizes remarks formatting. |
| xml/System.Reflection/MemberInfo.xml | Replaces a “more info” remark with a related link entry. |
| xml/System.Reflection/IReflect.xml | Removes .NET Framework COM interop explanation from remarks. |
| xml/System.Reflection/FieldInfo.xml | Removes app-domain and partial-trust details; reformats security transparency tables. |
| xml/System.Reflection/ConstructorInfo.xml | Removes .NET Framework-only note about generic constructors and trims CAS targeting guidance. |
| xml/System.Reflection/AssemblySignatureKeyAttribute.xml | Rewrites remarks to remove explicit .NET Framework version history and reflows markdown. |
| xml/System.Reflection/AssemblyNameFlags.xml | Removes “.NET Framework infrastructure” phrasing. |
| xml/System.Reflection/AssemblyName.xml | Removes .NET Framework version history and removes examples/remarks for unsupported members. |
| xml/System.Reflection/Assembly.xml | Removes/shortens framework-conditional remarks, exceptions, and load-context guidance. |
| xml/System.Reflection.Metadata.Ecma335/MetadataBuilder.xml | Removes framework-conditional note about saving dynamic assemblies. |
| xml/System.Reflection.Emit/TypeBuilder.xml | Removes .NET Framework version-history notes and trims security/transparency references. |
| xml/System.Reflection.Emit/SignatureHelper.xml | Removes “introduced in .NET Framework 3.5” note. |
| xml/System.Reflection.Emit/PropertyBuilder.xml | Removes .NET Framework 4-specific wording from default-value remarks. |
| xml/System.Reflection.Emit/ParameterBuilder.xml | Removes .NET Framework 4-specific wording from default-value remarks. |
| xml/System.Reflection.Emit/ModuleBuilder.xml | Removes .NET Framework version-history notes and updates exception text. |
| xml/System.Reflection.Emit/MethodBuilder.xml | Removes .NET Framework 1.x behavior note. |
| xml/System.Reflection.Emit/ILGenerator.xml | Removes partial-trust phrasing from remarks. |
| xml/System.Reflection.Emit/FieldBuilder.xml | Removes .NET Framework 4-specific wording from default-value remarks. |
| xml/System.Reflection.Emit/EnumBuilder.xml | Removes .NET Framework version-history remarks and keeps the example content. |
| xml/System.Reflection.Emit/DynamicMethod.xml | Removes partial-trust framing and .NET Framework-version conditionals. |
| xml/System.Reflection.Emit/ConstructorBuilder.xml | Removes .NET Framework version-specific exception behavior notes. |
| xml/System.Reflection.Emit/AssemblyBuilderAccess.xml | Removes detailed .NET Framework vs .NET field list from remarks and links to overview doc. |
| xml/System.Reflection.Emit/AssemblyBuilder.xml | Removes framework-conditional wording; keeps single-module guidance and unloadability link. |
| xml/System.Reflection.Context/CustomReflectionContext.xml | Replaces external “supplemental remarks” link with inlined, expanded remarks and a snippet reference. |
| ## Remarks | ||
|
|
||
| In .NET Core/5+, the target assembly is loaded into the current <xref:System.Runtime.Loader.AssemblyLoadContext>. For more information on assembly loading, see [Managed assembly loading algorithm](/dotnet/core/dependency-loading/loading-managed#algorithm"). | ||
| The target assembly is loaded into the current <xref:System.Runtime.Loader.AssemblyLoadContext>. For more information on assembly loading, see [Managed assembly loading algorithm](/dotnet/core/dependency-loading/loading-managed#algorithm"). |
|
|
||
| ]]></format> | ||
| </remarks> | ||
| <remarks>To be added.</remarks> |
|
|
||
| ]]></format> | ||
| </remarks> | ||
| <remarks>To be added.</remarks> |
Comment on lines
1419
to
1422
|
|
||
| > [!NOTE] | ||
| > This method can be used to access non-public members if the caller has been granted <xref:System.Security.Permissions.ReflectionPermission> with the <xref:System.Security.Permissions.ReflectionPermissionFlag.RestrictedMemberAccess?displayProperty=nameWithType> 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. | ||
| > This method can be used to access non-public members if the caller has been granted <xref:System.Security.Permissions.ReflectionPermission> with the <xref:System.Security.Permissions.ReflectionPermissionFlag.RestrictedMemberAccess?displayProperty=nameWithType> 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).) | ||
|
|
Comment on lines
975
to
978
|
|
||
| > [!NOTE] | ||
| > This method can be used to access non-public members if the caller has been granted <xref:System.Security.Permissions.ReflectionPermission> with the <xref:System.Security.Permissions.ReflectionPermissionFlag.RestrictedMemberAccess?displayProperty=nameWithType> 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. | ||
| > This method can be used to access non-public members if the caller has been granted <xref:System.Security.Permissions.ReflectionPermission> with the <xref:System.Security.Permissions.ReflectionPermissionFlag.RestrictedMemberAccess?displayProperty=nameWithType> 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).) | ||
|
|
Comment on lines
+2457
to
2458
| This method is transparent. | ||
|
|
Comment on lines
+59
to
+63
| ## Examples | ||
| The following example demonstrates how to subclass <xref:System.Reflection.Context.CustomReflectionContext> to add a custom attribute to all the members of a given type whose names begin with "To". To run this code, paste it into an empty console project, and make sure to include a reference to System.Reflection.Context.dll. | ||
|
|
||
| :::code language="csharp" source="~/snippets/csharp/System.Reflection.Context/CustomReflectionContext/Overview/program.cs" id="Snippet1"::: | ||
|
|
| <Docs> | ||
| <summary>Defines the access modes for a dynamic assembly.</summary> | ||
| <remarks>This enumeration defines only two fields (<see cref="F:System.Reflection.Emit.AssemblyBuilderAccess.Run" /> and <see cref="F:System.Reflection.Emit.AssemblyBuilderAccess.RunAndCollect" />) in .NET. In .NET Framework, it defines an additional three fields (<see cref="F:System.Reflection.Emit.AssemblyBuilderAccess.ReflectionOnly" />, <see cref="F:System.Reflection.Emit.AssemblyBuilderAccess.RunAndSave" />, and <see cref="F:System.Reflection.Emit.AssemblyBuilderAccess.Save" />). For more information, see <see href="/dotnet/fundamentals/runtime-libraries/system-reflection-emit-assemblybuilder">AssemblyBuilder class remarks</see>.</remarks> | ||
| <remarks>For more information about this class, see <see href="/dotnet/fundamentals/runtime-libraries/system-reflection-emit-assemblybuilder">AssemblyBuilder class remarks</see>.</remarks> |
Comment on lines
2061
to
2064
|
|
||
| - The number of parameters in the method declaration equals the number of arguments in the specified argument list (unless default arguments are defined on the member). | ||
|
|
||
| - The type of each arguments can be converted by the binder to the type of the parameter. | ||
|
|
| > A <xref:System.Reflection.Context.CustomReflectionContext> object alters the attributes returned by a particular reflection object, such as those obtained by the <xref:System.Reflection.MemberInfo.GetCustomAttributes*> method. It does not alter the custom attribute data returned by the <xref:System.Reflection.MemberInfo.GetCustomAttributesData*> method, and these two lists will not match when you use a custom reflection context. | ||
|
|
||
| ## Examples | ||
| The following example demonstrates how to subclass <xref:System.Reflection.Context.CustomReflectionContext> to add a custom attribute to all the members of a given type whose names begin with "To". To run this code, paste it into an empty console project, and make sure to include a reference to System.Reflection.Context.dll. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
.NET Framework API ref has moved to its own repo (https://github.com/dotnet/dotnetfw-api-docs), so we can clean up .NET Framework remarks, exceptions, and code examples out of this repo. Contributes to #12513.
Removes remarks and examples related to:
Also remarks all remarks from obsolete APIs.
Hide whitespace changes