The Razor Pages or MVC portion of the app treats scoped services normally and recreates the services on each HTTP request when navigating among pages or views or from a page or view to a component.
ASP.NET Core Blazor dependency injection
You could try injecting Singleton
service. Singleton DI creates a single instance of the service. All components requiring a Singleton service receive an instance of the same service.
------
If the answer doesn’t solve your issue, please provide more details of error that will help us track down what’s happening.
If the answer is helpful, please click "Accept Answer" and vote it up.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best Regards,
Michael Wang