From 92af3c042808ddb8ce05f4c6c2cd4f0acf44d39e Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sat, 19 Sep 2026 13:53:25 +0100 Subject: [PATCH] build: disable StaticWebAssets cache to stop MSB4018 race DefineStaticWebAssets.ReadOrCreateCache opens the *.dswa.cache.json files under obj/.../ via File.OpenRead with no try/catch, so under parallel solution builds a sharing-violation / TOCTOU race on the cache file escapes as MSB4018 and fails the whole build (seen on Yavsc.Blogs during the rc15 solution build). Set StaticWebAssetsCacheDefineStaticWebAssetsEnabled=false so CacheManifestPath is empty and ReadOrCreateCache short-circuits to a no-file-I/O path. The cache is a pure build-speed optimization; no effect on output correctness, only on incremental rebuild speed of the wwwroot-light web projects. Verified: Yavsc.Api (transitive web deps) and Yavsc.Blogs.Tests build clean, and zero *.dswa.cache.json files are produced. Refs: https://source.dot.net/Microsoft.NET.Sdk.StaticWebAssets.Tasks/DefineStaticWebAssets.Cache.cs.html https://github.com/dotnet/sdk/issues/49039 Co-Authored-By: Claude --- Directory.Build.props | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Directory.Build.props b/Directory.Build.props index 83d21579d..bf1bf8bcb 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -2,5 +2,16 @@ Yavsc NU1701, NU1901, NU1902, NU1507 + + false