<!--
***********************************************************************************************
Microsoft.NET.Sdk.WebAssembly.targets

WARNING:  DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
          created a backup copy.  Incorrect changes to this file will make it
          impossible to load or build your projects from the command-line or the IDE.

Copyright (c) .NET Foundation. All rights reserved.
***********************************************************************************************
-->
<Project ToolsVersion="14.0">

  <PropertyGroup>
    <_UseBlazorDevServer>$(RunArguments.Contains('blazor-devserver.dll').ToString().ToLower())</_UseBlazorDevServer>
  </PropertyGroup>
  <PropertyGroup Condition="'$(_WebAssemblyUserRunParameters)' == '' and '$(_UseBlazorDevServer)' == 'false'">
    <RunCommand Condition="'$(DOTNET_HOST_PATH)' != '' and Exists($(DOTNET_HOST_PATH))">$(DOTNET_HOST_PATH)</RunCommand>
    <RunCommand Condition="'$(RunCommand)' == ''">dotnet</RunCommand>

    <WasmAppHostDir>$([MSBuild]::NormalizeDirectory($(MSBuildThisFileDirectory), '..', 'WasmAppHost'))</WasmAppHostDir>

    <_RunWorkingDirectory>$(OutputPath)</_RunWorkingDirectory>
    <_RunWorkingDirectory Condition="'$(_RunWorkingDirectory)' != '' and !$([System.IO.Path]::IsPathRooted($(_RunWorkingDirectory)))">$([System.IO.Path]::Combine($(MSBuildProjectDirectory), $(_RunWorkingDirectory)))</_RunWorkingDirectory>
    <_RuntimeConfigJsonPath>$([MSBuild]::NormalizePath($(_RunWorkingDirectory), '$(AssemblyName).runtimeconfig.json'))</_RuntimeConfigJsonPath>

    <RunArguments>exec &quot;$([MSBuild]::NormalizePath($(WasmAppHostDir), 'WasmAppHost.dll'))&quot; --use-staticwebassets --runtime-config &quot;$(_RuntimeConfigJsonPath)&quot; $(WasmHostArguments)</RunArguments>
    <RunWorkingDirectory>$(_RunWorkingDirectory)</RunWorkingDirectory>
  </PropertyGroup>

  <PropertyGroup>
    <EnableDefaultContentItems Condition=" '$(EnableDefaultContentItems)' == '' ">true</EnableDefaultContentItems>

    <!-- Trimmer defaults that depend on user-definable settings.
        This must be configured before it's initialized in the .NET SDK targets (which are imported by the Razor SDK). -->
    <SuppressTrimAnalysisWarnings Condition="'$(SuppressTrimAnalysisWarnings)' == '' And '$(TrimmerDefaultAction)' != 'link'">true</SuppressTrimAnalysisWarnings>
  </PropertyGroup>

  <!--
    Targets supporting Razor MSBuild integration. Contain support for generating C# code using Razor
    and including the generated code in the project lifecycle, including compiling, publishing and producing
    nuget packages.
  -->

  <PropertyGroup>
    <!-- Paths to tools, tasks, and extensions are calculated relative to the WebAssemblySdkDirectoryRoot. This can be modified to test a local build. -->
    <WebAssemblySdkDirectoryRoot Condition="'$(WebAssemblySdkDirectoryRoot)'==''">$(MSBuildThisFileDirectory)..\</WebAssemblySdkDirectoryRoot>
    <_WebAssemblySdkTasksTFM Condition=" '$(MSBuildRuntimeType)' == 'Core'">net9.0</_WebAssemblySdkTasksTFM>
    <_WebAssemblySdkTasksTFM Condition=" '$(MSBuildRuntimeType)' != 'Core'">net472</_WebAssemblySdkTasksTFM>
    <_WebAssemblySdkTasksAssembly>$(WebAssemblySdkDirectoryRoot)tools\$(_WebAssemblySdkTasksTFM)\Microsoft.NET.Sdk.WebAssembly.Pack.Tasks.dll</_WebAssemblySdkTasksAssembly>

    <!-- Compression -->
    <CompressionIncludePatterns>$(CompressionIncludePatterns);_framework\**</CompressionIncludePatterns>
    <DisableBuildCompression Condition="'$(WasmBuildingForNestedPublish)' == 'true'">true</DisableBuildCompression>
  </PropertyGroup>

  <UsingTask TaskName="Microsoft.NET.Sdk.WebAssembly.GenerateWasmBootJson" AssemblyFile="$(_WebAssemblySdkTasksAssembly)" />
  <UsingTask TaskName="Microsoft.NET.Sdk.WebAssembly.ComputeWasmBuildAssets" AssemblyFile="$(_WebAssemblySdkTasksAssembly)" />
  <UsingTask TaskName="Microsoft.NET.Sdk.WebAssembly.ComputeWasmPublishAssets" AssemblyFile="$(_WebAssemblySdkTasksAssembly)" />
  <UsingTask TaskName="Microsoft.NET.Sdk.WebAssembly.ConvertDllsToWebCil" AssemblyFile="$(_WebAssemblySdkTasksAssembly)" />

  <PropertyGroup>
    <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>

    <!-- Runtime feature defaults to trim unnecessary code -->
    <InvariantTimezone Condition="'$(BlazorEnableTimeZoneSupport)' == 'false'">true</InvariantTimezone>
    <BlazorCacheBootResources Condition="'$(BlazorCacheBootResources)' == ''">true</BlazorCacheBootResources>

    <!-- Turn off parts of the build that do not apply to WASM projects -->
    <GenerateDependencyFile>false</GenerateDependencyFile>
    <PreserveCompilationContext>false</PreserveCompilationContext>
    <PreserveCompilationReferences>false</PreserveCompilationReferences>
    <IsWebConfigTransformDisabled>true</IsWebConfigTransformDisabled>

    <EnableDefaultWasmAssembliesToBundle>false</EnableDefaultWasmAssembliesToBundle>
    <WasmNestedPublishAppDependsOn>_GatherWasmFilesToPublish;$(WasmNestedPublishAppDependsOn)</WasmNestedPublishAppDependsOn>
    <_WasmNestedPublishAppPreTarget>ComputeFilesToPublish</_WasmNestedPublishAppPreTarget>
  </PropertyGroup>

  <ItemGroup>
    <!-- Configuration for the platform compatibility analyzer. See https://github.com/dotnet/designs/blob/main/accepted/2020/platform-exclusion/platform-exclusion.md#build-configuration-for-platforms -->
    <SupportedPlatform Remove="@(SupportedPlatform)" />
    <SupportedPlatform Include="browser" />
  </ItemGroup>

  <!-- Wire-up static web assets -->
  <PropertyGroup>
    <!-- Static Web Assets -->
    <ResolveStaticWebAssetsInputsDependsOn>
      $(ResolveStaticWebAssetsInputsDependsOn);
      _AddWasmStaticWebAssets;
    </ResolveStaticWebAssetsInputsDependsOn>
    <ResolvePublishStaticWebAssetsDependsOn Condition="'$(WasmBuildingForNestedPublish)' != 'true'">
      $(ResolvePublishStaticWebAssetsDependsOn);
      ProcessPublishFilesForWasm;
      ComputeWasmExtensions;
      _AddPublishWasmBootJsonToStaticWebAssets;
    </ResolvePublishStaticWebAssetsDependsOn>
    <GenerateStaticWebAssetsPublishManifestDependsOn Condition="'$(WasmBuildingForNestedPublish)' != 'true'">
      $(GenerateStaticWebAssetsPublishManifestDependsOn);
      GeneratePublishWasmBootJson;
    </GenerateStaticWebAssetsPublishManifestDependsOn>

    <!-- Compression -->
    <ResolveCompressedFilesDependsOn>
      $(ResolveCompressedFilesDependsOn);
      ResolveWasmOutputs;
      _GenerateBuildWasmBootJson;
      _AddWasmStaticWebAssets;
    </ResolveCompressedFilesDependsOn>
    <ResolveCompressedFilesForPublishDependsOn Condition="'$(WasmBuildingForNestedPublish)' != 'true'">
      $(ResolveCompressedFilesForPublishDependsOn);
      ProcessPublishFilesForWasm;
      ComputeWasmExtensions;
      GeneratePublishWasmBootJson;
      _AddPublishWasmBootJsonToStaticWebAssets;
    </ResolveCompressedFilesForPublishDependsOn>
    <CompressFilesForPublishDependsOn Condition="'$(WasmBuildingForNestedPublish)' != 'true'">
      $(CompressFilesForPublishDependsOn);
      GeneratePublishWasmBootJson;
    </CompressFilesForPublishDependsOn>

    <!-- Wasm -->
    <AddWasmStaticWebAssetsDependsOn>
      ResolveWasmOutputs;
      _GenerateBuildWasmBootJson;
      $(AddWasmStaticWebAssetsDependsOn);
    </AddWasmStaticWebAssetsDependsOn>
    <GenerateBuildWasmBootJsonDependsOn>
      $(GenerateBuildWasmBootJsonDependsOn);
      ResolveWasmOutputs;
    </GenerateBuildWasmBootJsonDependsOn>
  </PropertyGroup>

  <Target Name="_WasmNativeForBuild" DependsOnTargets="_GatherWasmFilesToBuild;WasmBuildApp" Condition="'$(UsingBrowserRuntimeWorkload)' == 'true'" />

  <Target Name="_GatherWasmFilesToBuild">
    <ItemGroup>
      <WasmAssembliesToBundle Remove="@(WasmAssembliesToBundle)" />
      <WasmAssembliesToBundle Include="@(IntermediateAssembly)" />
      <WasmAssembliesToBundle Include="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.Extension)' == '.dll'" />
    </ItemGroup>
  </Target>

  <Target Name="_ResolveGlobalizationConfiguration">
    <Error Condition="'$(BlazorIcuDataFileName)' != '' AND !$([System.IO.Path]::GetFileName('$(BlazorIcuDataFileName)').StartsWith('icudt'))" Text="File name in %24(BlazorIcuDataFileName) has to start with 'icudt'." />
    <Warning Condition="'$(InvariantGlobalization)' == 'true' AND '$(BlazorWebAssemblyLoadAllGlobalizationData)' == 'true'" Text="%24(BlazorWebAssemblyLoadAllGlobalizationData) has no effect when %24(InvariantGlobalization) is set to true." />
    <Warning Condition="'$(HybridGlobalization)' == 'true' AND '$(BlazorWebAssemblyLoadAllGlobalizationData)' == 'true'" Text="%24(BlazorWebAssemblyLoadAllGlobalizationData) has no effect when %24(HybridGlobalization) is set to true." />
    <Warning Condition="'$(InvariantGlobalization)' == 'true' AND '$(BlazorIcuDataFileName)' != ''" Text="%24(BlazorIcuDataFileName) has no effect when %24(InvariantGlobalization) is set to true." />
    <Warning Condition="'$(BlazorWebAssemblyLoadAllGlobalizationData)' == 'true' AND '$(BlazorIcuDataFileName)' != ''" Text="%24(BlazorIcuDataFileName) has no effect when %24(BlazorWebAssemblyLoadAllGlobalizationData) is set to true." />
    <Warning Condition="'$(InvariantGlobalization)' == 'true' AND '$(HybridGlobalization)' == 'true'" Text="%24(HybridGlobalization) has no effect when %24(InvariantGlobalization) is set to true." />
    <Warning Condition="'$(BlazorIcuDataFileName)' != '' AND '$(HybridGlobalization)' == 'true'" Text="%24(HybridGlobalization) has no effect when %24(BlazorIcuDataFileName) is set." />
    <PropertyGroup>
      <_RuntimePackDir>$(MicrosoftNetCoreAppRuntimePackDir)</_RuntimePackDir>
      <_RuntimePackDir Condition="'$(_RuntimePackDir)' == ''">%(ResolvedRuntimePack.PackageDirectory)</_RuntimePackDir>
      <_RuntimePackNativeDir>$([MSBuild]::NormalizeDirectory($(_RuntimePackDir), 'runtimes', 'browser-wasm', 'native'))</_RuntimePackNativeDir>
      <_LoadCustomIcuData Condition="'$(InvariantGlobalization)' != 'true' AND '$(HybridGlobalization)' != 'true' AND '$(BlazorWebAssemblyLoadAllGlobalizationData)' != 'true' AND '$(BlazorIcuDataFileName)' != ''">true</_LoadCustomIcuData>
      <_LoadCustomIcuData Condition="'$(_LoadCustomIcuData)' == ''">false</_LoadCustomIcuData>
      <_BlazorIcuDataFileName Condition="'$(_LoadCustomIcuData)' == 'true' AND Exists('$(BlazorIcuDataFileName)')">$(BlazorIcuDataFileName)</_BlazorIcuDataFileName>
      <_BlazorIcuDataFileName Condition="'$(_LoadCustomIcuData)' == 'true' AND !Exists('$(BlazorIcuDataFileName)') AND !$([System.IO.Path]::IsPathRooted($(BlazorIcuDataFileName)))">$(_RuntimePackNativeDir)$(BlazorIcuDataFileName)</_BlazorIcuDataFileName>
      <_IsHybridGlobalization Condition="'$(InvariantGlobalization)' != 'true' AND '$(_LoadCustomIcuData)' != 'true'">$(HybridGlobalization)</_IsHybridGlobalization>
      <_IsHybridGlobalization Condition="'$(_IsHybridGlobalization)' == ''">false</_IsHybridGlobalization>
      <_BlazorWebAssemblyLoadAllGlobalizationData Condition="'$(InvariantGlobalization)' != 'true' AND '$(HybridGlobalization)' != 'true'">$(BlazorWebAssemblyLoadAllGlobalizationData)</_BlazorWebAssemblyLoadAllGlobalizationData>
      <_BlazorWebAssemblyLoadAllGlobalizationData Condition="'$(_BlazorWebAssemblyLoadAllGlobalizationData)' == ''">false</_BlazorWebAssemblyLoadAllGlobalizationData>
    </PropertyGroup>
    <ItemGroup Condition="'$(_LoadCustomIcuData)' == 'true' AND Exists('$(BlazorIcuDataFileName)')">
      <!-- if ICU comes from runtime pack then it is already included in ReferenceCopyLocalPaths -->
      <ReferenceCopyLocalPaths Include="$(_BlazorIcuDataFileName)" />
    </ItemGroup>
    <ItemGroup Condition="'$(_IsHybridGlobalization)' == 'true' AND Exists('$(_RuntimePackNativeDir)dotnet.globalization.js')">
      <WasmNativeAsset Include="$(_RuntimePackNativeDir)dotnet.globalization.js"/>
    </ItemGroup>
    <Error Condition="'$(_LoadCustomIcuData)' == 'true' AND !Exists('$(_BlazorIcuDataFileName)')" Text="Could not find %24(BlazorIcuDataFileName)=$(BlazorIcuDataFileName), or when used as a path relative to the runtime pack (='$(_RuntimePackNativeDir)')."/>
  </Target>

  <Target Name="_ResolveWasmConfiguration" DependsOnTargets="_ResolveGlobalizationConfiguration">
    <PropertyGroup>
      <_TargetingNET80OrLater>false</_TargetingNET80OrLater>
      <_TargetingNET80OrLater Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $([MSBuild]::VersionGreaterThanOrEquals('$(TargetFrameworkVersion)', '8.0'))">true</_TargetingNET80OrLater>
      <_TargetingNET90OrLater Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $([MSBuild]::VersionGreaterThanOrEquals('$(TargetFrameworkVersion)', '9.0'))">true</_TargetingNET90OrLater>

      <_BlazorEnableTimeZoneSupport>$(BlazorEnableTimeZoneSupport)</_BlazorEnableTimeZoneSupport>
      <_BlazorEnableTimeZoneSupport Condition="'$(_BlazorEnableTimeZoneSupport)' == ''">true</_BlazorEnableTimeZoneSupport>
      <_WasmInvariantGlobalization>$(InvariantGlobalization)</_WasmInvariantGlobalization>
      <_WasmInvariantGlobalization Condition="'$(_WasmInvariantGlobalization)' == ''">true</_WasmInvariantGlobalization>
      <_WasmCopyOutputSymbolsToOutputDirectory>$(CopyOutputSymbolsToOutputDirectory)</_WasmCopyOutputSymbolsToOutputDirectory>
      <_WasmCopyOutputSymbolsToOutputDirectory Condition="'$(_WasmCopyOutputSymbolsToOutputDirectory)'==''">true</_WasmCopyOutputSymbolsToOutputDirectory>
      <_WasmEnableThreads>$(WasmEnableThreads)</_WasmEnableThreads>
      <_WasmEnableThreads Condition="'$(_WasmEnableThreads)' == ''">false</_WasmEnableThreads>

      <_WasmEnableWebcil>$(WasmEnableWebcil)</_WasmEnableWebcil>
      <_WasmEnableWebcil Condition="'$(_TargetingNET80OrLater)' != 'true'">false</_WasmEnableWebcil>
      <_WasmEnableWebcil Condition="'$(_WasmEnableWebcil)' == ''">true</_WasmEnableWebcil>
      <_BlazorWebAssemblyStartupMemoryCache>$(BlazorWebAssemblyStartupMemoryCache)</_BlazorWebAssemblyStartupMemoryCache>
      <_BlazorWebAssemblyJiterpreter>$(BlazorWebAssemblyJiterpreter)</_BlazorWebAssemblyJiterpreter>
      <_BlazorWebAssemblyRuntimeOptions>$(BlazorWebAssemblyRuntimeOptions)</_BlazorWebAssemblyRuntimeOptions>
      <_WasmFingerprintAssets>$(WasmFingerprintAssets)</_WasmFingerprintAssets>
      <_WasmFingerprintAssets Condition="'$(_WasmFingerprintAssets)' == '' and '$(_TargetingNET90OrLater)' == 'true'">true</_WasmFingerprintAssets>
      <_WasmFingerprintAssets Condition="'$(_WasmFingerprintAssets)' == ''">false</_WasmFingerprintAssets>
      <_WasmFingerprintDotnetJs>$(WasmFingerprintDotnetJs)</_WasmFingerprintDotnetJs>
      <_WasmFingerprintDotnetJs Condition="'$(_WasmFingerprintDotnetJs)' == ''">false</_WasmFingerprintDotnetJs>
      <_WasmBootConfigFileName>$(WasmBootConfigFileName)</_WasmBootConfigFileName>
      <_WasmBootConfigFileName Condition="'$(_WasmBootConfigFileName)' == ''">blazor.boot.json</_WasmBootConfigFileName>
      <_WasmPublishBootConfigFileName Condition="'$(_WasmBootConfigFileName)' == 'blazor.boot.json'">blazor.publish.boot.json</_WasmPublishBootConfigFileName>
      <_WasmPublishBootConfigFileName Condition="'$(_WasmPublishBootConfigFileName)' == ''">publish.$(_WasmBootConfigFileName)</_WasmPublishBootConfigFileName>

      <!-- Workaround for https://github.com/dotnet/sdk/issues/12114-->
      <PublishDir Condition="'$(AppendRuntimeIdentifierToOutputPath)' != 'true' AND '$(PublishDir)' == '$(OutputPath)$(RuntimeIdentifier)\$(PublishDirName)\'">$(OutputPath)$(PublishDirName)\</PublishDir>
    </PropertyGroup>
  </Target>

  <Target Name="ResolveWasmOutputs" DependsOnTargets="_ResolveWasmOutputs" />

  <Target Name="_GetWasmRuntimePackVersion">
    <PropertyGroup>
      <_WasmRuntimePackVersion>%(ResolvedRuntimePack.NuGetPackageVersion)</_WasmRuntimePackVersion>
    </PropertyGroup>

    <Error Code="WASM0005" Text="Unable to resolve WebAssembly runtime pack version" Condition="'$(_WasmRuntimePackVersion)' == ''" />
  </Target>

  <Target Name="_ResolveWasmOutputs" DependsOnTargets="ResolveReferences;PrepareResourceNames;ComputeIntermediateSatelliteAssemblies;_ResolveWasmConfiguration;_WasmNativeForBuild;_GetWasmRuntimePackVersion">
    <PropertyGroup>
      <_WasmNativeAssetFileNames>;@(WasmNativeAsset->'%(FileName)%(Extension)');</_WasmNativeAssetFileNames>
    </PropertyGroup>

    <ItemGroup>
      <_WasmConfigFileCandidates Include="@(StaticWebAsset)" Condition="'%(SourceType)' == 'Discovered'" />

      <!-- Remove dotnet.js/wasm from runtime pack, in favor of the relinked ones in @(WasmNativeAsset) -->
      <ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" Condition="$(_WasmNativeAssetFileNames.Contains(';%(FileName)%(Extension);'))" />
    </ItemGroup>

    <PropertyGroup>
      <_WasmEmitSourceMapBuild>$(WasmEmitSourceMap)</_WasmEmitSourceMapBuild>
      <_WasmEmitSourceMapBuild Condition="'$(_WasmEmitSourceMapBuild)' == ''">true</_WasmEmitSourceMapBuild>
    </PropertyGroup>

    <ComputeWasmBuildAssets
      Candidates="@(ReferenceCopyLocalPaths->Distinct());@(WasmNativeAsset)"
      CustomIcuCandidate="$(_BlazorIcuDataFileName)"
      ProjectAssembly="@(IntermediateAssembly)"
      ProjectDebugSymbols="@(_DebugSymbolsIntermediatePath)"
      SatelliteAssemblies="@(ReferenceSatellitePaths)"
      ProjectSatelliteAssemblies="@(IntermediateSatelliteAssembliesWithTargetPath)"
      TimeZoneSupport="$(_BlazorEnableTimeZoneSupport)"
      InvariantGlobalization="$(_WasmInvariantGlobalization)"
      HybridGlobalization="$(_IsHybridGlobalization)"
      LoadFullICUData="$(_BlazorWebAssemblyLoadAllGlobalizationData)"
      CopySymbols="$(_WasmCopyOutputSymbolsToOutputDirectory)"
      OutputPath="$(OutputPath)"
      EnableThreads="$(_WasmEnableThreads)"
      EmitSourceMap="$(_WasmEmitSourceMapBuild)"
      FingerprintAssets="$(_WasmFingerprintAssets)"
      FingerprintDotnetJs="$(_WasmFingerprintDotnetJs)"
    >
      <Output TaskParameter="AssetCandidates" ItemName="_BuildAssetsCandidates" />
      <Output TaskParameter="FilesToRemove" ItemName="_WasmBuildFilesToRemove" />
    </ComputeWasmBuildAssets>

    <PropertyGroup>
      <_WasmBuildWebCilPath>$([MSBuild]::NormalizeDirectory($(IntermediateOutputPath), 'webcil'))</_WasmBuildWebCilPath>
      <_WasmBuildTmpWebCilPath>$([MSBuild]::NormalizeDirectory($(IntermediateOutputPath), 'tmp-webcil'))</_WasmBuildTmpWebCilPath>
      <_WasmBuildOuputPath>$([MSBuild]::NormalizeDirectory('$(OutputPath)', 'wwwroot'))</_WasmBuildOuputPath>
    </PropertyGroup>

    <ConvertDllsToWebCil Candidates="@(_BuildAssetsCandidates)" IntermediateOutputPath="$(_WasmBuildTmpWebCilPath)" OutputPath="$(_WasmBuildWebCilPath)" IsEnabled="$(_WasmEnableWebcil)">
      <Output TaskParameter="WebCilCandidates" ItemName="_WebCilAssetsCandidates" />
      <Output TaskParameter="FileWrites" ItemName="FileWrites" />
    </ConvertDllsToWebCil>

    <ItemGroup>
      <_WasmFingerprintPatterns Include="WasmFiles" Pattern="*.wasm" Expression="#[.{fingerprint}]!" />
      <_WasmFingerprintPatterns Include="DllFiles" Pattern="*.dll" Expression="#[.{fingerprint}]!" />
      <_WasmFingerprintPatterns Include="DatFiles" Pattern="*.dat" Expression="#[.{fingerprint}]!" />
      <_WasmFingerprintPatterns Include="Pdb" Pattern="*.pdb" Expression="#[.{fingerprint}]!" />
    </ItemGroup>

    <DefineStaticWebAssets
      CandidateAssets="@(_WebCilAssetsCandidates)"
      SourceId="$(PackageId)"
      SourceType="Computed"
      AssetKind="Build"
      AssetRole="Primary"
      CopyToOutputDirectory="PreserveNewest"
      CopyToPublishDirectory="Never"
      ContentRoot="$(_WasmBuildOuputPath)"
      FingerprintCandidates="$(_WasmFingerprintAssets)"
      FingerprintPatterns="@(FingerprintPatterns);@(_WasmFingerprintPatterns)"
      BasePath="$(StaticWebAssetBasePath)"
    >
      <Output TaskParameter="Assets" ItemName="WasmStaticWebAsset" />
    </DefineStaticWebAssets>

    <DefineStaticWebAssets
      CandidateAssets="@(_WasmConfigFileCandidates)"
      AssetTraitName="WasmResource"
      AssetTraitValue="settings"
      RelativePathFilter="appsettings*.json"
    >
      <Output TaskParameter="Assets" ItemName="_WasmJsConfigStaticWebAsset" />
    </DefineStaticWebAssets>

    <DefineStaticWebAssetEndpoints
      CandidateAssets="@(_WasmJsConfigStaticWebAsset)"
      ExistingEndpoints="@(StaticWebAssetEndpoint)"
      ContentTypeMappings="@(StaticWebAssetContentTypeMapping)"
    >
      <Output TaskParameter="Endpoints" ItemName="_WasmJsConfigStaticWebAssetEndpoint" />
    </DefineStaticWebAssetEndpoints>

    <ItemGroup>
      <!-- Update the boot config static web asset since we've given it a trait -->
      <StaticWebAsset Remove="@(_WasmJsConfigStaticWebAsset)" />
      <StaticWebAsset Include="@(_WasmJsConfigStaticWebAsset)" />
      <StaticWebAssetEndpoint Include="@(_WasmJsConfigStaticWebAssetEndpoint)" />

      <ReferenceCopyLocalPaths Remove="@(_WasmBuildFilesToRemove)" />
    </ItemGroup>

  </Target>

  <Target Name="_AddWasmStaticWebAssets" DependsOnTargets="$(AddWasmStaticWebAssetsDependsOn)">
    <ItemGroup>
      <StaticWebAsset Include="@(WasmStaticWebAsset)" />
      <StaticWebAsset Include="@(_BuildWasmBootJsonStaticWebAsset)" />
      <StaticWebAssetEndpoint Include="@(WasmStaticWebAssetEndpoint)" />
      <StaticWebAssetEndpoint Include="@(_BuildWasmBootJsonStaticWebAssetEndpoint)" />
    </ItemGroup>
  </Target>

  <Target Name="_GenerateBuildWasmBootJson" DependsOnTargets="$(GenerateBuildWasmBootJsonDependsOn)">
    <PropertyGroup>
      <_WasmBuildBootJsonPath>$(IntermediateOutputPath)$(_WasmBootConfigFileName)</_WasmBuildBootJsonPath>
    </PropertyGroup>

    <ItemGroup>
      <_WasmJsModuleCandidatesForBuild
        Include="@(StaticWebAsset)"
        Condition="'%(StaticWebAsset.AssetTraitName)' == 'JSModule' and '%(StaticWebAsset.AssetTraitValue)' == 'JSLibraryModule' and '%(AssetKind)' != 'Publish'" />
    </ItemGroup>

    <FilterStaticWebAssetEndpoints Condition="'@(_WasmJsModuleCandidatesForBuild)' != ''"
      Endpoints="@(StaticWebAssetEndpoint)"
      Assets="@(_WasmJsModuleCandidatesForBuild)"
      Filters=""
    >
      <Output TaskParameter="FilteredEndpoints" ItemName="_WasmJsModuleCandidatesForBuildEndpoint" />
    </FilterStaticWebAssetEndpoints>

    <DefineStaticWebAssetEndpoints
      CandidateAssets="@(WasmStaticWebAsset)"
      ExistingEndpoints="@(StaticWebAssetEndpoint)"
      ContentTypeMappings="@(StaticWebAssetContentTypeMapping)"
    >
      <Output TaskParameter="Endpoints" ItemName="WasmStaticWebAssetEndpoint" />
    </DefineStaticWebAssetEndpoints>

    <ResolveFingerprintedStaticWebAssetEndpointsForAssets
      CandidateEndpoints="@(WasmStaticWebAssetEndpoint);@(_WasmJsModuleCandidatesForBuildEndpoint)"
      CandidateAssets="@(WasmStaticWebAsset);@(_WasmJsModuleCandidatesForBuild)"
      IsStandalone="$(StaticWebAssetStandaloneHosting)"
    >
      <Output TaskParameter="ResolvedEndpoints" ItemName="_WasmResolvedEndpoints" />
    </ResolveFingerprintedStaticWebAssetEndpointsForAssets>

    <GenerateWasmBootJson
      AssemblyPath="@(IntermediateAssembly)"
      Resources="@(WasmStaticWebAsset);@(_WasmJsModuleCandidatesForBuild)"
      Endpoints="@(_WasmResolvedEndpoints)"
      DebugBuild="true"
      DebugLevel="$(WasmDebugLevel)"
      LinkerEnabled="false"
      CacheBootResources="$(BlazorCacheBootResources)"
      OutputPath="$(_WasmBuildBootJsonPath)"
      ConfigurationFiles="@(_WasmJsConfigStaticWebAsset)"
      LazyLoadedAssemblies="@(BlazorWebAssemblyLazyLoad)"
      InvariantGlobalization="$(InvariantGlobalization)"
      LoadCustomIcuData="$(_LoadCustomIcuData)"
      IsHybridGlobalization="$(_IsHybridGlobalization)"
      LoadFullICUData="$(_BlazorWebAssemblyLoadAllGlobalizationData)"
      StartupMemoryCache="$(_BlazorWebAssemblyStartupMemoryCache)"
      Jiterpreter="$(_BlazorWebAssemblyJiterpreter)"
      RuntimeOptions="$(_BlazorWebAssemblyRuntimeOptions)"
      Extensions="@(WasmBootConfigExtension)"
      TargetFrameworkVersion="$(TargetFrameworkVersion)"
      ModuleAfterConfigLoaded="@(WasmModuleAfterConfigLoaded)"
      ModuleAfterRuntimeReady="@(WasmModuleAfterRuntimeReady)"
      IsPublish="false"
      IsAot="$(RunAOTCompilation)"
      IsMultiThreaded="$(WasmEnableThreads)"
      FingerprintAssets="$(_WasmFingerprintAssets)" />

    <ItemGroup>
      <FileWrites Include="$(_WasmBuildBootJsonPath)" />
    </ItemGroup>

    <PropertyGroup>
      <_WasmBuildBootJsonPath>$(IntermediateOutputPath)$(_WasmBootConfigFileName)</_WasmBuildBootJsonPath>
    </PropertyGroup>

    <ItemGroup>
      <_BuildWasmBootJson
        Include="$(_WasmBuildBootJsonPath)"
        RelativePath="_framework/$(_WasmBootConfigFileName)" />
    </ItemGroup>

    <DefineStaticWebAssets
      CandidateAssets="@(_BuildWasmBootJson)"
      SourceId="$(PackageId)"
      SourceType="Computed"
      AssetKind="Build"
      AssetRole="Primary"
      AssetTraitName="WasmResource"
      AssetTraitValue="manifest"
      CopyToOutputDirectory="PreserveNewest"
      CopyToPublishDirectory="Never"
      ContentRoot="$(OutDir)wwwroot"
      BasePath="$(StaticWebAssetBasePath)"
    >
      <Output TaskParameter="Assets" ItemName="_BuildWasmBootJsonStaticWebAsset" />
    </DefineStaticWebAssets>

    <DefineStaticWebAssetEndpoints
      CandidateAssets="@(_BuildWasmBootJsonStaticWebAsset)"
      ExistingEndpoints="@(StaticWebAssetEndpoint)"
      ContentTypeMappings="@(StaticWebAssetContentTypeMapping)"
    >
      <Output TaskParameter="Endpoints" ItemName="_BuildWasmBootJsonStaticWebAssetEndpoint" />
    </DefineStaticWebAssetEndpoints>

  </Target>

  <Target Name="ProvideDefaultUserRuntimeConfig" BeforeTargets="_GenerateRuntimeConfigurationFilesInputCache" Condition="'$(GenerateRuntimeConfigurationFiles)' == 'true'">
    <PropertyGroup Condition="!Exists('$(UserRuntimeConfig)')">
      <UserRuntimeConfig>$(MSBuildThisFileDirectory)browser.runtimeconfig.template.json</UserRuntimeConfig>
    </PropertyGroup>
  </Target>

  <!-- Publish starts here -->

  <!-- Make sure that ResolveAssemblyReferences runs early enough to ensure satellite assemblies are populated in the ResolvedFilesToPublish -->
  <Target Name="_WasmPrepareForPublish"
    DependsOnTargets="PrepareResourceNames;ComputeIntermediateSatelliteAssemblies;ResolveAssemblyReferences"
    BeforeTargets="PrepareForPublish" />

  <!-- Wasm's Nested publish is run just to build the native bits. We don't need to run blazor targets for that -->
  <Target Name="ProcessPublishFilesForWasm" DependsOnTargets="_ResolveWasmConfiguration;LoadStaticWebAssetsBuildManifest;_GetWasmRuntimePackVersion;_GatherWasmFilesToPublish" AfterTargets="ILLink" Condition="'$(WasmBuildingForNestedPublish)' != 'true'">
    <!-- The list of static web assets already contains all the assets from the build. We want to correct certain assets that might
         have changed as part of the publish process. We are going to do so as follows:
         * We will update Blazor runtime asset dlls if we are running PublishTrimmed
         * We will update Blazor native runtime resources if we are using Aot
         Other than that, we'll filter the unwanted assets from the list of resolved files to publish in the same way we did during the build.
    -->

    <ItemGroup>
      <_WasmPublishPrefilteredAssets
        Include="@(StaticWebAsset)"
        Condition="'%(StaticWebAsset.AssetTraitName)' == 'WasmResource' or '%(StaticWebAsset.AssetTraitName)' == 'Culture' or '%(AssetRole)' == 'Alternative'" />
    </ItemGroup>

    <PropertyGroup>
      <_WasmEmitSourceMapPublish>$(WasmEmitSourceMap)</_WasmEmitSourceMapPublish>
      <_WasmEmitSourceMapPublish Condition="'$(_WasmEmitSourceMapPublish)' == ''">false</_WasmEmitSourceMapPublish>
    </PropertyGroup>

    <ItemGroup Condition="@(WasmAssembliesFinal->Count()) == 0 or '$(TargetFrameworkVersion)' == 'v6.0'">
      <_WasmResolvedFilesToPublish Include="@(ResolvedFileToPublish)" />
    </ItemGroup>
    <ItemGroup Condition="@(WasmAssembliesFinal->Count()) > 0 and '$(TargetFrameworkVersion)' != 'v6.0'">
      <_WasmResolvedFilesToPublish Include="@(WasmAssembliesFinal)" />
      <!-- Ensure we have 'RelativePath' required by ComputeWasmPublishAssets. 9+ version of MonoAOTCompiler is copying this metadata, but when targeting downlevel versions it doesn't. -->
      <_WasmResolvedFilesToPublish RelativePath="%(FileName)%(Extension)" Condition="'%(_WasmResolvedFilesToPublish.RelativePath)' == ''" />

      <!-- remove the original assemblies -->
      <ResolvedFileToPublish Remove="@(WasmAssembliesToBundle)" />
      <_WasmResolvedFilesToPublish Include="@(ResolvedFileToPublish)" />
    </ItemGroup>

    <ComputeWasmPublishAssets
      ResolvedFilesToPublish="@(_WasmResolvedFilesToPublish)"
      CustomIcuCandidate="$(_BlazorIcuDataFileName)"
      TimeZoneSupport="$(_BlazorEnableTimeZoneSupport)"
      PublishPath="$(PublishDir)"
      WasmAotAssets="@(WasmNativeAsset)"
      InvariantGlobalization="$(_WasmInvariantGlobalization)"
      HybridGlobalization="$(_IsHybridGlobalization)"
      LoadFullICUData="$(_BlazorWebAssemblyLoadAllGlobalizationData)"
      CopySymbols="$(CopyOutputSymbolsToPublishDirectory)"
      ExistingAssets="@(_WasmPublishPrefilteredAssets)"
      EnableThreads="$(_WasmEnableThreads)"
      EmitSourceMap="$(_WasmEmitSourceMapPublish)"
      IsWebCilEnabled="$(_WasmEnableWebcil)"
      FingerprintAssets="$(_WasmFingerprintAssets)"
    >
      <Output TaskParameter="NewCandidates" ItemName="_NewWasmPublishStaticWebAssets" />
      <Output TaskParameter="PromotedAssets" ItemName="_PromotedWasmPublishStaticWebAssets" />
      <Output TaskParameter="FilesToRemove" ItemName="_PublishResolvedFilesToRemove" />
    </ComputeWasmPublishAssets>

    <PropertyGroup>
      <_WasmPublishWebCilPath>$([MSBuild]::NormalizeDirectory($(IntermediateOutputPath), 'webcil', 'publish'))</_WasmPublishWebCilPath>
      <_WasmPublishTmpWebCilPath>$([MSBuild]::NormalizeDirectory($(IntermediateOutputPath), 'tmp-webcil', 'publish'))</_WasmPublishTmpWebCilPath>
    </PropertyGroup>

    <ConvertDllsToWebCil Candidates="@(_NewWasmPublishStaticWebAssets)" IntermediateOutputPath="$(_WasmPublishTmpWebCilPath)" OutputPath="$(_WasmPublishWebCilPath)" IsEnabled="$(_WasmEnableWebcil)">
      <Output TaskParameter="WebCilCandidates" ItemName="_NewWebCilPublishStaticWebAssetsCandidates" />
      <Output TaskParameter="FileWrites" ItemName="FileWrites" />
    </ConvertDllsToWebCil>

    <!-- _NewWebCilPublishStaticWebAssetsCandidates contain the `Fingerprint` and the `Integrity` from the old assets.
         Remove them and call DefineStaticWebAssets so that they can get re-computed appropriately.
    -->
    <ItemGroup>
      <_NewWebCilPublishStaticWebAssetsCandidatesNoMetadata
        Include="@(_NewWebCilPublishStaticWebAssetsCandidates)"
        RemoveMetadata="Integrity;Fingerprint" />
    </ItemGroup>

    <DefineStaticWebAssets CandidateAssets="@(_NewWebCilPublishStaticWebAssetsCandidatesNoMetadata);@(_PromotedWasmPublishStaticWebAssets)">
      <Output TaskParameter="Assets" ItemName="_NewWebCilPublishStaticWebAssets" />
    </DefineStaticWebAssets>

    <DefineStaticWebAssetEndpoints
      CandidateAssets="@(_NewWebCilPublishStaticWebAssets)"
      ExistingEndpoints="@(StaticWebAssetEndpoint)"
      ContentTypeMappings="@(StaticWebAssetContentTypeMapping)"
    >
      <Output TaskParameter="Endpoints" ItemName="_NewWebCilPublishStaticWebAssetsEndpoint" />
    </DefineStaticWebAssetEndpoints>

    <ItemGroup>
      <ResolvedFileToPublish Remove="@(_PublishResolvedFilesToRemove)" />
      <StaticWebAsset Include="@(_NewWebCilPublishStaticWebAssets)" />
      <StaticWebAssetEndpoint Include="@(_NewWebCilPublishStaticWebAssetsEndpoint)" />

      <!-- TODO: Probably doesn't do anything as of now, original https://github.com/dotnet/aspnetcore/pull/34798 -->
      <PublishBlazorBootStaticWebAsset
        Include="@(StaticWebAsset)"
        Condition="'%(AssetKind)' != 'Build' and
                    (('%(StaticWebAsset.AssetTraitName)' == 'WasmResource' and '%(StaticWebAsset.AssetTraitValue)' != 'manifest' and '%(StaticWebAsset.AssetTraitValue)' != 'boot') or
                    '%(StaticWebAsset.AssetTraitName)' == 'Culture')" />
    </ItemGroup>
  </Target>

  <Target
    Name="ComputeWasmExtensions"
    AfterTargets="ProcessPublishFilesForWasm"
    DependsOnTargets="$(ComputeBlazorExtensionsDependsOn)" >
    <ItemGroup>
      <_BlazorExtensionsCandidate Include="@(BlazorPublishExtension->'%(FullPath)')">
        <SourceId>$(PackageId)</SourceId>
        <SourceType>Computed</SourceType>
        <ContentRoot>$(PublishDir)wwwroot</ContentRoot>
        <BasePath>$(StaticWebAssetBasePath)</BasePath>
        <RelativePath>%(BlazorPublishExtension.RelativePath)</RelativePath>
        <AssetKind>Publish</AssetKind>
        <AssetMode>All</AssetMode>
        <AssetRole>Primary</AssetRole>
        <AssetTraitName>WasmResource</AssetTraitName>
        <AssetTraitValue>extension:%(BlazorPublishExtension.ExtensionName)</AssetTraitValue>
        <CopyToOutputDirectory>Never</CopyToOutputDirectory>
        <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
        <OriginalItemSpec>%(BlazorPublishExtension.Identity)</OriginalItemSpec>
      </_BlazorExtensionsCandidate>
    </ItemGroup>

    <DefineStaticWebAssets CandidateAssets="@(_BlazorExtensionsCandidate)">
      <Output TaskParameter="Assets" ItemName="StaticWebAsset" />
      <Output TaskParameter="Assets" ItemName="_BlazorExtensionsCandidatesForPublish" />
      <Output TaskParameter="Assets" ItemName="AssetToCompress" />
    </DefineStaticWebAssets>

    <DefineStaticWebAssetEndpoints
      CandidateAssets="@(_BlazorExtensionsCandidatesForPublish)"
      ExistingEndpoints="@(StaticWebAssetEndpoint)"
      ContentTypeMappings="@(StaticWebAssetContentTypeMapping)"
    >
      <Output TaskParameter="Endpoints" ItemName="StaticWebAssetEndpoint" />
    </DefineStaticWebAssetEndpoints>
  </Target>

  <Target Name="_AddWasmWebConfigFile" AfterTargets="ILLink">
    <ItemGroup Condition="'@(ResolvedFileToPublish->AnyHaveMetadataValue('RelativePath', 'web.config'))' != 'true'">
      <ResolvedFileToPublish
         Include="$(MSBuildThisFileDirectory)Wasm.web.config"
         ExcludeFromSingleFile="true"
         CopyToPublishDirectory="PreserveNewest"
         RelativePath="web.config" />
    </ItemGroup>
  </Target>

  <Target Name="_AddPublishWasmBootJsonToStaticWebAssets" DependsOnTargets="GeneratePublishWasmBootJson">
    <ItemGroup>
      <_PublishWasmBootJson
        Include="$(IntermediateOutputPath)$(_WasmPublishBootConfigFileName)"
        RelativePath="_framework/$(_WasmBootConfigFileName)" />
    </ItemGroup>

    <DefineStaticWebAssets
      CandidateAssets="@(_PublishWasmBootJson)"
      SourceId="$(PackageId)"
      SourceType="Computed"
      AssetKind="Publish"
      AssetRole="Primary"
      AssetTraitName="WasmResource"
      AssetTraitValue="manifest"
      CopyToOutputDirectory="Never"
      CopyToPublishDirectory="PreserveNewest"
      ContentRoot="$(PublishDir)wwwroot"
      BasePath="$(StaticWebAssetBasePath)"
    >
      <Output TaskParameter="Assets" ItemName="StaticWebAsset" />
      <Output TaskParameter="Assets" ItemName="_PublishWasmBootJsonStaticWebAsset" />
    </DefineStaticWebAssets>

    <DefineStaticWebAssetEndpoints
      CandidateAssets="@(_PublishWasmBootJsonStaticWebAsset)"
      ExistingEndpoints="@(StaticWebAssetEndpoint)"
      ContentTypeMappings="@(StaticWebAssetContentTypeMapping)"
    >
      <Output TaskParameter="Endpoints" ItemName="StaticWebAssetEndpoint" />
    </DefineStaticWebAssetEndpoints>

  </Target>

  <Target Name="GeneratePublishWasmBootJson" DependsOnTargets="$(GeneratePublishWasmBootJsonDependsOn)">
    <ItemGroup>
      <_WasmPublishAsset
        Include="@(StaticWebAsset)"
        Condition="'%(AssetKind)' != 'Build' and '%(StaticWebAsset.AssetTraitValue)' != 'manifest' and ('%(StaticWebAsset.AssetTraitName)' == 'WasmResource' or '%(StaticWebAsset.AssetTraitName)' == 'Culture') and '%(StaticWebAsset.AssetTraitValue)' != 'boot'" />

      <_WasmPublishConfigFile
        Include="@(StaticWebAsset)"
        Condition="'%(StaticWebAsset.AssetTraitName)' == 'WasmResource' and '%(StaticWebAsset.AssetTraitValue)' == 'settings'"/>

      <_WasmJsModuleCandidatesForPublish
        Include="@(StaticWebAsset)"
        Condition="'%(StaticWebAsset.AssetTraitName)' == 'JSModule' and '%(StaticWebAsset.AssetTraitValue)' == 'JSLibraryModule' and '%(AssetKind)' != 'Build'" />
    </ItemGroup>

    <FilterStaticWebAssetEndpoints Condition="'@(_WasmJsModuleCandidatesForPublish)' != ''"
      Endpoints="@(StaticWebAssetEndpoint)"
      Assets="@(_WasmJsModuleCandidatesForPublish)"
      Filters=""
    >
      <Output TaskParameter="FilteredEndpoints" ItemName="_WasmJsModuleCandidatesForPublishEndpoint" />
    </FilterStaticWebAssetEndpoints>

    <ResolveFingerprintedStaticWebAssetEndpointsForAssets
      CandidateEndpoints="@(StaticWebAssetEndpoint);@(_WasmJsModuleCandidatesForPublishEndpoint)"
      CandidateAssets="@(_WasmPublishAsset);@(_WasmJsModuleCandidatesForPublish)"
      IsStandalone="$(StaticWebAssetStandaloneHosting)"
    >
      <Output TaskParameter="ResolvedEndpoints" ItemName="_WasmResolvedEndpointsForPublish" />
    </ResolveFingerprintedStaticWebAssetEndpointsForAssets>

    <GenerateWasmBootJson
      AssemblyPath="@(IntermediateAssembly)"
      Resources="@(_WasmPublishAsset);@(_WasmJsModuleCandidatesForPublish)"
      Endpoints="@(_WasmResolvedEndpointsForPublish)"
      DebugBuild="false"
      DebugLevel="$(WasmDebugLevel)"
      LinkerEnabled="$(PublishTrimmed)"
      CacheBootResources="$(BlazorCacheBootResources)"
      OutputPath="$(IntermediateOutputPath)$(_WasmPublishBootConfigFileName)"
      ConfigurationFiles="@(_WasmPublishConfigFile)"
      LazyLoadedAssemblies="@(BlazorWebAssemblyLazyLoad)"
      InvariantGlobalization="$(InvariantGlobalization)"
      LoadCustomIcuData="$(_LoadCustomIcuData)"
      IsHybridGlobalization="$(_IsHybridGlobalization)"
      LoadFullICUData="$(_BlazorWebAssemblyLoadAllGlobalizationData)"
      StartupMemoryCache="$(_BlazorWebAssemblyStartupMemoryCache)"
      Jiterpreter="$(_BlazorWebAssemblyJiterpreter)"
      RuntimeOptions="$(_BlazorWebAssemblyRuntimeOptions)"
      Extensions="@(WasmBootConfigExtension)"
      TargetFrameworkVersion="$(TargetFrameworkVersion)"
      ModuleAfterConfigLoaded="@(WasmModuleAfterConfigLoaded)"
      ModuleAfterRuntimeReady="@(WasmModuleAfterRuntimeReady)"
      IsPublish="true"
      IsAot="$(RunAOTCompilation)"
      IsMultiThreaded="$(WasmEnableThreads)"
      FingerprintAssets="$(_WasmFingerprintAssets)" />

    <ItemGroup>
      <FileWrites Include="$(IntermediateOutputPath)$(_WasmPublishBootConfigFileName)" />
    </ItemGroup>

  </Target>

  <Target Name="_WasmNative"
      DependsOnTargets="_EnsureWasmRuntimeWorkload;WasmTriggerPublishApp"
      BeforeTargets="ProcessPublishFilesForWasm"
      Condition="'$(UsingBrowserRuntimeWorkload)' == 'true'" />

  <Target Name="_EnsureWasmRuntimeWorkload" Condition="'$(UsingBlazorAOTWorkloadManifest)' != 'true'">
    <Error
      Text="Publishing with AOT enabled requires the .NET WebAssembly AOT workload to be installed. To learn more, visit https://aka.ms/AAb4uzl."
      Code="BLAZORSDK1002" />
  </Target>

  <!-- called twice, once in the regular publish, and the other in the nested publish -->
  <Target Name="_GatherWasmFilesToPublish">
    <ItemGroup>
      <WasmAssembliesToBundle Remove="@(WasmAssembliesToBundle)" />
      <WasmAssembliesToBundle Include="@(ResolvedFileToPublish)" Exclude="@(_Exclude)" Condition="%(Extension) == '.dll'" />
    </ItemGroup>
  </Target>
</Project>
