Skip to content
New issue

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

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

Already on GitHub? # to your account

[dotnet-sdk-10.0.100-preview.1.25110.2] Some blazor apps get "Failed to load resource: the server responded with a status of 404" error after retagrt to .NET 10 #60366

Open
1 task done
Junjun-zhao opened this issue Feb 13, 2025 · 5 comments

Comments

@Junjun-zhao
Copy link
Member

Junjun-zhao commented Feb 13, 2025

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

According to this bug, we need to retarget the blazor apps to corresponding .NET to use the required JaveScript.
When retargeting Blazorise and BlazorStrap apps to .NET 10, it still get "Failed to load resource: the server responded with a status of 404" error.
These blazor apps are big solution, which is difficult to locate where the issue is. We have retargeted all projects to .NET 10 and also the related asp.net core packages to 10.0.0-preview.1.*, but the problem still exists.

For Blazorise app, when launch the page with http://localhost:5000/docs, it failed to load the page and get the 404 error.
For BlazorStrap app, when launch the page with http://localhost:5000, it failed to load the page and get the 404 error.

Application Name: Blazorise,BlazorStrap
OS: Windows 10 22H2
CPU: X64
.NET Build Number: dotnet-sdk-10.0.100-preview.1.25110.2
App Source Location on repro machine checking at: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2382443
Github Link:
https://github.com/Megabit/Blazorise
https://github.com/chanan/BlazorStrap

Expected Behavior

Page load successful with left menu shows.

Image

Steps To Reproduce

App Repro Steps on repro machine:
The machine has dotnet-sdk-10.0.100-preview.1.25110.2 installed. Please get the repro machine information at devdiv bug

  1. Launch Blazorise.Docs.Server.exe from C:\Users\Test01\Desktop\App\Blazorise.
  2. Access http://localhost:5000/ from browser.
  3. Click Doc menu on the top of the page.

Exceptions (if any)

Page load without left side menu shows. And there is error "Failed to load resource: the server responded with a status of 404 (Not Found)" in browser Develop Tool:

Image

.NET Version

10.0.100-preview.1.25110.2

Anything else?

DotNet Info

.NET SDK:
Version:           10.0.100-preview.1.25110.2
 Commit:            014e3fbe98
 Workload version:  10.0.100-manifests.bf5105ba
 MSBuild version:   17.14.0-preview-25107-06+a51113d69

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.26100
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\10.0.100-preview.1.25110.2\

Host:
  Version:      10.0.0-preview.1.25080.5
  Architecture: x64
  Commit:       b98cabca12

.NET SDKs installed:
 10.0.100-preview.1.25110.2 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 10.0.0-preview.1.25107.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 10.0.0-preview.1.25080.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
 Microsoft.WindowsDesktop.App 10.0.0-preview.1.25080.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.

@dotnet-actwx-bot @dotnet/compat

@Junjun-zhao
Copy link
Member Author

@mkArtakMSFT @javiercn Could you please help look into this issue and confirm if it is blocker for .NET 10 Preview1? Thanks.

@javiercn
Copy link
Member

@Junjun-zhao did you clean up the bin and obj folders?

@javiercn
Copy link
Member

Can we please start including the exact commits on each repo that these tests are run against? Otherwise, it makes investigations untractable.

@javiercn
Copy link
Member

It's unclear what upgrade steps you followed to re-target, but I suspect there is an issue in those steps. I was able to make this work
Image

@javiercn
Copy link
Member

Did a bit more of investigation. This is caused by the way their project is setup. Since we don't want to include the JS files in all projects, we use the presence of .razor files as a hint to include blazor.server.js and blazor.web.js.

These projects are setup in an unusual way that doesn't include any .razor file on the main project so as a result they don't get included.

There's a setting that can be used <RequiresAspNetWebAssets>true</RequiresAspNetWebAssets> to force the inclusion unconditionally.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants