【问题标题】:System.TypeLoadException: "ImageResizer.Util.BundleAttribute"System.TypeLoadException:“ImageResizer.Util.BundleAttribute”
【发布时间】:2016-02-15 21:45:51
【问题描述】:

我尝试将 ImageResizer v3 迁移到 v4。升级后我不能调用 ImageResizer 甚至不支持页面。支持页面错误为:

[TypeLoadException: Der Typ "ImageResizer.Util.BundleAttribute" in der Assembly "ImageResizer, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null" konnte nicht geladen werden.]
   System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type) +0
   System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) +191
   System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments) +162
   System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg) +148
   System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent) +604
   System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType) +144
   System.Attribute.GetCustomAttributes(Assembly element, Type attributeType, Boolean inherit) +111
   System.Attribute.GetCustomAttribute(Assembly element, Type attributeType, Boolean inherit) +17
   System.Reflection.CustomAttributeExtensions.GetCustomAttribute(Assembly element) +60
   ImageResizer.Plugins.Basic.DiagnosticPageHandler.GenerateOutput(HttpContext context, Config c) +943
   ImageResizer.Plugins.Basic.DiagnosticPageHandler.ProcessRequest(HttpContext context) +168
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +904
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +98

我该如何解决这个问题?我卸载了模块并重新安装但没有运气:

ImageResizer.4.0.5
ImageResizer.Plugins.TinyCache.4.0.5

【问题讨论】:

标签: imageresizer


【解决方案1】:

您在 ImageResizer v3 中留下了 1 个或多个插件。您不能将 v3 插件与 v4 ImageResizer.dll 一起使用。

【讨论】:

  • 我已经检查了不止一次,并多次重建项目。据我所知,这个问题只有在我安装 TinyCache 4.0.5 插件时才会出现,没有 ImageResizer 4.0.5 会起作用。
  • 你能分享你的 /bin 文件夹中的 .dll 的完整列表吗?只有来自 V3 的 ImageResizer 插件会引用 ImageResizer.Util.BundleAttribute;它在 v4 中不再使用。
猜你喜欢
  • 2016-04-07
  • 1970-01-01
  • 1970-01-01
  • 2018-01-08
  • 2012-04-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多