Skip to content

[dotnet-sdk-9.0.100] DefineStaticWebAssetEndpoints on build throws FileNotFoundException: "Could not find file 'wwwroot\arrivalsÞpartures.jpg'" ( % character in file name ) #59246

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
atziasios opened this issue Dec 1, 2024 · 2 comments
Labels
area-blazor Includes: Blazor, Razor Components ✔️ Resolution: Duplicate Resolved as a duplicate of another issue Status: Resolved

Comments

@atziasios
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

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:

  • Create a .NET 9 Blazor WebAssembly project.
  • Add a file arrivals%Departures.jpg under wwwroot folder.
  • Build.

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

@ghost ghost added the area-blazor Includes: Blazor, Razor Components label Dec 1, 2024
@javiercn
Copy link
Member

javiercn commented Dec 2, 2024

@atziasios thanks for contacting us.

This seems to be a dupe of #58975

@javiercn javiercn closed this as not planned Won't fix, can't repro, duplicate, stale Dec 2, 2024
@javiercn javiercn added the ✔️ Resolution: Duplicate Resolved as a duplicate of another issue label Dec 2, 2024
@javiercn
Copy link
Member

javiercn commented Dec 2, 2024

We'll use the other issue to track it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components ✔️ Resolution: Duplicate Resolved as a duplicate of another issue Status: Resolved
Projects
None yet
Development

No branches or pull requests

2 participants