dotnet / dotnet/roslyn

EventHandlerTagHelperDescriptorProvider throws InvalidOprationException in dotnet-watch unit test environment

Open
#85,554 3 comments 0 reactions 0 assignees View on GitHub
Area-Razor Area-Razor-Compiler
Dominant language
C#
Stars
20.7k
Forks
4.3k
PR merge metrics
PR metrics pending

Description

When `EventHandlerAttribute` is not decoded as expected the source generator throws an exception.

See https://github.com/dotnet/razor/blob/main/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/CSharp/EventHandlerTagHelperDescriptorProvider.cs#L60

The exception message does not include details about which type caused the failure making it hard to find out what's wrong.

The ask is to:
1) Update Razor source generator to include information in the exception message that pinpoints the problematic type.
2) Insert updated Razor to .NET SDK repo and enable commented out code in dotnet-watch test `ApplyDeltaTests.BlazorWasm`.
3) Run the test, determine the root cause of the failure and address it.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.