Can't launch the installation page? - I get a cloud not load type: ImageResizer

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
8 years ago
Hi

I'm trying to deploy a vanilla compiled nopCommerce 3.7 on a hosted website. I get the following error when launching the installation page the first time - any idea why?

Could not load type 'ImageResizer.Util.BundleAttribute' from assembly 'ImageResizer, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null'.



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
8 years ago
Problems solved:

I ended up doing a clean install, and that fixed the problem.
8 years ago
We experienced this issue when updating ImageResizer to the latest version (using nuGet). So upgrade of this library should be ignored now
8 years ago
I am trying to start my website.
But the startup installation screens is not coming.
I uploaded the published code on the domain.
What are possible reasons ?
8 years ago
safehouse1111 wrote:
I am trying to start my website.
But the startup installation screens is not coming.
I uploaded the published code on the domain.
What are possible reasons ?


On going to browser it is showing me my default Parallels Plesk Panel page.
8 years ago
Has anyone solved this issue yet? I can't get past it. The nopCommerce site runs just fine on my desktop, pointing to my Azure website nop database. But, when I check my code into TFS and kick off a build and deployment to my Azure website, the build succeeds and the deployment succeeds, but then I get the following error on the Azure site:

Could not load type 'ImageResizer.Util.BundleAttribute' from assembly 'ImageResizer, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null'.

I have checked the Nuget package and updated the solution in both Nop.Services and Nop.Web to run 4.0.5, the latest version of ImageResizer. This did not fix it.

I need to launch this site. Any assistance would be much appreciated. Thanks!
8 years ago
I got past this error by opening up the "Manage Nuget Packages for Solution" window and updating EVERYTHING! I started with Consolidate tab, which resolves multi-version issues. Next I went to the Update tab, and updated like 17 packages to the latest version. MaxMind couldn't be updated because I'm running .Net 4.5.1 and there's a conflict in MaxMind for this version, but that hasn't caused any issues.

However, I'd like to note that I'm still getting Microsoft.Data.Edm.dll and Microsoft.Data.OData.dll could not be found errors. I'm able to resolve these errors by copying the DLL to the nopCommerce Plugins folder and referencing it directly from there, but I'm not sure why that's happening.

I'll update this post later when I've resolved all issues.
7 years ago
I can resolve it with update target framework of all project to dot net 4.6.1
NopCommerce version 3.8
ImageResizer 4.0.5
7 years ago
We've found out that this error happened when we have multiple versions of ImageResizer used. So just clean and re-build your solution. If it doesn't help, then manually find and remove all ImageResizer DLLs and then re-build the solution
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.