Repository navigation
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
When a generic attribute is applied in a hosted Blazor Web Assembly project, debugging is broken.
Reproduction is here: https://github.com/zbecknell/UndebuggableV2
Notice Index.razor is applying @attribute [Bad<App>]. Remove that line and debugging now works.
Clues as to how to fix this would hopefully be found in this old previous issue dotnet/aspnetcore#25380 where the same thing would happen when an attribute had an enum parameter.
Expected Behavior
Debugging the client web assembly application hits breakpoints as expected.
Steps To Reproduce
Run and attempt to debug the client side of this hosted web assembly app: https://github.com/zbecknell/UndebuggableV2
Exceptions (if any)
The console outputs this when failure occurs:
[13:14:55] fail: DevToolsProxy[0]
Failed to load https://localhost:7129/_framework/DebugTest.Client.dll (Specified cast is not valid.)
.NET Version
7.0.302
Anything else?
System info (though this is reproduced across OSs):
.NET SDK:
Version: 7.0.302
Commit: 990cf98a27
Runtime Environment:
OS Name: Mac OS X
OS Version: 13.3
OS Platform: Darwin
RID: osx.13-arm64
Base Path: /usr/local/share/dotnet/sdk/7.0.302/
Host:
Version: 7.0.5
Architecture: arm64
Commit: 8042d61b17
.NET SDKs installed:
7.0.100 [/usr/local/share/dotnet/sdk]
7.0.200 [/usr/local/share/dotnet/sdk]
7.0.203 [/usr/local/share/dotnet/sdk]
7.0.302 [/usr/local/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 7.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 7.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Other architectures found:
None
Environment variables:
Not set
global.json file:
Not found
Activity
lewing commentedon May 25, 2023
@lambdageek
are there any known mono issues lurking here?lambdageek commentedon May 25, 2023
@lewing yea we had some issue with generic custom attributes. Don't recall if it was resolved. The debugger is an interesting twist - I didn't know it looks at custom attributes.
lewing commentedon May 25, 2023
It walks them for debugger hints. @ilonatommy it looks like there is at least one places in DebugStore where it makes assumptions about the attribute metadata and casts without a guard, can you take a look.
lambdageek commentedon May 25, 2023
@lewing @ilonatommy The runtime issue that I was thinking of was resolved already. This works with both Mono and CoreCLR:
Output:
ilonatommy commentedon May 26, 2023
Could you, please give the link to the issue? I cannot find it and I just checked the above code pasted into hosted WASM to the Client and result is as described:
edit: actually not that important, found the problem.
zbecknell commentedon May 26, 2023
Thank you everyone for fixing this so quickly!