Skip to content

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

@peanutbutterlou

Description

@peanutbutterlou

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am running the latest version of ImageSharp.Web
  • I have verified if the problem exist in both DEBUG and RELEASE mode
  • 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions