Open Closed

Issue after updating to 7.4.0 and my custom LoginModel throwing DI issue #6048


User avatar
0
joe@tronactive.com created
  • ABP Framework version: v7.4.0
  • UI Type: Blazor Server
  • Database System: EF Core SQL Server
  • Tiered (for MVC) or Auth Server Separated (for Angular): no
  • Exception message and full stack trace:

Hello after updating to v7.4.0 (I did not seem to have this issue in 7.3.3) I am not getting an exception from my custom LoginModel. It seems to be something to do with the ImageSharpImageCompressorContributor. I tried adding the a DependsOn AbpImagingImageSharpModule and then configuring the "ImageSharpCompressOptions" but that didn't seem to work at all. Do you have any ideas why I would be getting the below exception after updating to 7.4.0?

Autofac.Core.DependencyResolutionException: An exception was thrown while activating Cure8.Blazor.Pages.Account.Cure8LoginModel -> Volo.Abp.Account.AccountAppService -> Volo.Abp.Imaging.ImageCompressor -> λ:Volo.Abp.Imaging.IImageCompressorContributor[] -> Volo.Abp.Imaging.ImageSharpImageCompressorContributor. ---> Autofac.Core.DependencyResolutionException: An exception was thrown while invoking the constructor 'Void .ctor(Microsoft.Extensions.Options.IOptions1[Volo.Abp.Imaging.ImageSharpCompressOptions])' on type 'ImageSharpImageCompressorContributor'. ---> System.MissingMethodException: Method not found: 'Void SixLabors.ImageSharp.Formats.Jpeg.JpegEncoder.set_Quality(System.Nullable1<Int32>)'. at Volo.Abp.Imaging.ImageSharpCompressOptions..ctor() at System.RuntimeType.CreateInstanceOfT() --- End of inner exception stack trace --- at Autofac.Core.Activators.Reflection.BoundConstructor.Instantiate() at Autofac.Core.Activators.Reflection.ReflectionActivator.<>c__DisplayClass14_0.<UseSingleConstructorActivation>b__0(ResolveRequestContext ctxt, Action1 next) at Autofac.Core.Resolving.Middleware.DisposalTrackingMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Builder.RegistrationBuilder3.<>c__DisplayClass41_0.<PropertiesAutowired>b__0(ResolveRequestContext ctxt, Action1 next) at Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action1 next) --- End of inner exception stack trace --- at Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Middleware.SharingMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Middleware.CircularDependencyDetectorMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, ResolveRequest request) at Autofac.Core.Resolving.ResolveOperation.ExecuteOperation(ResolveRequest request) at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable1 parameters, Object& instance) at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable1 parameters) at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType, IEnumerable`1 parameters) at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType) at Autofac.Extensions.DependencyInjection.AutofacServiceProvider.GetRequiredService(Type serviceType) at Volo.Abp.AspNetCore.Mvc.UI.RazorPages.ServiceBasedPageModelActivatorProvider.<>c__DisplayClass0_0.


4 Answer(s)
  • User Avatar
    0
    joe@tronactive.com created

    Does anyone have any ideas on this? I wanted to add I deleted my version of LoginModel to narrow down the problem and I still had the same issue.

  • User Avatar
    0
    joe@tronactive.com created

    I found out what was causing this and have a kind of workaround, at least one that works for me. What was causing it is we use IronPDF for rendering of PDFs and it uses SixLabors.ImageSharp version 3.0.2 which has some missing or changes that the ImageCompressor and the ImageSharpImageResizerContributor was dependent on. I created my own versions of both those classes and set the attribute to [Dependency(ReplaceServices = true)] and ExposeServices of the interfaces. Since we do not use profile images I just left the methods with the throw new System.NotImplementedException. This seems to work but I would rather not do this. Any possibilities of updating SixLabors.ImageSharp to version 3.0.2?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Okay, we will.

  • User Avatar
    1
    liangshiwei created
    Support Team Fullstack Developer

    https://github.com/abpframework/abp/issues/17989

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11