未能加载类型“ImageResizer.Util.BundleAttribute”

问题描述 投票:1回答:3

在1月1日。我安装在我的托管网站NopCommerce - 完整的全新安装。 NopCommerce使用通过的NuGet在Visual Studio管理的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
asp.net-mvc nopcommerce imageresizer
3个回答
1
投票

问题解决了。我最终删去,并再次做了一个干净的安装。现在,它的工作。


0
投票

您可以下载错误插件S3Reader或AzureReader。如果您正在使用S3替换ImageResizer.Plugins.S3Reader NuGet包ImageResizer.Plugins.S3Reader2


0
投票

我面临着同样的问题,并删除在bin文件夹中的一切,重建后的解决方案,它为我工作!

© www.soinside.com 2019 - 2024. All rights reserved.