-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Blazor: Generic attributes do not work in Mono #77047
Comments
Does anybody have a temporary workaround for me? |
Is there a testcase which would allow us to reproduce the problem ? |
I tried some stuff and it took me a while to reproduce the problem. Apparently the exception only gets triggered when using the generic attribute on a struct. Steps to reproduce:
Note: If you change 'struct' to 'class' the application works just fine. |
Please can anyone give an update on this? Generic attributes are released together with C# 11 (which is released today) right? So this would be a big bug. |
Thank you for your fix! I am looking forward to it. |
The call stack (as mentioned in #78255 ) is:
|
I'd be keen on trying to fix this myself but I'd need a fair amount of guidance as a I literally haven't got a clue where to start nor what the workflow would look like! |
They already made a fix, see the pull request above. |
* [mono] Fix support for generic custom attributes. Fixes #77047. * Reenable tests.
As this bug still exist: is there a way to work around this issue? For example by using preprocessor directives which exclude the attribute from being included in the DLL? |
@SteveDunn do you maybe know a workaround? |
@Code-Chops - sorry, I don't have a workaround. But if the fix has been merged in, I would guess that it'll be in the next release, which should be due very shortly (7.0.200 or whatever it'll be). @vargaz could probably confirm..? |
Right now, the fix is only on the main branch, it couldn't be backported right now as it causes some perf regressions: |
Is there an existing issue for this?
Describe the bug
At the moment I am running a C# 10 .NET 6 Blazor Webassembly app with EnablePreviewFeatures so I can use generic attributes. Unfortunately when running the app, I get the following error:
dotnet..w98fhuowzh.js:1430 * Assertion: should not be reached at /__w/1/s/src/mono/mono/metadata/custom-attrs.c:2433
which leads to this code in the Mono repository: https://github.com/mono/mono/blob/main/mono/metadata/custom-attrs.c#L2451
Apparently generic attributes are not supported at the moment in Mono. And even won't be supported in .NET 7, here is the issue: #56887
I have the following questions:
Expected Behavior
The Mono runtime can handle generic attributes.
Steps To Reproduce
I don't know how I can reproduce this problem as it happens in the Mono runtime and not on the IL-level.
Exceptions (if any)
.NET Version
6.0.402
Anything else?
No response
The text was updated successfully, but these errors were encountered: