Could not load file or assembly 'EPiServer.ApplicationModules' or one of its dependencies

Vote:
 

I can not run episerver because i get error: 

Could not load file or assembly 'EPiServer.ApplicationModules' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

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.IO.FileLoadException: Could not load file or assembly 'EPiServer.ApplicationModules' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

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.


Assembly Load Trace: The following information can be helpful to determine why the assembly 'EPiServer.ApplicationModules' could not be loaded.

=== Pre-bind state information ===
LOG: DisplayName = EPiServer.ApplicationModules
 (Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: EPiServer.ApplicationModules | Domain ID: 3
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///D:/work/FlinnScientificProject/flinn/src/FlinnScientific/
LOG: Initial PrivatePath = D:\work\FlinnScientificProject\flinn\src\FlinnScientific\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: D:\work\FlinnScientificProject\flinn\src\FlinnScientific\web.config
LOG: Using host configuration file: C:\Users\alexey.svetlenko\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Users/alexey.svetlenko/AppData/Local/Temp/Temporary ASP.NET Files/root/28e599a5/902d7713/EPiServer.ApplicationModules.DLL.
LOG: Attempting download of new URL file:///C:/Users/alexey.svetlenko/AppData/Local/Temp/Temporary ASP.NET Files/root/28e599a5/902d7713/EPiServer.ApplicationModules/EPiServer.ApplicationModules.DLL.
LOG: Attempting download of new URL file:///D:/work/FlinnScientificProject/flinn/src/FlinnScientific/bin/EPiServer.ApplicationModules.DLL.
LOG: Using application configuration file: D:\work\FlinnScientificProject\flinn\src\FlinnScientific\web.config
LOG: Using host configuration file: C:\Users\alexey.svetlenko\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Redirect found in application configuration file: 9.9.1.0 redirected to 9.10.2.0.
LOG: Post-policy reference: EPiServer.ApplicationModules, Version=9.10.2.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7
LOG: Attempting download of new URL file:///C:/Users/alexey.svetlenko/AppData/Local/Temp/Temporary ASP.NET Files/root/28e599a5/902d7713/EPiServer.ApplicationModules.DLL.
LOG: Attempting download of new URL file:///C:/Users/alexey.svetlenko/AppData/Local/Temp/Temporary ASP.NET Files/root/28e599a5/902d7713/EPiServer.ApplicationModules/EPiServer.ApplicationModules.DLL.
LOG: Attempting download of new URL file:///D:/work/FlinnScientificProject/flinn/src/FlinnScientific/bin/EPiServer.ApplicationModules.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Minor Version
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.


Stack Trace: 

[FileLoadException: Could not load file or assembly 'EPiServer.ApplicationModules' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]

[FileLoadException: Could not load file or assembly 'EPiServer.ApplicationModules, Version=9.10.2.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
   System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
   System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +36
   System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +152
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +77
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +21
   System.Reflection.Assembly.Load(String assemblyString) +28
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +38

[ConfigurationErrorsException: Could not load file or assembly 'EPiServer.ApplicationModules, Version=9.10.2.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +738
   System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +217
   System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130
   System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +170
   System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +92
   System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +290
   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): Could not load file or assembly 'EPiServer.ApplicationModules, Version=9.10.2.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7' 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) +9946132
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +90
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +261

and i clean:
1) bin/obj directories in solution;
2)  remove folder "/C:/Users/alexey.svetlenko/AppData/Local/Temp/Temporary ASP.NET Files"  as in screen:" http://screencast.com/t/msDKPicVQ8 "
3) remove all from folder: "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files"
4) remover all from folder: "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files"

I did it several times with restarting my pc.

What should i to do with it?

#150732
Edited, Jun 28, 2016 18:38
Vote:
 

