-
Notifications
You must be signed in to change notification settings - Fork 66
Added sample demonstrating how to connect session with Blazor and WebForms #466
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
Conversation
…7/systemweb-adapters into blazor-session-sample
@dotnet-policy-service agree |
How is this different from this sample: https://github.com/dotnet/systemweb-adapters/tree/main/samples/WebFormsToBlazor |
My sample demonstrates sharing session data between Blazor and WebForms with HttpContext added in NET 8. The other sample demonstrates forwarding and displaying Blazor components in WebForms in NET 7. If it would make more sense to combine the two samples, I can do that. I just didn't want to jam everything into one sample. |
Yeah, let's have a one stop-shop for the the blazor/webforms sample. Both are helpful things to show, but it would be greato show how they may complement each other two (and verify that they do!) |
Ok, I will combine them and update the PR on Monday. |
@twsouthwick It looks like Blazor components in WebForms needs Blazor Interactive Server. I don't think I can combine the two unless System.Web.Adapters supports Blazor Interactive Server. As soon as blaozr.server.js loads, I can no longer navigate. |
added hello world component to blazor to replicate other sample
I think we want to figure out why that's happening then. We should be playing nicely with blazor, and if there are issues those should be addressed. If there are limitations that we can't work around, those should be addressed. |
It hangs in RemoteAppSessionStateManager when requesting from Counter (page with Interactive Server) to another page (using static rendering). The request gets to GetSessionDataAsync and hangs at the backchannel request. I set a breakpoint inside PostMapRequestHandler on the framework side and the request exits this event, so I am not sure where this could be holding up. If it doesn't succeed, it is because the request hits the 100 second timeout. If it works and finishes before the timeout (rare, but I have reproduced it a few times), I get a status code 400 from SetOrReleaseSessionState, but everything seems to be working fine until you repeat it by going from interactive server to another page. The current sample that I added can easily reproduce it. |
After further investigation (and gaining a better understanding of what his happening on both the blazor side and systemweb.adapters side), it looks like SessionLoadMiddleware is deadlocking on the blazor server request. When page is requested using InteractiveServer the following 3 requests come through the middelware
I am assuming 2 and 3 are from establishing the SignalR connection with Blazor interactive SSR. When request 3 (Connect) comes through, it will stay open until Blazor sends a disconnect request. Since it stays open, the session is not properly committed and will stay in the heartbeat loop on the framework side. There is probably a better way to do this, but to temporarily fix it while I edit my sample, I am adding the following:
|
Hi @pockets3407 @twsouthwick is the Issue #382 is resolved? and your new sample is ready to try? |
…t as FabricBot replacement Details on the replacement service and the syntax of the new yaml configuration file is available publicly at: https://microsoft.github.io/GitOps/policies/resource-management.html Please review and merge this PR to complete the process of onboarding to the new service.
FabricBot: Onboarding to GitOps.ResourceManagement because of FabricBot decommissioning
@twsouthwick Do you have any preference on my suggested fix to get this working with blazor server? Do you want me to open another pull request for it that is separate from the sample? |
* Update eng/common * Convert to 1ES pipelines * Self * Official * SDL
…stem.WebAdapters.
I manually added a workaround to the sample, so System.WebAdapters can be used with SignalR. @twsouthwick The sample is ready waiting to be approved. @erpardeepkaushik Feel free to use the sample on my branch. I am not sure when it will be committed to the repo. |
It is merged now. Ping me when it's ready and I'll review it. Sorry again for the delay |
added hello world component to blazor to replicate other sample
…stem.WebAdapters.
…7/systemweb-adapters into blazor-session-sample
added hello world component to blazor to replicate other sample
…stem.WebAdapters.
added hello world component to blazor to replicate other sample
…stem.WebAdapters.
…using System.WebAdapters." This reverts commit 8724304.
…rmsToBlazor sample" This reverts commit e954735.
This reverts commit 6e70f8b.
This reverts commit 1de99dd.
This reverts commit 279f6d8.
…using System.WebAdapters." This reverts commit 5881a97.
This reverts commit c868607.
…rmsToBlazor sample" This reverts commit 94248b9.
This reverts commit da61cc0.
This reverts commit 1123168.
This reverts commit 63890cd.
PR Title
Added sample demonstrating how to connect session with Blazor and WebForms
PR Description
Added sample demonstrating how to connect session with Blazor and WebForms
The only issue I have found is that I get an exception that breaks navigation. This occurs when I navigate from an InteractveServer page (Counter) to a static page (Home, Weather). I'm not sure if this is a different issue.
Addresses #382