Skip to content

Commit

Permalink
fix(hr): Disable partial reload on compatible targets
Browse files Browse the repository at this point in the history
  • Loading branch information
dr1rrb committed Dec 11, 2024
1 parent 72e4c9e commit fa79ea7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public class RemoteControlGenerator : ISourceGenerator
"SolutionName",
"VSIDEResolvedNonMSBuildProjectOutputs",
"DevEnvDir",
"MSBuildVersion",
};

public void Initialize(GeneratorInitializationContext context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ private void InitializePartialReload()
var unoRuntimeIdentifier = GetMSBuildProperty("UnoRuntimeIdentifier");
var targetFramework = GetMSBuildProperty("TargetFramework");
var buildingInsideVisualStudio = GetMSBuildProperty("BuildingInsideVisualStudio");
var msBuildVersion = GetMSBuildProperty("MSBuildVersion");

_supportsPartialHotReload =
buildingInsideVisualStudio.Equals("true", StringComparison.OrdinalIgnoreCase)
&& _forcedHotReloadMode is null or HotReloadMode.Partial
&& (Version.TryParse(msBuildVersion, out var v) is false || v is not { Major: >= 17, Minor: >= 12 })
&& (
// As of VS 17.8, when the debugger is attached, mobile targets don't invoke MetadataUpdateHandlers
// and both targets are not providing updated types. We simulate parts of this process
Expand Down

0 comments on commit fa79ea7

Please sign in to comment.