I tried to update episerver (http://screencast.com/t/WOPpVwvo), but after it I got another problem: 

Server Error in '/' Application.

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

EpiServer cms show me error: "Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information."

Check the version of the EpiServer CMS: 9.10.2 (see screen) http://www.screencast.com/users/asvetlenko/folders/Jing/media/3b6d48a5-4e94-4025-b5e5-d838dd3260ed

After restart my PC
1) remover folders "Temporary ASP.NET Files"
1.1) clear temp in user directory: (see screen) http://screencast.com/t/FsrKghdhV0as
1.2) clear temp in window directory: (see screens) http://screencast.com/t/sUt6YwRroz ; http://screencast.com/t/oxrFCR84xIM
2) restart my PC
2) Remove all "obj" and "bin" forlders from all projects of the soultions EpiServer CMS: (see screen) http://screencast.com/t/mG8Ui2zv5T
3) Rebuilt successfully my solution in "VisualStudio": (see screen) http://screencast.com/t/HwXh1Obc4U
4) Run solution and get 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:


[No relevant source lines]

Source File: c:\Users\alexey.svetlenko\AppData\Local\Temp\Temporary ASP.NET Files\root\bba42f48\d6c99827\App_global.asax.0.cs Line: 0

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.RuntimeModule.GetTypes() +9
System.Reflection.Assembly.GetTypes() +70
EPiServer.Find.ClientConventions.<>c__DisplayClass5.<MarkAllImplementationsAsNested>b__3(Assembly a) +63
EPiServer.Find.Helpers.ListExtensions.ForEach(IEnumerable`1 value, Action`1 action) +194
EPiServer.Find.ClientConventions.NestedConventions.MarkAllImplementationsAsNested(Type declaringType, String name) +222
EPiServer.Find.ClientConventions.NestedConventions.ForInstancesOf(Expression`1 exp) +96
EPiServer.Find.ClientConventions.NestedConventionItemInstanceWrapper`1.Add(Expression`1 expr) +96
EPiServer.Find.Commerce.CatalogContentClientConventions.ApplyNestedConventions(NestedConventions nestedConventions) +376
EPiServer.Find.Commerce.CatalogContentClientConventions.ApplyConventions(IClientConventions clientConventions) +117
EPiServer.Find.Commerce.FindCommerceInitializationModule.Initialize(InitializationEngine context) +133
EPiServer.Framework.Initialization.Internal.<>c__DisplayClass3_0.<Initialize>b__0() +56
EPiServer.Framework.Initialization.Internal.ModuleNode.Execute(Action a, String key) +80
EPiServer.Framework.Initialization.Internal.ModuleNode.Initialize(InitializationEngine context) +141
EPiServer.Framework.Initialization.InitializationEngine.InitializeModules() +381

[InitializationException: Initialize action failed for Initialize on class EPiServer.Find.Commerce.FindCommerceInitializationModule, EPiServer.Find.Commerce, Version=9.6.0.138, Culture=neutral, PublicKeyToken=8fe83dea738b45b7]
EPiServer.Framework.Initialization.InitializationEngine.InitializeModules() +772
EPiServer.Framework.Initialization.InitializationEngine.ExecuteTransition(Boolean continueTransitions) +247
EPiServer.Framework.Initialization.InitializationEngine.Initialize() +68
EPiServer.Framework.Initialization.<>c.<FrameworkInitialization>b__7_0(InitializationEngine e) +36
EPiServer.Framework.Initialization.InitializationModule.EngineExecute(HostType hostType, Action`1 engineAction) +628
EPiServer.Framework.Initialization.InitializationModule.FrameworkInitialization(HostType hostType) +216
EPiServer.Global..ctor() +83
FlinnScientific.EPiServerApplication..ctor() +42
ASP.global_asax..ctor() in c:\Users\alexey.svetlenko\AppData\Local\Temp\Temporary ASP.NET Files\root\bba42f48\d6c99827\App_global.asax.0.cs:0

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +113
System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +206
System.Activator.CreateInstance(Type type, Boolean nonPublic) +83
System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) +1065
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +124
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) +20
System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args) +60
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +263
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296

[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9946132
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +90
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +261


#150733
Edited, Jun 28, 2016 18:50
Vote:
 

If you debug your code and break on all exceptions, the debugger will break where the exception is happening and then you can see the LoaderException. I will tell you exactly which assembly is not loading correctly.

It's probably an old deprecated assembly, or an assembly that didn't update correctly.

Do you have confguration file transformation in your project? Maybe you overwrote the assembly bindings after the upgrade when you compiled thed project.

#150735
Jun 28, 2016 20:16
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.