-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Description
This issue has been moved from a ticket on Developer Community.
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.