ImageSharp.Web icon indicating copy to clipboard operation
ImageSharp.Web copied to clipboard

MissingMethodException thrown targeting latest version of AWSSDK.S3 library (v4.0.1.3)

Open peanutbutterlou opened this issue 8 months ago • 2 comments

Prerequisites

  • [x] I have written a descriptive issue title
  • [x] I have verified that I am running the latest version of ImageSharp.Web
  • [x] I have verified if the problem exist in both DEBUG and RELEASE mode
  • [x] I have searched open and closed issues to ensure it has not already been reported

ImageSharp.Web version

3.1.5

Other Six Labors packages and versions

SixLabors.ImageSharp.Web.Providers.AWS (v3.1.5)

Environment (Operating system, version and so on)

Windows

.NET version

9.0

Description

Here's a stack trace I'm getting:

System.MissingMethodException: Method not found: 'System.DateTime Amazon.S3.Model.GetObjectMetadataResponse.get_LastModified()'.
   at SixLabors.ImageSharp.Web.Resolvers.AWS.AWSS3StorageImageResolver.GetMetaDataAsync()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at SixLabors.ImageSharp.Web.Resolvers.AWS.AWSS3StorageImageResolver.GetMetaDataAsync()
   at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.<>c__DisplayClass23_0.<IsNewOrUpdatedAsync>b__0(String _)
   at SixLabors.ImageSharp.Web.Caching.ConcurrentTLruCache`2.GetOrAddAsync(TKey key, Func`2 valueFactory)
   at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.IsNewOrUpdatedAsync(IImageResolver sourceImageResolver, String key)
   at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.ProcessRequestAsync(ImageCommandContext imageCommandContext, IImageResolver sourceImageResolver, ImageContext imageContext, Boolean retry)
   at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.Invoke(HttpContext httpContext, Boolean retry)
   at Umbraco.Cms.Api.Management.Middleware.BackOfficeAuthorizationInitializationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()

The issue lies with a change to the AWSSDK.S3 library with its latest version. The Amazon.S3.Model.GetObjectMetadataResponse.LastModified property has changed to have a DateTime? property type, instead of the non-nullable DateTime type.

Steps to Reproduce

Simply compiling the SixLabors.ImageSharp.Web.Providers.AWS project with the latest version of the AWSSDK.S3 library (v4.0.1.3) should reproduce the issue.

Images

No response

peanutbutterlou avatar Jun 09 '25 19:06 peanutbutterlou

@peanutbutterlou Can you please ensure you look at existing PRs before opening issues.

See https://github.com/SixLabors/ImageSharp.Web/pull/385

JimBobSquarePants avatar Jun 09 '25 23:06 JimBobSquarePants

Dang. Sorry about that. Thanks for referencing the PR.

Might be a good idea to add checking existing PRs to the prerequisites checklist.

peanutbutterlou avatar Jun 10 '25 02:06 peanutbutterlou