Upgrade from 2.20 to 2.30 Autofac error

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
Is the build referencing the wrong version?  The version in the bin is 2.3.2.830.

[ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.]
   System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) +0
   System.Reflection.RuntimeModule.GetTypes() +4
   System.Reflection.Assembly.GetTypes() +78
   Nop.Core.Infrastructure.AppDomainTypeFinder.FindClassesOfType(Type assignTypeFrom, IEnumerable`1 assemblies, Boolean onlyConcreteClasses) in f:\Own\NopCommerce\Sources\src\Libraries\Nop.Core\Infrastructure\AppDomainTypeFinder.cs:112

[Exception: Could not load file or assembly 'Autofac, Version=2.5.1.827, Culture=neutral, PublicKeyToken=17863af14b0044da' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
]
   Nop.Core.Infrastructure.AppDomainTypeFinder.FindClassesOfType(Type assignTypeFrom, IEnumerable`1 assemblies, Boolean onlyConcreteClasses) in f:\Own\NopCommerce\Sources\src\Libraries\Nop.Core\Infrastructure\AppDomainTypeFinder.cs:144
   Nop.Core.Infrastructure.AppDomainTypeFinder.FindClassesOfType(Boolean onlyConcreteClasses) in f:\Own\NopCommerce\Sources\src\Libraries\Nop.Core\Infrastructure\AppDomainTypeFinder.cs:92
   Nop.Core.Infrastructure.DependencyManagement.<>c__DisplayClass3.<Configure>b__0(ContainerBuilder x) in f:\Own\NopCommerce\Sources\src\Libraries\Nop.Core\Infrastructure\DependencyManagement\ContainerConfigurer.cs:36
   Nop.Core.Infrastructure.DependencyManagement.ContainerManager.UpdateContainer(Action`1 action) in f:\Own\NopCommerce\Sources\src\Libraries\Nop.Core\Infrastructure\DependencyManagement\ContainerManager.cs:161
   Nop.Core.Infrastructure.DependencyManagement.ContainerConfigurer.Configure(IEngine engine, ContainerManager containerManager, EventBroker broker, NopConfig configuration) in f:\Own\NopCommerce\Sources\src\Libraries\Nop.Core\Infrastructure\DependencyManagement\ContainerConfigurer.cs:34
   Nop.Core.Infrastructure.NopEngine.InitializeContainer(ContainerConfigurer configurer, EventBroker broker, NopConfig config) in f:\Own\NopCommerce\Sources\src\Libraries\Nop.Core\Infrastructure\NopEngine.cs:57
   Nop.Core.Infrastructure.NopEngine..ctor(EventBroker broker, ContainerConfigurer configurer) in f:\Own\NopCommerce\Sources\src\Libraries\Nop.Core\Infrastructure\NopEngine.cs:32
   Nop.Core.Infrastructure.NopEngine..ctor() in f:\Own\NopCommerce\Sources\src\Libraries\Nop.Core\Infrastructure\NopEngine.cs:24
   Nop.Core.Infrastructure.EngineContext.CreateEngineInstance(NopConfig config) in f:\Own\NopCommerce\Sources\src\Libraries\Nop.Core\Infrastructure\EngineContext.cs:55
   Nop.Core.Infrastructure.EngineContext.Initialize(Boolean forceRecreate) in f:\Own\NopCommerce\Sources\src\Libraries\Nop.Core\Infrastructure\EngineContext.cs:24
   Nop.Web.MvcApplication.Application_Start() in f:\Own\NopCommerce\Sources\src\Presentation\Nop.Web\Global.asax.cs:56

[HttpException (0x80004005): Could not load file or assembly 'Autofac, Version=2.5.1.827, Culture=neutral, PublicKeyToken=17863af14b0044da' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
]
   System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +9093225
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +131
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +194
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +339
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +253

[HttpException (0x80004005): Could not load file or assembly 'Autofac, Version=2.5.1.827, Culture=neutral, PublicKeyToken=17863af14b0044da' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9013676
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +256
12 years ago
No, nopCommerce 2.30 is provided with the latest Autofac version (2.5.2.830). Seems that your previously used assemblies were cached. Try to clear your temporary ASP.NET files (C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files) and restart IIS.
12 years ago
You need to upgrade your custom / downloaded plugin's as well.
12 years ago
Unfortunately I'm using Godaddy hosting and I have restarted the app pool many times.  That's as much control I have of IIS.  And I don't have any custom plug in.
Thanks for the response.  I'll keep trying.
12 years ago
Problem solved.
Not sure what it was, but I redeployed version 2.30 and my site is up and running.
Thanks!
12 years ago
I got the same error and found that AutofacContrib.Startable.dll was resident in the bin folder and was causing the issue. Removed and refreshed to fix.
12 years ago
I've been encountering this error myself.  Oddly enough, it appears to affect the server that I used the installer on to install nopCommerce on.  On my development box where I am working with the source code directly does not display this error at all.  I've been trying to figure out where the reference to the old version of Autofac is at on the server, but I haven't had any luck what-so-ever.  I've tried clearing the temporary asp.net files, and that does not appear to resolve the issue either.  Perhaps its some kind of registry key that is lingering?

Gecko
12 years ago
Got mine solved.  There was a copy of the previous Autofac version lingering in my source branch in the packages directory that was making its way into the build process.

Gecko
12 years ago
Not sure if this is the fix or if it was a cache problem, but I deleted AutofacContrib.Restartable.dll from the bin directory of the webroot on the site on it seemed to fix itself.
12 years ago
So at least I *THOUGHT* I had this error resolved, but has come back with a vengenance.  Could someone who knows more about Autofac please help track down where all the references to Autofac are?  I've found references all over the place and even though I delete them it seems like I'm always missing one.  Please help!  I've removed the old versions of the .DLL files, I've removed references to the old version in the packages directories, and I can't seem to find any other reason why this error would keep popping up!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.