You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have registered one inteface as below to scope against each new request (http request).
registrator.RegisterMany(Reuse.Scoped);
I have interface ICurrentRequest which has implementation over CurrentRequest class.
I am trying to resolve above in my application using below code:
private readonly IServiceProvider _serviceProvider;
Consider _serviceProvider is getting initialized in constructor of application class
var currentHttpRequest= _serviceProvider.GetService();
Here i am not getting this and getting error like object reference not set to an instance of object. This is happening only for Reuse.Scoped, rest all like singelton or transient working fine.
I am getting this error only after upgrading to latest .Net 9 and latest DryIoc 6.2.0, earlier i was using .Net 6 & DryIoc 4.0.2 where it was working pefectly fine. It seems something has changed in DryIoc from 4.0.2 to 6.2.0 on handling Scoped.
Any help would be much appreciated as i am unable to find any such change documentation in release version.
The text was updated successfully, but these errors were encountered:
I have registered one inteface as below to scope against each new request (http request).
registrator.RegisterMany(Reuse.Scoped);
I have interface ICurrentRequest which has implementation over CurrentRequest class.
I am trying to resolve above in my application using below code:
private readonly IServiceProvider _serviceProvider;
Consider _serviceProvider is getting initialized in constructor of application class
var currentHttpRequest= _serviceProvider.GetService();
Here i am not getting this and getting error like object reference not set to an instance of object. This is happening only for Reuse.Scoped, rest all like singelton or transient working fine.
I am getting this error only after upgrading to latest .Net 9 and latest DryIoc 6.2.0, earlier i was using .Net 6 & DryIoc 4.0.2 where it was working pefectly fine. It seems something has changed in DryIoc from 4.0.2 to 6.2.0 on handling Scoped.
Any help would be much appreciated as i am unable to find any such change documentation in release version.
The text was updated successfully, but these errors were encountered: