Skip to content

Allow @rendermode and @typeparam to coexist in basic scenarios#12590

Closed
davidwengier wants to merge 4 commits intodotnet:mainfrom
davidwengier:RenderModeWithTypeParam
Closed

Allow @rendermode and @typeparam to coexist in basic scenarios#12590
davidwengier wants to merge 4 commits intodotnet:mainfrom
davidwengier:RenderModeWithTypeParam

Conversation

@davidwengier
Copy link
Member

Fixes #9683

This doesn't fix the issue in all scenarios, due to limitations of C# (not allowing open generics in attribute names, for example), but the specific cases where this doesn't work, the workaround of defining your own attribute and using [attribute: ...] also doesn't work, so I think this is a net positive and unblocks the common case for users.

@davidwengier davidwengier requested a review from a team as a code owner December 12, 2025 05:13
["7.0"] = Version_7_0,
["8.0"] = Version_8_0,
["9.0"] = Version_9_0,
["10.0"] = Version_10_0,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feature needs to be tied to .NET 11 in order to not break CI builds, we just have to decide what Razor lang version that is. .NET 10 shipped with RazorLangVersion 9, sadly, and it's not clear to me if its too late to change that so everything lines up nicely:
https://github.com/dotnet/sdk/blob/main/src/RazorSdk/Targets/Sdk.Razor.CurrentVersion.targets#L57

@davidwengier
Copy link
Member Author

Superseded by #12591

@davidwengier davidwengier deleted the RenderModeWithTypeParam branch December 12, 2025 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Known Issue] Specifying a @rendermode fails when a component uses @typeparam

1 participant