-
-
Notifications
You must be signed in to change notification settings - Fork 158
Cannot consume scoped service IGenericProcessorFactory from singleton IOperationProcessorResolver #339
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
Comments
If you’re using operations, I highly recommend upgrading all the way to 2.4.0-beta1. We are currently dogfooding this release which is why it is in beta but it has some essential fixes. |
@jaredcnance I also tried updating to the beta release - the error persists. Btw, I find the operations feature extremely useful, so I really do hope that this feature won't get dumped :) |
Operations are a high priority for us and are definitely not getting dumped 😄. I don't believe the error is actually related to the version of the SqlServer provider but the lib itself. It looks like it is caused by overwriting the service registration for JsonApiDotNetCore/src/JsonApiDotNetCore/Extensions/IServiceCollectionExtensions.cs Line 163 in 404231b
JsonApiDotNetCore/src/JsonApiDotNetCore/Extensions/IServiceCollectionExtensions.cs Line 138 in 404231b
But really I think services.AddJsonApi();
services.AddScoped<IOperationProcessorResolver, OperationProcessorResolver>(); |
This does indeed fix the issue. This issue actually might have originated a long time ago, since I did this in an old service, although from what I can remember only for debugging purposes. |
fix(ServiceCollectionExtensions): correct service scoping
This has been fixed in v2.4.0-beta2. |
Attempted to update from version 2.2.3 to the latest stable 2.3.3
As a consequence had to update Microsoft.EntityFrameworkCore.SqlServer and Microsoft.EntityFrameworkCore.Tools from 2.0.3 to 2.1.1
After that operations stopped working with the following error message:
Upon investigation I found out that updating either Microsoft.EntityFrameworkCore.SqlServer or Microsoft.EntityFrameworkCore.Tools to version 2.1.0+ brakes the operations - no matter the version of JAPDNC.
The dependency to SqlServer comes from this line in my startup:
services.AddDbContext<DomainDbContext>(options => options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")), ServiceLifetime.Transient);
The text was updated successfully, but these errors were encountered: