Skip to content

Error blazor project DefineStaticWebAssetEndpoints on VS 17.14.5 #63068

@vsfeedback

Description

@vsfeedback

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


https://developercommunity.visualstudio.com/t/After-update-of-VS2022-to-1714-my-proj/10915082?sort=newest


Original Comments

Feedback Bot on 6/12/2025, 04:26 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.

Lenin Paredes on 6/16/2025, 08:04 PM:

Title: Blazor project fails to build on Visual Studio 17.14.5 with DefineStaticWebAssetEndpoints task error

Description: After updating Visual Studio 2022 to version 17.14.5, Blazor projects that previously compiled without issue now fail during build with the following error:
The “DefineStaticWebAssetEndpoints” task failed unexpectedly.
System.InvalidOperationException: Last write time for ‘MainLayout.razor.rz.scp.css’ is not defined.

Key observations:

The exact same codebase builds correctly on another machine running Visual Studio 17.14.5.

Reverting the affected machine to a previous version of Visual Studio resolves the issue.

The failure occurs in projects targeting .NET 8 / C# 12.

Both .NET SDK 8.0.400 and 9.0.301 are installed on the affected machine.

Steps already taken:

Manual deletion of bin and obj folders.

Cleaning MSBuild and NuGet caches.

Verifying disk health and system clock sync.

Forcing SDK 8.0.400 via global.json.

Isolating and temporarily removing .NET SDK 9.0.301.

Running Visual Studio in Safe Mode.

Repairing Visual Studio installation.

Comparing environment variables between working and failing machines.

Full clean reinstall of Visual Studio.

Scoped CSS files are being generated, but the timestamp error persists.

Based on online reports, it appears Visual Studio/MSBuild might inadvertently resolve static web asset tasks from the latest installed SDK (in this case 9.0.301), even when targeting .NET 8. This behavior did not exist prior to 17.14.5.

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.Needs: Author FeedbackThe author of this issue needs to respond in order for us to continue investigating this issue.area-blazorIncludes: Blazor, Razor Components

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions