-
Notifications
You must be signed in to change notification settings - Fork 25
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
Feature request: Ability to configure IBlazorDownloadFileService lifetime #20
Comments
I will take a look on how to implement this when I have some free time. You can fork and make pull request if you want to contribute. |
I took a look on the web and looks easy to implement. |
|
The new api allows specifying System.InvalidOperationException: Cannot resolve scoped service 'Microsoft.JSInterop.IJSRuntime' from root provider.
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteValidator.ValidateResolution(Type serviceType, IServiceScope scope, IServiceScope rootScope)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceProviderEngineCallback.OnResolve(Type serviceType, IServiceScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
...
... Probably |
I never test changing the lifetime of the service. Now that I remember, initially I tried setting There was a explanation for this and is when you declare a In general explanation: if you are setting up a service than depends on another service the When you use But doing this I don't think it's a good idea. It may broke the Service at any time. I don't think there is not anything else I can do here. Why are you needing |
I think what you are saying is that singleton services are immediately initialized while their dependencies may not have been initialized yet. Why are you needing I'm queueing jobs using Hangfire. |
I can recommend you 2 options:
Let me know if any of those options worked for you. If not let me know so I will add the modifications to make |
Still got the error: System.InvalidOperationException: JavaScript interop calls cannot be issued at this time. This is because the component is being statically rendererd. When prerendering is enabled, JavaScript interop calls can only be performed during the OnAfterRenderAsync lifecycle method. I'm thinking of a simpler approach to have a single Job which will call dependent |
Try using The |
I need a singleton instance of
BlazorDownloadFileService
(internal
class).Please allow configuring registering
IBlazorDownloadFileService
.Expected api:
EF.Core allows configuring
DbContext
lifetime.The text was updated successfully, but these errors were encountered: