Repository navigation
[browser] fix MetadataUpdaterSupport default value - #127163
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the ILLink MSBuild targets to avoid forcing MetadataUpdaterSupport=false for trimmed Debug builds, aligning the default behavior with browser (WASM) debug scenarios where metadata update support is expected to remain available.
Changes:
- Change the defaulting rule for
MetadataUpdaterSupportunderPublishTrimmed=trueto only set it tofalsewhen$(Configuration) != Debug.
|
@lewing this may need merge into preview4 branch if we missed the train already |
|
@pavelsavara Can we port to .NET 10 servicing? |
|
Actually, we should delete this line entirely. ILLink targets should not be setting this property at all. It's already set in the SDK. https://github.com/dotnet/sdk/blob/main/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets#L157 |
There are many other linker features that it sets. If would be good to keep it in the same place. But I don't have any preference. Maybe just that SDK is not versioned, which makes runtime a better place. cc @maraf |
Also that ILLink line only sets the value if the value is empty. If SDK did it right, it would not be empty. Why is it empty ? |
|
Empty means default, which is "true". |
|
The new condition makes setting of the property redundant in ILLink. The SDK is essentially setting the defaults: false for non-Debug configuration, unchanged for Debug. ILLink (runtime) can further limit the support if needed. But it doesn't have to set false for non-Debug configuration because that's already the default. |
Warn when project configuration disables Hot Reload in `dotnet watch`, matching the checks that VS uses in [dotnet-project-system PR 738329](https://devdiv.visualstudio.com/DevDiv/_git/dotnet-project-system/pullrequest/738329). ### Background Previously, `dotnet watch` only checked `StartupHookSupport` (and `PublishAot`/`PublishTrimmed` which imply it). It did not warn when the runtime's `MetadataUpdater.IsSupported` would be `false`, leading to confusing behavior — e.g. running `dotnet watch` in a non-Debug configuration would silently fail to apply Hot Reload updates. ### Changes **TFM >= .NET 11** — check `MetadataUpdaterSupport`. This property is now [correctly set by the runtime](dotnet/runtime#127163) starting in .NET 11. **TFM < .NET 11** — check `Optimize == false` and `DebugSymbols == true`, since `MetadataUpdaterSupport` was not reliably set for older frameworks. This matches what VS does. ### Files changed - **`Versions.cs`** — Added `Version11_0` constant - **`BuildNames.cs`** — Added `MetadataUpdaterSupport`, `Optimize`, `DebugSymbols` constants - **`HotReloadAppModel.cs`** — Added TFM-gated checks with link to runtime PR - **`SourceFileUpdateTests.HotReloadNotSupported.cs`** — Replaced `MetadataUpdaterSupport=False` test case with `Optimize=True` (test TFM is `net10.0`, so the `< 11` path is exercised) Co-authored-by: Copilot <[email protected]>
Fixes dotnet/aspnetcore#66325