Search code examples
c#asp.net-mvcamazon-s3imageresizer

imageresizer latest nuget update having issues with s3


  • i've finally gotten around to updating my mvc app to (Mvc 5, EF 6, Web Api 2 etc.) and now the only thing not working is the latest version of AWS SDK + Imageresizer as you can see here's the error message i'm getting below *

I have uninstalled the AWS package, then the Imageresizer package. Flipped them around as far as installation but still get the same issue.

Obviously, when I don't have the S3 plugin loaded it work so anymore things I should try here?

Method not found: 'Void    Amazon.S3.AmazonS3Config.set_CommunicationProtocol(Amazon.S3.Model.Protocol)'. 
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

 Exception Details: System.MissingMethodException: Method not found: 'Void Amazon.S3.AmazonS3Config.set_CommunicationProtocol(Amazon.S3.Model.Protocol)'.

Source Error: 

 An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace: 

[MissingMethodException: Method not found: 'Void Amazon.S3.AmazonS3Config.set_CommunicationProtocol(Amazon.S3.Model.Protocol)'.]
   ImageResizer.Plugins.S3Reader.S3Reader..ctor(NameValueCollection args) +0

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
   System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +190
   System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) +1136
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +128
   System.Activator.CreateInstance(Type type, Object[] args) +19
   ImageResizer.Configuration.PluginConfig.CreatePluginByType(Type t, NameValueCollection args) +1153
   ImageResizer.Configuration.PluginConfig.CreatePluginByName(String name, NameValueCollection args) +88
   ImageResizer.Configuration.PluginConfig.add_plugin_by_name(String name, NameValueCollection args) +63
   ImageResizer.Configuration.PluginConfig.loadPluginsInternal() +402
   ImageResizer.Configuration.PluginConfig.LoadPlugins() +102
   ImageResizer.Configuration.Config..ctor(ResizerSection config) +546
   ImageResizer.Configuration.Config.get_Current() +115
   ImageResizer.InterceptModule.get_conf() +36
   ImageResizer.InterceptModule.System.Web.IHttpModule.Init(HttpApplication context) +250
   System.Web.HttpApplication.InitModulesCommon() +80
   System.Web.HttpApplication.InitModules() +64
   System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers) +792
   System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context) +336
   System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +107
   System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +525

Solution

  • We've released ImageResizer 3.4.2, which fixes this problem with S3Reader - and also includes S3Reader2 which works with the newly revamped AWSSDK 2.0.


    Until we release 3.4.2, you'll need to manually specify the AWSSDK nuget package in packages.config to keep it from installing the 2.0 beta:

    <package id="AWSSDK" targetFramework="net45" allowedVersions="(,2.0)"></package>