Could not load file or assembly 'Spring.Core, ...' - asp.net-mvc-3

Below follows the error generated:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Could not load file or assembly 'Spring.Core, Version=1.3.1.40711, Culture=neutral, PublicKeyToken=65e474d141e25e07' 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 'Spring.Core, Version=1.3.1.40711, Culture=neutral, PublicKeyToken=65e474d141e25e07' 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 'Spring.Core, Version=1.3.1.40711, Culture=neutral, PublicKeyToken=65e474d141e25e07' could not be loaded.
=== Pre-bind state information ===
LOG: User = eggtech024-PC\eggtech024
LOG: DisplayName = Spring.Core, Version=1.3.1.40711, Culture=neutral, PublicKeyToken=65e474d141e25e07
(Fully-specified)
LOG: Appbase = file:///C:/Users/eggtech024/documents/visual studio 2010/Projects/SpringNet.NHibernate.Fluent/SpringNet.NHibernate.Fluent.Web/
LOG: Initial PrivatePath = C:\Users\eggtech024\documents\visual studio 2010\Projects\SpringNet.NHibernate.Fluent\SpringNet.NHibernate.Fluent.Web\bin
Calling assembly : Spring.Web, Version=1.3.1.40711, Culture=neutral, PublicKeyToken=65e474d141e25e07.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\eggtech024\documents\visual studio 2010\Projects\SpringNet.NHibernate.Fluent\SpringNet.NHibernate.Fluent.Web\web.config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Spring.Core, Version=1.3.1.40711, Culture=neutral, PublicKeyToken=65e474d141e25e07
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/db1ef6cb/60726545/Spring.Core.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/db1ef6cb/60726545/Spring.Core/Spring.Core.DLL.
LOG: Attempting download of new URL file:///C:/Users/eggtech024/documents/visual studio 2010/Projects/SpringNet.NHibernate.Fluent/SpringNet.NHibernate.Fluent.Web/bin/Spring.Core.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 'Spring.Core, Version=1.3.1.40711, Culture=neutral, PublicKeyToken=65e474d141e25e07' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
Spring.Context.Support.WebSupportModule..cctor() in c:\_svn\spring-net\tags\spring-net-1.3.1\src\Spring\Spring.Web\Context\Support\WebSupportModule.cs:125
[TypeInitializationException: The type initializer for 'Spring.Context.Support.WebSupportModule' threw an exception.]
Spring.Context.Support.WebSupportModule..ctor() +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) +98
System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache) +241
System.Activator.CreateInstance(Type type, Boolean nonPublic) +69
System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +1136
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +111
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) +23
System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args) +60
System.Web.Configuration.HttpModulesSection.CreateModules() +187
System.Web.HttpApplication.InitModules() +28
System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers) +828
System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context) +304
System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +107
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +327

Scour every project you have and make sure you are referencing the very same Spring dll on all of them and that its version matches whatever is defined in your web.config. Looks like you have a dll version mismatch going on.

Related

Server Error in '/' Application after build solution in Visual Studio

