Warn when MetadataUpdaterSupport is false in dotnet watch#54264
Warn when MetadataUpdaterSupport is false in dotnet watch#54264jonathanpeppers wants to merge 1 commit into
Conversation
4721673 to
46550c8
Compare
Add the same hot reload support check for MetadataUpdaterSupport that already exists for StartupHookSupport. When MetadataUpdaterSupport is false (e.g. Release configuration), dotnet watch now warns that the project does not support Hot Reload and suggests setting the property to True. Also adds a test case for MetadataUpdaterSupport=False alongside the existing StartupHookSupport test. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
46550c8 to
e990aac
Compare
|
Note that when |
There was a problem hiding this comment.
Actually, the fix dotnet/runtime#127163 only targets .NET 11 runtime. Instead of checking MetadataUpdaterSupport we might need to check Optimize and DebugType properties like VS does.
|
Could a project set What made me look at this, is this issue: It made me wonder if hot reload works for a |
|
Yes, MetadataUpdaterSupport can be set by project. I think what we need to do is: VS currently does the latter. I'll change it to check the same condition as watch. |
Add the same hot reload support check for
MetadataUpdaterSupportthat already exists forStartupHookSupport. WhenMetadataUpdaterSupportisfalse(e.g. non-Debug configurations), dotnet watch now warns that the project does not support Hot Reload and suggests setting the property toTrue.Changes
BuildNames.cs— AddedMetadataUpdaterSupportconstantHotReloadAppModel.cs— Added a check: ifMetadataUpdaterSupportisfalse, logsProjectDoesNotSupportHotReload_Propertywarning and returnsfalse. Includes a link to the CoreCLRMetadataUpdater.cssource.SourceFileUpdateTests.HotReloadNotSupported.cs— Added[InlineData("MetadataUpdaterSupport", "False")]test case