dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.27k stars 9.96k forks source link

Blazor Streamrendering not working for the example weather app #56509

Closed AstroBrot closed 2 months ago

AstroBrot commented 3 months ago

Is there an existing issue for this?

Describe the bug

Hello, i am new to Blazor and already frustated, as the built in example with the weather page does not work as it should. It is the same issue already reported in #52323. Nothing of the example code has been changed. I Just created the solution with the weather example and clicked the run (https) button. As you guys already pushed a bug fix to I think .NET Runtime 8.0.4, I thought I will not have this issue anymore. But maybe it is a different source. (Running .NET Runtime 8.0.6) It does not matter if I run the solution with http, https or via IIS Express.

Here is what I have already tried:

Updating to the latest .NET Version (8.0.302). Updating to the latest VS 2022 Pro Version (17.10.3). Try every browser. Set up the solution multiple times. Restarting the PC ...

Expected Behavior

If you click the weather tab in the browser after starting the solution, it is expected to instantly jump onto the weather page, display "Loading..." and after 500ms show the updated weather table.

However in my case it starts loading at first before jumping onto the weather page and displays the weather page after the 500ms. I never see a "Loading..." as the StreamRendering does not work.

Steps To Reproduce

Create a Blazor Web App in VS 2022 with all the default settings (including the sample pages) and run it. A different Interactive render mode does not change anything.

Exceptions (if any)

No response

.NET Version

8.0.302

Anything else?

.NET SDK: Version: 8.0.302 Commit: ef14e02af8 Workload version: 8.0.300-manifests.ca8b4b2d MSBuild version: 17.10.4+10fbfbf2e

Laufzeitumgebung: OS Name: Windows OS Version: 10.0.19045 OS Platform: Windows RID: win-x64 Base Path: C:\Program Files\dotnet\sdk\8.0.302\

Installierte .NET-Workloads: [aspire] Installationsquelle: VS 17.10.35013.160 Manifestversion: 8.0.0/8.0.100 Manifestpfad: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.0.0\WorkloadManifest.json Installationstyp: FileBased

Host: Version: 8.0.6 Architecture: x64 Commit: 3b8b000a0e

.NET SDKs installed: 3.1.426 [C:\Program Files\dotnet\sdk] 7.0.120 [C:\Program Files\dotnet\sdk] 8.0.302 [C:\Program Files\dotnet\sdk]

.NET runtimes installed: Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.31 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 8.0.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.31 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 8.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.31 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 8.0.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found: x86 [C:\Program Files (x86)\dotnet] registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

javiercn commented 3 months ago

@AstroBrot thanks for contacting us.

Can you give us more details? It seems to be working fine.

image

https://github.com/dotnet/aspnetcore/assets/6995051/d90faedf-b47a-4c43-86a3-035bc2d325e8

AstroBrot commented 3 months ago

Hello @javiercn, here is a short video showing the problem with the Streamrendering not working. https://github.com/dotnet/aspnetcore/assets/174118667/8bea5d96-99e5-4aa0-82bb-526ce15c3762 What other details do you need?

javiercn commented 3 months ago

@AstroBrot we need a repro project as a public github repository that we can clone and run as well as the exact steps you are taking to run the project, including browser version and host (IIS or Kestrel)

Jason446620 commented 3 months ago

@AstroBrot I have reproduced the issue and also add my solution in your stackoverflow post, please kindly check it. https://stackoverflow.com/a/78700126/7687666

AstroBrot commented 2 months ago

@AstroBrot we need a repro project as a public github repository that we can clone and run as well as the exact steps you are taking to run the project, including browser version and host (IIS or Kestrel)

Hi @javiercn, I dont think that a repository is necessary, as it is the sample code directly from Visual Studio 2022 for a Blazor Web App. I did not touch the code at all. But here are the exact steps how I did it:

  1. Open VS 2022 (Version 17.10.3)
  2. New Project -> Blazor Web App -> Giving it a simple project name / project location in C:/ drive -> Continue
  3. Framework 8.0 -> Authentication type : None -> Configure for HTTPS -> Render mode: Server -> Interactive location: Per page/component -> Include sample pages
  4. Create
  5. Click on run HTTPS / HTTP / IIS
  6. Done

Anything else you need?

javiercn commented 2 months ago

@AstroBrot that's literally what we did, hence why we ask for a repro.

Even if you think that's all, there might be subtle details you didn't account for, hence why we ask for a repro that includes detailed steps you took to launch the app as well as any other information that might be useful (is there a proxy in your machine traffic gets routed through, for example).

I hope you understand that if we aren't able to observe the behavior ourselves, there's no way we can make progress to help you.

AstroBrot commented 2 months ago

Hi @javiercn, alright I created a public repository including my VS Project: https://github.com/AstroBrot/BlazorTestForGitHub And are the complete steps in a short screen recording: https://github.com/dotnet/aspnetcore/assets/174118667/fc986338-3dd8-4fc7-9a19-91afafe15a4a

All the other information you asked for can be found in my comment above. I am not using any IIS but Kestrel.

Best Julian

javiercn commented 2 months ago

@AstroBrot thanks for the additional details.

Do you have browserlink or hot reload enabled when you launch the app? If you run the application from the command line with dotnet run and visit the page, does it work?

AstroBrot commented 2 months ago

Hi @javiercn, So I disabled browser link and hot reload. It still does not work. I also run it via the console with the same result :(

javiercn commented 2 months ago

@AstroBrot thanks for the additional details and for enduring :).

We are looking for any software that might be buffering the response on your machine. The fact that you don't see it working even from the cli with dotnet run is a good indicator that something in your machine/environment is buffering the response, so we need to find what that might be.

For reference, I just tried your repro, and it works for me without issue.

Things that might be preventing this from working:

AstroBrot commented 2 months ago

@javiercn, thanks for the heads up!

javiercn commented 2 months ago

Yes it might be possible, that the firewall (managed by the company...) is blocking something. I am not able to just disable it to test it. Is there a specific rule (incoming/outgoing) i should check?

It completely depends on your company's firewall implementation, so we can't give more guidance (it's hard without being able to look at everything that's going on in an environment to determine what's causing the buffering), but essentially, anything that runs in between the browser and the server is susceptible of causing problems here.

One thing you can do is deploy the app to Azure or any other public location and access it with a different device like your mobile phone to confirm that's something on your environment, then try to identify what in your stack is causing problems.

Unfortunately, this is as much as we can help here, as there's no way for us to keep track of every piece of software that might be interfering with the response by buffering it, the best we can do is suggest common places to look, but it all depends on how your environment is configured.

dotnet-policy-service[bot] commented 2 months ago

This issue has been resolved and has not had any activity for 1 day. It will be closed for housekeeping purposes.

See our Issue Management Policies for more information.

darrelsilveira047 commented 1 month ago

I had a similar issue where stream rendering wasn't working, and I couldn't see the loading screen even after increasing the Task.Delay. Disabling my Kaspersky antivirus resolved the problem for me.

AstroBrot commented 4 weeks ago

Hi all, we finally found the issue!! The problem is our security software Sophos. The setting "Realtime Scanning -> Internet" is blocking something^^ Now we are looking for a solution :)