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 <noreply@anthropic.com>
This commit is contained in:
parent
156b9c46e1
commit
2d8f92dde9
1 changed files with 11 additions and 0 deletions
|
|
@ -2,5 +2,16 @@
|
|||
<PropertyGroup>
|
||||
<RootNamespace>Yavsc</RootNamespace>
|
||||
<NoWarn>NU1701, NU1901, NU1902, NU1507</NoWarn>
|
||||
<!-- Disable the StaticWebAssets build cache (the *.dswa.cache.json
|
||||
files written under obj/.../ by DefineStaticWebAssets).
|
||||
ReadOrCreateCache opens them with File.OpenRead and 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). The cache is a pure
|
||||
build-speed optimization; turning it off has no effect on
|
||||
output correctness, only on incremental rebuild speed of
|
||||
the (wwwroot-light) web projects. -->
|
||||
<StaticWebAssetsCacheDefineStaticWebAssetsEnabled>false</StaticWebAssetsCacheDefineStaticWebAssetsEnabled>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
|
|
|||
Loading…
Reference in a new issue