-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Assemblies with generic attributes applied to their assembly cannot be referenced #6734
Comments
davidwrighton
added
bug
needs-triage
Have yet to determine what bucket this goes in.
labels
Aug 4, 2021
I've put together the above PR, but as I was unable to validate it, I'm not sure what the next steps here are. |
davidwrighton
added a commit
to davidwrighton/runtime
that referenced
this issue
Aug 5, 2021
- Generic attributes need to force the actual exact method to be loaded not just the canonical scenario - GenericAttribute testing had been disabled due to dotnet/msbuild#6734 - Move GenericAttribute test project to Pri0 as its the only generic custom attribute runtime testing that will occur before .NET 6.0 ships
benvillalobos
removed
the
needs-triage
Have yet to determine what bucket this goes in.
label
Aug 5, 2021
davidwrighton
added a commit
to dotnet/runtime
that referenced
this issue
Aug 5, 2021
* Fix CustomAttributeData in the presence of generic attributes - Generic attributes need to force the actual exact method to be loaded not just the canonical scenario - GenericAttribute testing had been disabled due to dotnet/msbuild#6734 - Move GenericAttribute test project to Pri0 as its the only generic custom attribute runtime testing that will occur before .NET 6.0 ships - Test disabled on Mono as Mono currently doesn't support this feature. Fixes #56492
25 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue Description
With the new C# feature Generic Attributes (dotnet/roslyn#55190) assemblies can be produced which cannot be referenced via standard msbuild references.
Steps to Reproduce
Using the not yet available C# compiler from Roslyn build a binary with an assembly level attribute which is generic, or sync the dotnet/runtime testbed as of 8/4/2021 and build test src/tests/reflection/GenericAttribute/GenericAttributeTests.csproj (I am about to checkin a change which will workaround the issue)
Note, I was unable to figure out how trigger this failure outside of the runtime build environment, and I was unsuccessful at building a standalone repro using a pre-built IL component.
Expected Behavior
Application builds successfully.
Actual Behavior
Build fails with the following stack trace.
Analysis
The CorePopulateMetadata function assumes that the parent of a custom attribute on an assembly is a TypeReference. This is not a reliable assumption if the type is generic.
Versions & Configurations
I can find evidence that this failure has been in the product for some years, but it hadn't been surfaced to the msbuild team until I tried to fix issue dotnet/runtime#56492
The text was updated successfully, but these errors were encountered: