Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion build/RunTestsOnHelix.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ dotnet new --debug:ephemeral-hive
REM We downloaded a special zip of files to the .nuget folder so add that as a source

Copilot AI Feb 6, 2026

Copy link

Choose a reason for hiding this comment

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

This comment is now misleading: it says a special zip was downloaded to %DOTNET_ROOT%\.nuget and should be added as a source, but the command that added that source was removed. Please update the comment to match the current behavior (or re-add the source if it’s still required).

Suggested change
REM We downloaded a special zip of files to the .nuget folder so add that as a source
REM List current NuGet sources and, if test packages are present, add them as a local source

Copilot uses AI. Check for mistakes.
dotnet nuget list source --configfile %TestExecutionDirectory%\nuget.config
PowerShell -ExecutionPolicy ByPass "dotnet nuget locals all -l | ForEach-Object { $_.Split(' ')[1]} | Where-Object{$_ -like '*cache'} | Get-ChildItem -Recurse -File -Filter '*.dat' | Measure"
dotnet nuget add source %DOTNET_ROOT%\.nuget --configfile %TestExecutionDirectory%\nuget.config
if exist %TestExecutionDirectory%\Testpackages dotnet nuget add source %TestExecutionDirectory%\Testpackages --name testpackages --configfile %TestExecutionDirectory%\nuget.config

dotnet nuget remove source dotnet6-transport --configfile %TestExecutionDirectory%\nuget.config
Expand Down
1 change: 0 additions & 1 deletion build/RunTestsOnHelix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ dotnet new --debug:ephemeral-hive

# We downloaded a special zip of files to the .nuget folder so add that as a source

Copilot AI Feb 6, 2026

Copy link

Choose a reason for hiding this comment

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

This comment is now misleading: the script says the special zip was downloaded to $DOTNET_ROOT/.nuget and should be added as a source, but the command that added that source was removed. Please update the comment to match the current behavior (or re-add the source if it’s still required).

Suggested change
# We downloaded a special zip of files to the .nuget folder so add that as a source
# Add the local test packages directory as a NuGet source for this test run

Copilot uses AI. Check for mistakes.
dotnet nuget list source --configfile $TestExecutionDirectory/NuGet.config
dotnet nuget add source $DOTNET_ROOT/.nuget --configfile $TestExecutionDirectory/NuGet.config
dotnet nuget add source $TestExecutionDirectory/Testpackages --configfile $TestExecutionDirectory/NuGet.config
#Remove feeds not needed for tests
dotnet nuget remove source dotnet6-transport --configfile $TestExecutionDirectory/NuGet.config
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>$(SdkTargetFramework)</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<GenerateDependencyFile>false</GenerateDependencyFile>
<LangVersion>preview</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

<!-- NuGet -->
<IsPackable>true</IsPackable>
<IsShipping>true</IsShipping>
<IsShippingPackage>true</IsShippingPackage>
<PackageId>Microsoft.DotNet.HotReload.WebAssembly.Browser</PackageId>
<Description>HotReload package for WebAssembly</Description>
<!-- Remove once https://github.com/NuGet/Home/issues/8583 is fixed -->
<NoWarn>$(NoWarn);NU5128</NoWarn>
</PropertyGroup>

<Import Project="..\HotReloadAgent\Microsoft.DotNet.HotReload.Agent.projitems" Label="Shared" />
<Import Project="..\HotReloadAgent.Data\Microsoft.DotNet.HotReload.Agent.Data.projitems" Label="Shared" />

<ItemGroup>
<Content Include="wwwroot\**\*.*" CopyToOutputDirectory="PreserveNewest" />
<InternalsVisibleTo Include="DynamicProxyGenAssembly2" Key="$(MoqPublicKey)" />
</ItemGroup>

</Project>
51 changes: 47 additions & 4 deletions src/WasmSdk/Sdk/Sdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,58 @@ Copyright (c) .NET Foundation. All rights reserved.
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.targets" Condition="'$(RuntimeIdentifier)' == 'wasi-wasm' and '$(_WasmSdkImportsMicrosoftNetSdk)' == 'true'" />

<PropertyGroup>
<!-- Implicit HotReload package reference for .NET 10+ if not explicitly turned off -->
<_WasmEnableHotReload>$(WasmEnableHotReload)</_WasmEnableHotReload>
<_WasmEnableHotReload Condition="'$(_WasmEnableHotReload)' == '' and '$(Configuration)' != 'Debug'">false</_WasmEnableHotReload>
<_WasmEnableHotReload Condition="'$(_WasmEnableHotReload)' == '' and '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $([MSBuild]::VersionGreaterThanOrEquals('$(TargetFrameworkVersion)', '10.0'))">true</_WasmEnableHotReload>
</PropertyGroup>
<Target Name="_ImplicitlyReferenceHotReload" BeforeTargets="ProcessFrameworkReferences">
<ItemGroup Condition="'$(_WasmEnableHotReload)' == 'true'">
<PackageReference Include="Microsoft.DotNet.HotReload.WebAssembly.Browser" Version="$(NETCoreSdkVersion)" IsImplicitlyDefined="true" />
<Target Name="_WasmImplicitlyReferenceHotReload" BeforeTargets="ResolveProjectStaticWebAssets" AfterTargets="ResolveStaticWebAssetsConfiguration" Condition="'$(_WasmEnableHotReload)' == 'true'">
<PropertyGroup>
<_WasmHotReloadTfm Condition="$([MSBuild]::VersionGreaterThanOrEquals('$(TargetFrameworkVersion)', '10.0'))">net10.0</_WasmHotReloadTfm>
<_WasmHotReloadPath Condition="'$(_WasmHotReloadTfm)' != ''">$([MSBuild]::NormalizeDirectory($(MSBuildThisFileDirectory), '..', 'hotreload', $(_WasmHotReloadTfm)))</_WasmHotReloadPath>
<_WasmHotReloadIntermediatePath>$(IntermediateOutputPath)hotreload\</_WasmHotReloadIntermediatePath>
</PropertyGroup>

<!-- Copy the JS module to intermediate folder to avoid duplicate identity when multiple projects reference the same SDK file -->
<Copy
SourceFiles="$(_WasmHotReloadPath)wwwroot\Microsoft.DotNet.HotReload.WebAssembly.Browser.lib.module.js"
DestinationFolder="$(_WasmHotReloadIntermediatePath)"
SkipUnchangedFiles="true"
Condition="'$(_WasmHotReloadPath)' != ''" />

<ItemGroup Condition="'$(_WasmHotReloadPath)' != ''">
<ReferenceCopyLocalPaths Include="$(_WasmHotReloadPath)Microsoft.DotNet.HotReload.WebAssembly.Browser.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
</ReferenceCopyLocalPaths>
<_WasmHotReloadModule Include="$(_WasmHotReloadIntermediatePath)Microsoft.DotNet.HotReload.WebAssembly.Browser.lib.module.js">
<RelativePath>_framework/Microsoft.DotNet.HotReload.WebAssembly.Browser.lib.module.js</RelativePath>
</_WasmHotReloadModule>
<_WasmHotReloadModule OriginalItemSpec="%(Identity)" />

Copilot AI Feb 6, 2026

Copy link

Choose a reason for hiding this comment

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

<_WasmHotReloadModule OriginalItemSpec="%(Identity)" /> is an MSBuild item element without Include/Update/Remove, which will error during evaluation (and it also won’t set OriginalItemSpec on the item created above). Use Update to set the metadata on the existing @(_WasmHotReloadModule) item(s) instead of declaring a new, empty item element.

Suggested change
</_WasmHotReloadModule>
<_WasmHotReloadModule OriginalItemSpec="%(Identity)" />
<OriginalItemSpec>%(Identity)</OriginalItemSpec>
</_WasmHotReloadModule>

Copilot uses AI. Check for mistakes.
<FileWrites Include="$(_WasmHotReloadIntermediatePath)Microsoft.DotNet.HotReload.WebAssembly.Browser.lib.module.js" />
</ItemGroup>

<DefineStaticWebAssets
CandidateAssets="@(_WasmHotReloadModule)"
FingerprintCandidates="$(StaticWebAssetsFingerprintContent)"
FingerprintPatterns="@(StaticWebAssetFingerprintPattern)"
SourceId="$(PackageId)"
SourceType="Computed"
ContentRoot="$(_WasmHotReloadIntermediatePath)"
BasePath="$(StaticWebAssetBasePath)"
AssetKind="Build"
AssetTraitName="JSModule"
AssetTraitValue="JSLibraryModule"
PropertyOverrides="AssetTraitName;AssetTraitValue"
Condition="'$(_WasmHotReloadPath)' != ''">
<Output TaskParameter="Assets" ItemName="StaticWebAsset" />
<Output TaskParameter="Assets" ItemName="_WasmHotReloadModuleStaticWebAsset" />
</DefineStaticWebAssets>
<DefineStaticWebAssetEndpoints
CandidateAssets="@(_WasmHotReloadModuleStaticWebAsset)"
ContentTypeMappings="@(StaticWebAssetContentTypeMapping)"
Condition="'$(_WasmHotReloadPath)' != ''">
<Output TaskParameter="Endpoints" ItemName="StaticWebAssetEndpoint" />
</DefineStaticWebAssetEndpoints>
</Target>

<Import Sdk="Microsoft.NET.Sdk.Publish" Project="Sdk.targets" Condition="'$(_WasmSdkImportsMicrosoftNETSdkPublish)' == 'true'" />
Expand Down
11 changes: 10 additions & 1 deletion src/WasmSdk/Tasks/Microsoft.NET.Sdk.WebAssembly.Tasks.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project>
<Project>

<PropertyGroup>
<WasmSdkRoot>$(RepoRoot)\src\WasmSdk\</WasmSdkRoot>
Expand Down Expand Up @@ -39,6 +39,11 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\BuiltInTools\HotReloadAgent.WebAssembly.Browser\Microsoft.DotNet.HotReload.WebAssembly.Browser.csproj">
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<UndefineProperties>TargetFramework;TargetFrameworks</UndefineProperties>
</ProjectReference>
<AdditionalContent Include="$(WasmSdkRoot)targets\**\*.*">
<Pack>true</Pack>
<PackagePath>targets</PackagePath>
Expand All @@ -47,6 +52,10 @@
<Pack>true</Pack>
<PackagePath>Sdk</PackagePath>
</AdditionalContent>
<AdditionalContent Include="$(ArtifactsBinDir)\Microsoft.DotNet.HotReload.WebAssembly.Browser\$(Configuration)\**\*.*">
<Pack>true</Pack>
<PackagePath>hotreload</PackagePath>
</AdditionalContent>
</ItemGroup>

<Target Name="PrepareAdditionalFilesToLayout" BeforeTargets="AssignTargetPaths">
Expand Down
Loading
Loading