From c1ebc8387bd6a4a90b2aadedb05c2b906ffa5ca5 Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Sat, 14 Mar 2026 18:58:07 -0500 Subject: [PATCH] Strip fingerprint tokens from path in MaterializeFrameworkAsset MaterializeFrameworkAsset was using the asset's RelativePath directly as the destination file path. When RelativePath contains fingerprint tokens (e.g. 'dotnet.js#[.{fingerprint}]?.map'), those characters are illegal in Windows file paths, causing System.IO.IOException. Use ComputePathWithoutTokens() to strip the token expressions before constructing the materialized file path. The asset's RelativePath metadata (with tokens) is preserved for URL/endpoint resolution. Fixes dotnet/runtime#125329 CI failures. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/StaticWebAssetsSdk/Tasks/UpdatePackageStaticWebAssets.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/StaticWebAssetsSdk/Tasks/UpdatePackageStaticWebAssets.cs b/src/StaticWebAssetsSdk/Tasks/UpdatePackageStaticWebAssets.cs index eb4f727d79a6..fcac8d28126e 100644 --- a/src/StaticWebAssetsSdk/Tasks/UpdatePackageStaticWebAssets.cs +++ b/src/StaticWebAssetsSdk/Tasks/UpdatePackageStaticWebAssets.cs @@ -137,7 +137,8 @@ private void RemapEndpoints(Dictionary assetMapping) var oldIdentity = asset.Identity; var fxDir = Path.Combine(IntermediateOutputPath, "fx", originalSourceId); - var destPath = Path.Combine(fxDir, StaticWebAsset.Normalize(relativePath)); + var fileSystemRelativePath = asset.ComputePathWithoutTokens(relativePath); + var destPath = Path.Combine(fxDir, StaticWebAsset.Normalize(fileSystemRelativePath)); destPath = Path.GetFullPath(destPath); var sourceFile = asset.Identity;