-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add RequiresAssemblyFiles attribute #56196
Conversation
This PR annotates every API doc'd as having different behavior in single-file publishing with RequiresAssemblyFiles. Some APIs might be special-cased by the analyzer to produce special messages, but RAF is useful for visual inspection of the APIs. Module.Name and .FullyQualifiedName were also unannotated.
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
...ction.MetadataLoadContext/src/System/Reflection/TypeLoading/Assemblies/RoAssembly.Modules.cs
Outdated
Show resolved
Hide resolved
@buyaa-n This PR is assigned to you for follow-up before the RC1 snap. |
@buyaa-n anything else? |
src/mono/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left two minor comments, overall LGTM
@buyaa-n If you wouldn't mind taking another look, I found some more missing annotations, and an inconsistency in casing that I've tried to fix up. @VSadov @vitek-karas for change in casing in runtime. In theory this could be a breaking change for people upgrading from .NET 5 to .NET 6 but I think the inconsistent casing meant it was impossible for them to rely on specific behavior in this situation anyway. I'd rather settle on one casing for .NET 6. |
src/libraries/System.Reflection.Emit/ref/System.Reflection.Emit.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Reflection.Emit/ref/System.Reflection.Emit.cs
Outdated
Show resolved
Hide resolved
.../System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/Modules/RoModule.cs
Outdated
Show resolved
Hide resolved
.../System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/Modules/RoModule.cs
Outdated
Show resolved
Hide resolved
src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs
Outdated
Show resolved
Hide resolved
I believe that the runtime reflection APIs have been consistently returning uppercase |
This reverts commit 283bd36.
Co-authored-by: Buyaa Namnan <buyankhishig.namnan@microsoft.com>
The current casing is `<unknown>` but the casing used in the runtime is `<Unknown>`.
OK, I think this is finally up-to-date. I ended up finding a questionable behavior in single-file for |
@buyaa-n Anything else? I think the one tricky bit I've filed an issue for, so we can come back to it later. I took Jan's advice and changed the casing of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One NIT comment, overall LGTM
This PR annotates every API doc'd as having different
behavior in single-file publishing with RequiresAssemblyFiles.
Some APIs might be special-cased by the analyzer to produce
special messages, but RAF is useful for visual inspection
of the APIs. Module.Name and .FullyQualifiedName were also
unannotated.
Docs: https://docs.microsoft.com/en-us/dotnet/core/deploying/single-file
Assembly.Location | Returns an empty string.
Module.FullyQualifiedName | Returns a string with the value of
<Unknown>
or throws an exception.Module.Name | Returns a string with the value of
<Unknown>
.Assembly.GetFile | Throws IOException.
Assembly.GetFiles | Throws IOException.
Assembly.CodeBase | Throws PlatformNotSupportedException.
Assembly.EscapedCodeBase | Throws PlatformNotSupportedException.
AssemblyName.CodeBase | Returns null.
AssemblyName.EscapedCodeBase | Returns null.