[dotnet-sdk-9.0.100] DefineStaticWebAssetEndpoints on build throws FileNotFoundException: "Could not find file 'wwwroot\arrivalsÞpartures.jpg'" ( % character in file name ) #59246
Labels
area-blazor
Includes: Blazor, Razor Components
✔️ Resolution: Duplicate
Resolved as a duplicate of another issue
Status: Resolved
Is there an existing issue for this?
Describe the bug
I have .net 8 solution including a blazorApp project with some images in wwwroot and I upgraded it to .net 9. When trying to build it I got the error:
"The "DefineStaticWebAssetEndpoints" task failed unexpectedly.
System.IO.FileNotFoundException: Could not find file 'wwwroot\arrivalsÞpartures.jpg'.
The actual file name is: "arrivals%Departures.jpg".
In general I saw this failing with other file names, too, containing the % character, after upgrading to .net 9.
OS: Windows 11 23H2
CPU: X64
.NET Build Number: dotnet-sdk-9.0.100 with VS 17.12.2
Expected Behavior
Build successfully.
Steps To Reproduce
Steps:
Attaching demo: BlazorApp1.zip
Exceptions (if any)
Build failed with this error:
The "DefineStaticWebAssetEndpoints" task failed unexpectedly.
System.IO.FileNotFoundException: Could not find file 'wwwroot\arrivalsÞpartures.jpg'.
File name: 'wwwroot\arrivalsÞpartures.jpg'
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileInfo.get_Length()
at Microsoft.AspNetCore.StaticWebAssets.Tasks.DefineStaticWebAssetEndpoints.GetFileLength(StaticWebAsset asset)
at Microsoft.AspNetCore.StaticWebAssets.Tasks.DefineStaticWebAssetEndpoints.CreateEndpoints(StaticWebAsset asset, ContentTypeProvider contentTypeMappings)
at Microsoft.AspNetCore.StaticWebAssets.Tasks.DefineStaticWebAssetEndpoints.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()
.NET Version
9.0.100
Anything else?
No response
The text was updated successfully, but these errors were encountered: