Open
Description
The issue is caused by a bug in the caching logic that we use.
The issue has been fixed in #48952 and a fix will be available in 9.0.301
Adding the following snippets should workaround the issue
<Target Name="RemoveCachedDuplicates" AfterTargets="ResolveProjectStaticWebAssets">
<ItemGroup>
<_UniqueAssets Include="@(StaticWebAsset->Distinct())" />
<StaticWebAsset Remove="@(_UniqueAssets)" />
<StaticWebAsset Include="@(_UniqueAssets)" />
</ItemGroup>
</Target>
<Target Name="_CleanupStaticWebAssetsCache" AfterTargets="Build">
<PropertyGroup>
<StaticWebAssetsCachePaths>
$(_ResolveBuildCompressedStaticWebAssetsCachePath);
$(_ResolveJsInitializerModuleStaticWebAssetsCachePath);
$(_ResolveJSModuleStaticWebAssetsRazorCachePath);
$(_ResolveJSModuleStaticWebAssetsCshtmlCachePath);
$(_ResolveProjectStaticWebAssetsCachePath)
</StaticWebAssetsCachePaths>
</PropertyGroup>
<ItemGroup>
<_CacheFilesToDelete Include="$(StaticWebAssetsCachePaths)" />
</ItemGroup>
<Delete Files="@(_CacheFilesToDelete)" Condition="Exists('%(_CacheFilesToDelete.Identity)')" />
</Target>
Alternatively, the SDK version can be pinned to a working version using a global.json file
{
"sdk": {
"version": "9.0.204",
"rollForward": "latestPatch"
}
}