-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Blazer Web App Scoped Service Instantiated Twice (pre-rendering disabled) #53804
Comments
Hello mrlife I have the same problem... Every time I use QuickGrid in my razor component it is initialized 2 times. My itemsprovider is used in the following way: `itemsProviderTestModel1 = async request =>
};` I tried different methods to avoid this, but without success... But I noticed that the problem persists only when pagination or virtualisation is used. I also discovered that when I use pagination and I want, for example, to press a button that, for example, opens a modal, itemsprovider it is fired even though the button is outside the Quickgrid component. |
@davidalexandru11, do you have pre-rendering disabled at the app level? |
mrlife Yes |
@mrlife thanks for contacting us. This is by design. You have the |
Hi, i have the same problem @davidalexandru11 -> pagination redners twice.
Is there any example here for help? |
Is there an existing issue for this?
Describe the bug
A scoped service is instantiated twice in an app with an interactive server render mode and no pre-rendering.
In my project, a razor component sets a value in the scoped service after the scoped service is instantiated the first time, but then it is instantiated again, causing the value to be lost.
Expected Behavior
A scoped service should be instantiated once when pre-rendering is disabled.
Steps To Reproduce
Please see the linked project. With a breakpoint in the
TestService
constructor, notice the breakpoint is hit twice due to the injection of the service in_Imports.razor
.https://github.com/mrlife/BlazorServiceInstantiation
Exceptions (if any)
No response
.NET Version
8.0.101
Anything else?
.NET SDK:
Version: 8.0.101
Commit: 6eceda187b
Workload version: 8.0.100-manifests.69afb982
Runtime Environment:
OS Name: Mac OS X
OS Version: 14.3
OS Platform: Darwin
RID: osx-arm64
Base Path: /usr/local/share/dotnet/sdk/8.0.101/
.NET workloads installed:
Workload version: 8.0.100-manifests.69afb982
[maui]
Installation Source: SDK 8.0.100
Manifest Version: 8.0.3/8.0.100
Manifest Path: /usr/local/share/dotnet/sdk-manifests/8.0.100/microsoft.net.sdk.maui/8.0.3/WorkloadManifest.json
Install Type: FileBased
Host:
Version: 8.0.1
Architecture: arm64
Commit: bf5e279d92
.NET SDKs installed:
7.0.311 [/usr/local/share/dotnet/sdk]
7.0.312 [/usr/local/share/dotnet/sdk]
8.0.100 [/usr/local/share/dotnet/sdk]
8.0.101 [/usr/local/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 7.0.14 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.15 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 7.0.14 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.15 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Other architectures found:
None
Environment variables:
Not set
global.json file:
Not found
The text was updated successfully, but these errors were encountered: