Skip to content

Blazor WebAssembly publish fails with InvalidOperationException for publish.dotnet.js #69100

Description

@vsfeedback

This issue has been moved from a ticket on Developer Community.


[severity:I'm unable to use this version] [regression] [worked-in:VS 18.8.1]
Can not publish Blazor Webassembly app. Getting error
System.InvalidOperationException: No file exists for the asset at either location '....\BlazorApp1\BlazorApp1\obj\Release\net10.0\publish.dotnet.js' or 'obj\Release\net10.0\publish.dotnet.js'.
Steps to reproduce
Create a new Blazor Webassembly project from Visual Studio 18.8.2 >NET 10.0.10
No extra coding needed just RIght click and Publish
Problem appeared after updating to version 18.8.2


Original Comments

Feedback Bot on 30/07/2026, 07:35 PM:

Based on similar issues resolved with Microsoft in the last 6 months, the following can help resolve this issue faster.

If not already included, please provide:

Detected: OS: 10.0.26200.0 VS: 18.8.2 [18.8.12023.21], Project type: C# / Blazor WebAssembly. Please share: 1) whether this reproduces on the latest Visual Studio build after updating, 2) the exact .NET SDK version in use (you mentioned .NET 10.0.10) and whether the issue happens in a brand-new Blazor WebAssembly template, 3) whether disabling static web assets (<StaticWebAssetsEnabled>false</StaticWebAssetsEnabled>) changes the publish result, and 4) a Visual Studio Feedback Tool recording (~30 seconds) while reproducing the publish failure so we can capture system logs and a trace.

Feedback Bot on 31/07/2026, 05:07 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

Michael Samios on 31/07/2026, 09:10 AM:

Setting <StaticWebAssetsEnabled>false</StaticWebAssetsEnabled> gives me error
The “DefineStaticWebAssets” task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is “public” and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the “C:\Program Files\Microsoft Visual Studio\18\Community\MSBuild\Current\Bin\amd64” directory.

I send you the full .csproj and publish log file in case they help

<Project Sdk=“Microsoft.NET.Sdk.BlazorWebAssembly”>

<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<OverrideHtmlAssetPlaceholders>true</OverrideHtmlAssetPlaceholders>
<StaticWebAssetsEnabled>false</StaticWebAssetsEnabled>
</PropertyGroup>

<ItemGroup>
<PackageReference Include=“Microsoft.AspNetCore.Components.WebAssembly” Version=“10.0.10” />
<PackageReference Include=“Microsoft.AspNetCore.Components.WebAssembly.DevServer” Version=“10.0.10” PrivateAssets=“all” />
</ItemGroup>

</Project>


Original Solutions

Michael Samios solved on 31/07/2026, 01:33 PM, undefined votes:

The problem was solved by
Uninstalling all workloads
Cleaning remained caches and manifests
Reinstalling workload for NET 10

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Author: Migration Bot 🤖The issue was created by a issue mover bot. The author may not be the actual author.area-blazorIncludes: Blazor, Razor Components

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions