Skip to content

Conversation

@maraf
Copy link
Member

@maraf maraf commented Jan 28, 2026

Replace a PackageReference with content shipped inside of the SDK.
It requires to manually reference the dll and define a StaticWebAsset for JSInitializer.

Fixes #49877
Fixes #52686
Fixes dotnet/aspnetcore#65261

@maraf maraf self-assigned this Jan 28, 2026
@maraf maraf changed the title Embed HotReload in WebAssembly SDK [wasm] Embed HotReload in WebAssembly SDK Jan 29, 2026
<Target Name="_ImplicitlyReferenceHotReload" BeforeTargets="ResolveProjectStaticWebAssets" AfterTargets="ResolveStaticWebAssetsConfiguration" Condition="'$(_WasmEnableHotReload)' == 'true'">
<PropertyGroup>
<_WasmHotReloadRoot>$([MSBuild]::NormalizeDirectory($(MSBuildThisFileDirectory), '..', 'hotreload'))</_WasmHotReloadRoot>
<_WasmHotReloadDllPath Condition="$([MSBuild]::VersionGreaterThanOrEquals('$(TargetFrameworkVersion)', '10.0'))">net10.0</_WasmHotReloadDllPath>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tmat Do you prefer to multi-target the dll or pin it to .NET 10?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's pin to .NET 10 until we need runtime features that need higher version. It's simpler and reduces SDK size.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, let's target release/10.0.3xx branch instead of main.

<!-- NuGet -->
<IsPackable>true</IsPackable>
<IsShipping>true</IsShipping>
<IsShippingPackage>true</IsShippingPackage>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lines 14-17 shouldn't needed anymore.

@@ -47,6 +47,14 @@
<Pack>true</Pack>
<PackagePath>Sdk</PackagePath>
</AdditionalContent>
<AdditionalContent Include="$(ArtifactsBinDir)\Microsoft.DotNet.HotReload.WebAssembly.Browser\$(Configuration)\**\*.*">
Copy link
Member

@tmat tmat Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this come from a project reference? Otherwise, the build graph is not going to have the dependency edge and build may fail depending on the order in which the projects are built.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

3 participants