Developer forum

Forum » Dynamicweb 9.0 Upgrade issues » Upgrading from 9.5.5 to 9.6.11 reflection error

Upgrading from 9.5.5 to 9.6.11 reflection error

Marie Louise Veigert
Reply

Hi,
I'm upgrading a solution from 9.5.5 to 9.6.12, but get an error after I build my solution with success. 

It works when I don't have dll's from the other projects in the bin folder. 

Anyone who have an idea of why the error comes? I have readded the references in my projects as well.

This is the error: 

Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

Source Error: 

 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace: 
 

[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.Assembly.GetTypes() +112
   System.ComponentModel.Composition.Hosting.AssemblyCatalog.get_InnerCatalog() +227
   System.ComponentModel.Composition.Hosting.AssemblyCatalog.GetExports(ImportDefinition definition) +13
   System.Linq.<SelectManyIterator>d__17`2.MoveNext() +295
   System.ComponentModel.Composition.Hosting.CatalogExportProvider.InternalGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition) +581
   System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports) +35
   System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExports(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports) +24
   System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition) +71
   System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports) +35
   System.ComponentModel.Composition.Hosting.ExportProvider.GetExports(ImportDefinition definition, AtomicComposition atomicComposition) +40
   System.ComponentModel.Composition.Hosting.AggregateExportProvider.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition) +195
   System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports) +35
   System.ComponentModel.Composition.Hosting.CompositionContainer.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition) +229
   System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports) +35
   System.ComponentModel.Composition.Hosting.ExportProvider.GetExports(ImportDefinition definition, AtomicComposition atomicComposition) +40
   System.ComponentModel.Composition.Hosting.ExportProvider.GetExportedValuesCore(String contractName) +84
   Dynamicweb.Extensibility.Providers.MefServiceLocator.DoGetAllInstances(Type serviceType) +101
   Dynamicweb.Extensibility.Providers.ServiceLocator.GetAllInstances(Type serviceType) +46

[ActivationException: Dynamicweb.Core.IApplicationAssembly
LoaderExceptions information:
Could not load type 'Dynamicweb.Content.Social.Adapter' from assembly 'Dynamicweb, Version=9.0.0.0, Culture=neutral, PublicKeyToken=null'.
Could not load type 'Dynamicweb.Content.Social.Metrics.PostMetrics' from assembly 'Dynamicweb, Version=9.0.0.0, Culture=neutral, PublicKeyToken=null'.
]
   Dynamicweb.Extensibility.Providers.ServiceLocator.GetAllInstances(Type serviceType) +156
   Dynamicweb.Extensibility.Providers.<GetAllInstances>d__9`1.MoveNext() +116
   Dynamicweb.Content.Management.Installation.GetApplicationAssembly() +113
   Dynamicweb.Content.Management.Installation.DynamicwebAssemblyVersionInformation() +26
   Dynamicweb.Content.Management.Installation..cctor() +29

[TypeInitializationException: The type initializer for 'Dynamicweb.Content.Management.Installation' threw an exception.]
   Dynamicweb.Content.Management.Installation.get_LicenseChecksum() +25
   Dynamicweb.Frontend._Closure$__._Lambda$__36-0(FileInfo file) +23
   System.Linq.Enumerable.FirstOrDefault(IEnumerable`1 source, Func`2 predicate) +174
   Dynamicweb.Frontend.GlobalAsaxHandler.SetupLicenseManager() +431
   Dynamicweb.Frontend.GlobalAsaxHandler.Application_Start(Object sender, EventArgs e) +191

[HttpException (0x80004005): The type initializer for 'Dynamicweb.Content.Management.Installation' threw an exception.]
   System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +520
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +176
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +165
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +267
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +341

[HttpException (0x80004005): The type initializer for 'Dynamicweb.Content.Management.Installation' threw an exception.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +523
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +107
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +688

 


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


Replies

 
Marie Louise Veigert
Reply

I solved the problem when I found some old dll'en which was moved from another folder into the bin, which must have been the problem.

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply

Hi Marie-Louise,

I'm glad to hear that you found the issue.

MEF can be tricky to debug, but when you see this exception it's most likely due to the issue that you describe: incompatible assemblies in the bin folder.

- Jeppe

 

You must be logged in to post in the forum