Im trying to sync my projects with Sitecore database but when I build the solution provided by Sitecore Learning (Clothing Company), my website is not loaded and an error appears. It was working fine before I try to build it.
`Server Error in '/' Application.
Could not load type 'Sitecore.HealthCheck.DependencyInjection.HealthChecksBuilder' from assembly 'Sitecore.Kernel, Version=13.0.0.0, Culture=neutral, PublicKeyToken=null'.
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.TypeLoadException: Could not load type 'Sitecore.HealthCheck.DependencyInjection.HealthChecksBuilder' from assembly 'Sitecore.Kernel, Version=13.0.0.0, Culture=neutral, PublicKeyToken=null'.
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:
[TypeLoadException: Could not load type 'Sitecore.HealthCheck.DependencyInjection.HealthChecksBuilder' from assembly 'Sitecore.Kernel, Version=13.0.0.0, Culture=neutral, PublicKeyToken=null'.]
Sitecore.ContentSearch.SolrProvider.DependencyInjection.ContentSearchServicesConfigurator.AddContentSearchHealthChecks(IServiceCollection serviceCollection) +0
Sitecore.DependencyInjection.BaseServicesConfiguratorFactory.Configure(IServiceCollection serviceCollection) +171
Sitecore.DependencyInjection.BaseServicesConfiguratorFactory.Configure(IServiceCollection serviceCollection) +171
Sitecore.DependencyInjection.BaseServiceProviderBuilder.ConfigureServiceCollection() +142
Sitecore.DependencyInjection.ServiceLocator.ConfigureServiceProvider() +225
Sitecore.DependencyInjection.ServiceLocator.get_ServiceProvider() +513
Sitecore.DependencyInjection.SitecorePerRequestScopeModule..ctor() +13
[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) +142
System.Activator.CreateInstance(Type type, Boolean nonPublic) +107
System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) +1476
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +186
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) +28
System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args) +80
System.Web.HttpApplication.BuildIntegratedModuleCollection(List`1 moduleList) +234
System.Web.HttpApplication.GetModuleCollection(IntPtr appContext) +1153
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +139
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +168
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +277
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +369
[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +532
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +111
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +724`
Looking at error, it seems the Sitecore.Kernel.dll is getting replaced with different version in your website bin or your web.config file is getting replaced which might be having different assembly binding version info for Sitecore.kernel.dll.
I would suggest, check the Sitecore.kernel.dll version from your original website bin, in dotpeek.
Update Sitecore.kernel.dll of this version in your project solution via Nuget manager or update your DLL in your managed lib folder or DLL location folder.
Keep the assembly binding info in solution web.config as same as in the original web.config if you have.
If the DLL version is same both the place already, then load the Sitecore.kernel.dll in dotpeek, check for class Sitecore.HealthCheck.DependencyInjection.HealthChecksBuilder if there or not. If not, then some config file is having an entry for this class. Search word HealthChecksBuilder in App_config folder files, and comment the setting where you find and see if the site is up or not.
Then VS publish hope the issue gets resolved.

Could not load file or assembly error when running ASP.NET web api

I am developing a Xamarin.Forms app with ASP.NET Web Api with VS2019.
Somehow I when I run the web api project I am getting this error regarding
Xamarin.Forms.Xaml which has no reference to it in my web api.
Could not load file or assembly 'Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
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.FileNotFoundException: Could not load file or assembly 'Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
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 'Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' could not be loaded.
=== Pre-bind state information ===
LOG: DisplayName = Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///C:/Users/Malcolm/Documents/Visual Studio 2019/Projects/LakesLinenOrdersApp/LakesLinenOrdersApi/
LOG: Initial PrivatePath = C:\Users\Malcolm\Documents\Visual Studio 2019\Projects\LakesLinenOrdersApp\LakesLinenOrdersApi\bin
Calling assembly : GUI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
This is the Stack Trace:
[FileNotFoundException: Could not load file or assembly 'Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.]
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) +151
System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments) +135
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) +92
System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent) +502
System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType) +108
System.Reflection.RuntimeAssembly.GetCustomAttributes(Boolean inherit) +40
Owin.Loader.DefaultLoader.SearchForStartupAttribute(String friendlyName, IList1 errors, Boolean& conflict) +106
Owin.Loader.DefaultLoader.GetDefaultConfiguration(String friendlyName, IList1 errors) +46
Owin.Loader.DefaultLoader.LoadImplementation(String startupName, IList1 errorDetails) +75
Owin.Loader.DefaultLoader.Load(String startupName, IList1 errorDetails) +21
Microsoft.Owin.Host.SystemWeb.OwinBuilder.GetAppStartup() +115
Microsoft.Owin.Host.SystemWeb.OwinHttpModule.InitializeBlueprint() +28
System.Threading.LazyInitializer.EnsureInitializedCore(T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory) +119
Microsoft.Owin.Host.SystemWeb.OwinHttpModule.Init(HttpApplication context) +106
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +552
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +181
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +228
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +314
[HttpException (0x80004005): Could not load file or assembly 'Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +10085052
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +99
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +263

report viewer 14 error: Failed to load expression host assembly

I have a simple .rdlc file which has a parameter defined, when i fill(send) a value to the parameter, i get the error:
Failed to load expression host assembly.
Details: Type 'System.Web.HttpContextWrapper'
in assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
is not marked as serializable.
however, removing the value for the parameter, renders report without any problem.
ReportViewer1.LocalReport.DataSources.Clear();
ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/Report/report1.rdlc");
//If following line commented, there is no problem,
//and report is rendered correctly.
ReportViewer1.LocalReport.SetParameters(new ReportParameter("test1", "some value"));
ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", Data));
ReportViewer1.DataBind();
target .net framework is : 4.5.2, project is asp.net webform(web application), Microsoft.ReportingServices.ReportViewerControl.WebForms version 140.1000.523 is added by nuget.
update
I have added System.Web as reference to rdlc file, and now get full error:
[SerializationException: Type 'System.Web.HttpContextWrapper' in assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not marked as serializable.]
System.AppDomain.CreateInstanceFromAndUnwrap(String assemblyName, String typeName) +0
Microsoft.ReportingServices.Diagnostics.AssemblyLocationResolver.CreateResolver(AppDomain tempAppDomain) +98
Microsoft.ReportingServices.RdlExpressions.ExprHostCompiler.ResolveAssemblylocations(List`1 codeModules, CompilerParameters options, ErrorContext errorContext, AppDomain compilationTempAppDomain) +35
Microsoft.ReportingServices.RdlExpressions.ExprHostCompiler.InternalCompile(AppDomain compilationTempAppDomain, Boolean refusePermissions) +377
Microsoft.ReportingServices.RdlExpressions.<>c__DisplayClass2.<Compile>b__0() +19
Microsoft.ReportingServices.Diagnostics.<>c__DisplayClass1.<Run>b__0(Object state) +116
System.Security.SecurityContext.Run(SecurityContext securityContext, ContextCallback callback, Object state) +13049529
Microsoft.ReportingServices.Diagnostics.RevertImpersonationContext.Run(ContextBody callback) +99
Microsoft.ReportingServices.RdlExpressions.ExprHostCompiler.Compile(IExpressionHostAssemblyHolder expressionHostAssemblyHolder, AppDomain compilationTempAppDomain, Boolean refusePermissions, PublishingVersioning versioning) +184
Microsoft.ReportingServices.ReportPublishing.ReportPublishing.Phase3(ParameterInfoCollection& parameters, Dictionary`2& groupingExprCountAtScope) +1445
Microsoft.ReportingServices.ReportPublishing.ReportPublishing.InternalCreateIntermediateFormat(Stream definitionStream, String& description, String& language, ParameterInfoCollection& parameters, DataSourceInfoCollection& dataSources, DataSetInfoCollection& sharedDataSetReferences, UserLocationFlags& userReferenceLocation, ArrayList& dataSetsName, Boolean& hasExternalImages, Boolean& hasHyperlinks, Byte[]& dataSetsHash) +125
Microsoft.ReportingServices.ReportPublishing.ReportPublishing.CreateIntermediateFormat(Byte[] definition, String& description, String& language, ParameterInfoCollection& parameters, DataSourceInfoCollection& dataSources, DataSetInfoCollection& sharedDataSetReferences, UserLocationFlags& userReferenceLocation, ArrayList& dataSetsName, Boolean& hasExternalImages, Boolean& hasHyperlinks, Byte[]& dataSetsHash) +82
Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CompileOdpReport(PublishingContext reportPublishingContext, PublishingErrorContext errorContext, String& reportDescription, String& reportLanguage, ParameterInfoCollection& parameters, DataSourceInfoCollection& dataSources, DataSetInfoCollection& sharedDataSetReferences, UserLocationFlags& userReferenceLocation, ArrayList& dataSetsName, Boolean& hasExternalImages, Boolean& hasHyperlinks, Byte[]& dataSetsHash) +122
Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CreateIntermediateFormat(PublishingContext reportPublishingContext) +192
[ReportProcessingException: An unexpected error occurred in Report Processing.]
Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CreateIntermediateFormat(PublishingContext reportPublishingContext) +1006
Microsoft.Reporting.ReportCompiler.CompileReport(ICatalogItemContext context, Byte[] reportDefinition, Boolean generateExpressionHostWithRefusedPermissions, ControlSnapshot& snapshot) +195
[DefinitionInvalidException: The definition of the report 'F:\*****************\report1.rdlc' is invalid.]
Microsoft.Reporting.ReportCompiler.CompileReport(ICatalogItemContext context, Byte[] reportDefinition, Boolean generateExpressionHostWithRefusedPermissions, ControlSnapshot& snapshot) +261
Microsoft.Reporting.LocalService.GetCompiledReport(PreviewItemContext itemContext, Boolean rebuild, ControlSnapshot& snapshot) +228
Microsoft.Reporting.LocalService.CompileReport() +29
Microsoft.Reporting.LocalService.Microsoft.Reporting.ILocalProcessingHost.CompileReport() +5
Microsoft.Reporting.WebForms.LocalReport.EnsureExecutionSession() +61
[LocalProcessingException: An error occurred during local report processing.]
Microsoft.Reporting.WebForms.LocalReport.EnsureExecutionSession() +149
Microsoft.Reporting.WebForms.LocalReport.SetParameters(IEnumerable`1 parameters) +57
Microsoft.Reporting.WebForms.Report.SetParameters(ReportParameter parameter) +48
***********.btnPrint_Click(Object sender, EventArgs e) in F:\************.cs:199
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9782450
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +204
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +12
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +15
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1639

