[Blazor] Update router attribute to be explicitly passed as a boolean #28285
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
We introduced a public property as part of #27907 to enable users to opt-in. Turns out that this caused issues since we didn't update the target pack.
As a result, the Razor compiler treats this new property as a regular HTML attribute (of type string) instead of as a boolean.
In turn this causes the template to error at runtime when the application starts.
Customer Impact
Customers using 5.0.1 won't be able to create and run new blazor apps out of the box. They can fix the template code by preceding the
true
value in the attribute with@
to force the compiler to interpret it as C#. (Which is the same fix we are applying).Regression?
Yes, 5.0.0. Users were able to create new blazor templates without this issue.
Risk
Low. We've manually validated the fix against a new project from a 5.0.1 template.