我已经卸载了AWS包,然后是Imageresizer包。在安装过程中将它们翻转,但仍然会遇到同样的问题。
显然,当我没有加载S3插件时,它会工作,所以我应该在这里尝试一下吗?
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
答案 0 :(得分:1)
当前(3.4.1)S3Reader插件与AWSSDK 2. *版本不兼容。
转到包管理器:
1)卸载S3Reader插件
Uninstall-Package ImageResizer.Plugins.S3Reader -ProjectName YourProjectName
2)卸载AWSSDK
Uninstall-Package AWSSDK -ProjectName YourProjectName
3)安装AWSSDK 1.5。*版本(最新版本为1.5.39.0)
Install-Package AWSSDK -ProjectName YourProjectName -Version 1.5.39.0
4)安装S3Reader插件,忽略依赖关系
Install-Package ImageResizer.Plugins.S3Reader -ProjectName YourProjectName-IgnoreDependencies
那应该解决你的问题!! 干杯......
答案 1 :(得分:0)
显示此方法丢失或未找到的错误“Void Amazon.S3.AmazonS3Config.set_CommunicationProtocol(Amazon.S3.Model.Protocol)”
检查你的sdk并且lib路径不正确。
答案 2 :(得分:0)
我们发布了ImageResizer 3.4.2,它修复了S3Reader的这个问题 - 还包括S3Reader2,它与新改版的AWSSDK 2.0一起使用。
在我们发布3.4.2之前,您需要在packages.config中手动指定AWSSDK nuget包,以防止它安装2.0 beta:
<package id="AWSSDK" targetFramework="net45" allowedVersions="(,2.0)"></package>