Repository navigation
Closed
Labels
Milestone
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
I created a project consisting of a Blazor WebAssembly Standalone frontend and a Web API backend hosting the client application.
Everything runs correctly during development, but when attempting to publish, the process fails both with net9.0 and net10.0
Expected Behavior
The project should publish successfully without errors.
Steps To Reproduce
-
Navigate to the
Serverproject folder -
Run:
dotnet publish
Exceptions (if any)
Restore completed (0.9s)
info NETSDK1057: You are using a preview version of .NET. See https://aka.ms/dotnet-support-policy
Client succeeded (13.9s) → {PROJECT_ROOT}\Client\bin\Release\net10.0\wwwroot
Client failed with 3 errors (6.4s)
C:\Program Files\dotnet\sdk\10.0.100-rc.1.25451.107\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(175,5): error No 'BasePath' metadata present for element '.' and no default value was provided.
C:\Program Files\dotnet\sdk\10.0.100-rc.1.25451.107\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(175,5): error No 'ContentRoot' metadata present for element '.' and no default value was provided.
C:\Program Files\dotnet\sdk\10.0.100-rc.1.25451.107\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(175,5): error
System.InvalidOperationException: There is no file for the resource in either the locations '{PROJECT_ROOT}\Client' or '.'.
at Microsoft.AspNetCore.StaticWebAssets.Tasks.StaticWebAsset.ResolveFile(String identity, String originalItemSpec)
at Microsoft.AspNetCore.StaticWebAssets.Tasks.DefineStaticWebAssets.ResolveFileDetails(String originalItemSpec, String identity)
at Microsoft.AspNetCore.StaticWebAssets.Tasks.DefineStaticWebAssets.Execute()
Server failed (3.0s) → bin\Release\net10.0\Server.dll.NET Version
.NET 10.0.100-rc.1.25451.107
Anything else?
Full environment details:
.NET SDK:
Version: 10.0.100-rc.1.25451.107
Commit: 2db1f5ee2b
Workload version: 10.0.100-rc.1.25458.2
MSBuild version: 17.15.0-preview-25451-107+2db1f5ee2
Runtime Environment:
OS Name: Windows
OS Version: 10.0.26100
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\10.0.100-rc.1.25451.107\
Installed .NET Workloads:
[android]
Source: SDK 10.0.100-rc.1, VS 18.0.11012.119
Manifest versions: 36.0.0-rc.1.285/10.0.100-rc.1
Manifest path: C:\Program Files\dotnet\sdk-manifests\10.0.100-rc.1\microsoft.net.sdk.android\36.0.0-rc.1.285\WorkloadManifest.json
Install type: MSI
[ios]
Source: SDK 10.0.100-rc.1, VS 18.0.11012.119
Manifest versions: 18.5.10727-net10-rc.1/10.0.100-rc.1
Manifest path: C:\Program Files\dotnet\sdk-manifests\10.0.100-rc.1\microsoft.net.sdk.ios\18.5.10727-net10-rc.1\WorkloadManifest.json
Install type: MSI
[maccatalyst]
Source: SDK 10.0.100-rc.1, VS 18.0.11012.119
Manifest versions: 18.5.10727-net10-rc.1/10.0.100-rc.1
Manifest path: C:\Program Files\dotnet\sdk-manifests\10.0.100-rc.1\microsoft.net.sdk.maccatalyst\18.5.10727-net10-rc.1\WorkloadManifest.json
Install type: MSI
[maui-windows]
Source: SDK 10.0.100-rc.1, VS 18.0.11012.119
Manifest versions: 10.0.0-rc.1.25452.6/10.0.100-rc.1
Manifest path: C:\Program Files\dotnet\sdk-manifests\10.0.100-rc.1\microsoft.net.sdk.maui\10.0.0-rc.1.25452.6\WorkloadManifest.json
Install type: MSI
[wasm-tools]
Source: SDK 10.0.100-rc.1
Manifest versions: 10.0.100-rc.1.25451.107/10.0.100-rc.1
Manifest path: C:\Program Files\dotnet\sdk-manifests\10.0.100-rc.1\microsoft.net.workload.mono.toolchain.current\10.0.100-rc.1.25451.107\WorkloadManifest.json
Install type: MSI
Configured to use workload sets when installing new manifests.
Host:
Version: 10.0.0-rc.1.25451.107
Architecture: x64
Commit: 2db1f5ee2b
.NET SDKs installed:
10.0.100-rc.1.25451.107 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.0-rc.1.25451.107 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.0-rc.1.25451.107 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 8.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 10.0.0-rc.1.25451.107 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
Environment variables:
DOTNET_REACTOR [C:\Program Files (x86)\Eziriz\.NET Reactor]
DOTNET_REACTOR_CMD [C:\Program Files (x86)\Eziriz\.NET Reactor\dotNET_Reactor.Console.exe]
global.json file:
Not found
Activity
javiercn commentedon Sep 19, 2025
@Denny09310 thanks for contacting us.
The issue is not with either
MapStaticAssetsnor withStaticWebAssetsfrom what I can tell, but in how the Web assembly SDK is computing something (as per the image below).I'll transfer this to the runtime repo for triaging there and adjust the title accordingly
javiercn commentedon Sep 19, 2025
Somewhere around here seems to be the problem.
[-]Can't publish Blazor WASM hosted when using 'MapStaticAssets'[/-][+]_ReplaceFingerprintedBlazorJsForPublish incorrectly computes assets[/+]maraf commentedon Sep 20, 2025
Work in progress
$(BlazorWebAssemblyJSPath)is computed correctly in_ResolveBlazorWasmOutputs@(_BlazorJSFile)is created based onBlazorWebAssemblyJSPathas well@(_BlazorJSStaticWebAsset)_ReplaceFingerprintedBlazorJsForPublishis executed the is empty@(_BlazorJSFile)@(StaticWebAssets)is preserved between Client project builds, but@(_BlazorJSFile)is not. Re-running_ResolveBlazorWasmOutputscauses SWA to contain 2 instances ofblazor.webassembly.jsmaraf commentedon Sep 26, 2025
Closed in dotnet/sdk#50949