Invalid Pointer error while debugging web application in visual studio 2015

I tried to run my web application using F5 key. I am getting invalid pointer error while debugging application.
Also getting below error in "ActivityLog.xml" file of visual studio.
CreateInstance failed for package [Microsoft.VisualStudio.TraceLogPackage.TraceLogPackage]Source: 'mscorlib' Description: Exception has been thrown by the target of an invocation.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.Diagnostics.HubExtensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
at Microsoft.VisualStudio.TraceLogPackage.TraceLogPackage..ctor()
--- End of inner exception stack trace ---
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Activator.CreateInstance(String assemblyString, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(String assemblyName, String typeName)
at System.AppDomain.CreateInstance(String assemblyName, String typeName)System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.Diagnostics.HubExtensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
The system cannot find the file specified. File name: 'Microsoft.VisualStudio.Diagnostics.HubExtensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at Microsoft.VisualStudio.TraceLogPackage.TraceLogPackage..ctor() WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
I tried many solutions listed as below..
Clear temp files
Reset visual studio environment
Restart system
Repair Visual Studio 2015
But still I am not able to fix this issue. Please help me this fix this.

Could not load file or assembly 'PagedList, Version=1.10.0.0

In an APS.Net MVC 3 application, I upgraded from PagedList 1.10 to 1.12, and since then I am getting the following error message:
Could not load file or assembly 'PagedList, Version=1.10.0.0, Culture=neutral, PublicKeyToken=abbb863e9397c5e1' 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 'PagedList, Version=1.10.0.0, Culture=neutral, PublicKeyToken=abbb863e9397c5e1' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Source Error:
Line 140:
Line 141: kernel.Bind<IEmailService>().To<EmailService>();
Line 142: }
Line 143: }
Line 144:}
Source File: C:\*****\App_Start\NinjectMVC3.cs Line: 142
Assembly Load Trace: The following information can be helpful to determine why the assembly 'PagedList, Version=1.10.0.0, Culture=neutral, PublicKeyToken=abbb863e9397c5e1' could not be loaded.
Assembly manager loaded from: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable C:\Program Files\IIS Express\iisexpress.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: User = **\**
LOG: DisplayName = PagedList, Version=1.10.0.0, Culture=neutral, PublicKeyToken=abbb863e9397c5e1
(Fully-specified)
LOG: Appbase = file:///C:/*****/
LOG: Initial PrivatePath = C:\*****\bin
Calling assembly : MvcMembership, Version=3.4.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\*****\web.config
LOG: Using host configuration file: C:\Documents and Settings\jf\My Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: PagedList, Version=1.10.0.0, Culture=neutral, PublicKeyToken=abbb863e9397c5e1
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/b2f5bef1/b2ccbfbe/PagedList.DLL.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/b2f5bef1/b2ccbfbe/PagedList/PagedList.DLL.
LOG: Attempting download of new URL file:///C:/*****/bin/PagedList.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 'PagedList, Version=1.10.0.0, Culture=neutral, PublicKeyToken=abbb863e9397c5e1' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
UpDir.Web.App_Start.NinjectMVC3.RegisterServices(IKernel kernel) in C:\*****\App_Start\NinjectMVC3.cs:142
UpDir.Web.App_Start.NinjectMVC3.CreateKernel() in C:\*****\App_Start\NinjectMVC3.cs:53
Ninject.Web.Mvc.Bootstrapper.Initialize(Func`1 createKernelCallback) in c:\Projects\Ninject\Maintenance2.2\ninject.web.mvc\mvc3\src\Ninject.Web.Mvc\Bootstrapper.cs:61
UpDir.Web.App_Start.NinjectMVC3.Start() in C:\*****\App_Start\NinjectMVC3.cs:35
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner) +0
System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner) +72
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +335
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +28
System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +19
WebActivator.BaseActivationMethodAttribute.InvokeMethod() +221
WebActivator.ActivationManager.RunActivationMethods() +491
WebActivator.ActivationManager.RunPreStartMethods() +28
WebActivator.ActivationManager.Run() +55
[InvalidOperationException: The pre-application start initialization method Run on type WebActivator.ActivationManager threw an exception with the following error message: Exception has been thrown by the target of an invocation..]
System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +423
System.Web.Compilation.BuildManager.CallPreStartInitMethods() +306
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +677
[HttpException (0x80004005): The pre-application start initialization method Run on type WebActivator.ActivationManager threw an exception with the following error message: Exception has been thrown by the target of an invocation..]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9087676
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +256
I don't understand where this is coming from since I have the following lines in my Web.config file:
<dependentAssembly>
<assemblyIdentity name="PagedList" publicKeyToken="abbb863e9397c5e1" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.12.0.0" newVersion="1.12.0.0" />
</dependentAssembly>
I thought this would take care of it. I also tried emptying C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root and rebooting my machine, but it did not help.
I noticed in the error report that it is MvcMembership.dll that is calling PagedList.dll, but I don't know where it is specified to load version 1.10.
What can I try next?
I noticed in the error report that it is MvcMembership.dll that is
calling PagedList.dll, but I don't know where it is specified to load
version 1.10
In its references list. You will have to download a version of MvcMembership.dll which is compiled against PagedList.dll, Version = 1.12.0.0.

Resources