Asp.net mvc 无法加载类型';ImageResizer.Util.BundleAttribute';

Asp.net mvc 无法加载类型';ImageResizer.Util.BundleAttribute';,asp.net-mvc,nopcommerce,imageresizer,Asp.net Mvc,Nopcommerce,Imageresizer,1月1日。我在我的托管网站上安装了NopCommerce-完全干净安装。NopCommerce使用VisualStudio中通过NuGet管理的ImageReszier组件 NopCommerce在同一天的本地安装上运行时没有出现任何问题,但当我尝试在托管网站上运行它时,我遇到了以下错误 无法加载类型“ImageResizer.Util.BundleAttribute” 我使用ImageResizer版本:4.0.4.934 Stack Trace: [TypeLoadException: C

1月1日。我在我的托管网站上安装了NopCommerce-完全干净安装。NopCommerce使用VisualStudio中通过NuGet管理的ImageReszier组件

NopCommerce在同一天的本地安装上运行时没有出现任何问题,但当我尝试在托管网站上运行它时,我遇到了以下错误

无法加载类型“ImageResizer.Util.BundleAttribute”

我使用ImageResizer版本:4.0.4.934

Stack Trace: 
[TypeLoadException: Could not load type 'ImageResizer.Util.BundleAttribute' from assembly 'ImageResizer, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null'.]
   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) +152
   System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments) +158
   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) +91
   System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent) +438
   System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType) +103
   System.Reflection.RuntimeAssembly.GetCustomAttributes(Type attributeType, Boolean inherit) +64
   WebActivator.AssemblyExtensions.GetActivationAttributes(Assembly assembly) +126
   WebActivator.ActivationManager.RunActivationMethods() +220
   WebActivator.ActivationManager.RunPreStartMethods() +28
   WebActivator.ActivationManager.Run() +61

[InvalidOperationException: The pre-application start initialization method Run on type WebActivator.ActivationManager threw an exception with the following error message: Could not load type 'ImageResizer.Util.BundleAttribute' from assembly 'ImageResizer, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null'..]
   System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(ICollection`1 methods, Func`1 setHostingEnvironmentCultures) +613
   System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +141
   System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +102
   System.Web.Compilation.BuildManager.ExecutePreAppStart() +157
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +531

[HttpException (0x80004005): The pre-application start initialization method Run on type WebActivator.ActivationManager threw an exception with the following error message: Could not load type 'ImageResizer.Util.BundleAttribute' from assembly 'ImageResizer, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null'..]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9923092
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +90
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +261

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.114.0

问题解决了。我最终删除了所有内容,并再次进行了干净的安装。现在它开始工作了

您可能下载了错误的插件S3Reader或AzureReader。
如果您使用的是S3,请将nuget package
ImageResizer.Plugins.S3Reader
替换为
ImageResizer.Plugins.S3Reader2
我遇到了同样的问题,在删除bin文件夹中的所有内容并重建解决方案后,它对我起到了作用

嘿,我也面临着同样的问题,请你告诉我解决同样问题的确切步骤,我已经尝试过清理,但没有运气。