-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Blazor] Treat RuntimeIdentifiers
as local property
#50487
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] Treat RuntimeIdentifiers
as local property
#50487
Conversation
This PR is targeting |
Thanks for your PR, @@maraf. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR extends the BlazorWebAssembly SDK to treat RuntimeIdentifiers
as a local property, similar to how RuntimeIdentifier
is already handled. This ensures that Blazor WebAssembly projects consistently target only the browser-wasm
runtime, preventing external settings from overriding this requirement.
Key changes:
- Add
RuntimeIdentifiers
to theTreatAsLocalProperty
attribute - Set
RuntimeIdentifiers
property to use the localRuntimeIdentifier
value
<PropertyGroup> | ||
<OutputType>exe</OutputType> | ||
|
||
<RuntimeIdentifier>browser-wasm</RuntimeIdentifier> | ||
<RuntimeIdentifiers>$(RuntimeIdentifier)</RuntimeIdentifiers> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure if we should just unset the property entirely or set it to $(RuntimeIdentifier)
here. Did you try it both ways? Were there any behavioral differences?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would set this explicitly to browser-wasm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my testing I didn't find a difference
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a vague recollection of some issue when both RuntimeIdentifiers and RuntimeIdentifier were set but I can't find any details anymore. Maybe it was just when they disagreed.
It would be good to have a test validating the scenario from dotnet/runtime#110624. |
Extend "TreatAsLocalProperty" to
RuntimeIdentifiers
, the same way as we do forRuntimeIdentifier
.Projects using BlazorWebAssembly SDK are meant to target
browser-wasm
only.Contributes to dotnet/runtime#110624