2012-02-06 3 views
0

Dans une application APS.Net MVC 3, je suis passé de PagedList 01.10 à 01.12, et depuis, je reçois le message d'erreur suivant:Impossible de charger le fichier ou l'assembly « PagedList, Version = 1.10.0.0

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 

Je ne comprends pas où cela vient puisque j'ai les lignes suivantes dans mon fichier web.config:

<dependentAssembly> 
    <assemblyIdentity name="PagedList" publicKeyToken="abbb863e9397c5e1" culture="neutral" /> 
    <bindingRedirect oldVersion="0.0.0.0-1.12.0.0" newVersion="1.12.0.0" /> 
    </dependentAssembly> 

Je pensais que cela prendrait soin d'elle. J'ai également essayé de vider C: \ WINDOWS \ Microsoft.NET \ Framework \ v4.0.30319 \ Temporary ASP.NET Files \ root et de redémarrer ma machine, mais cela n'a pas aidé.

J'ai remarqué dans le rapport d'erreurs que c'est MvcMembership.dll qui appelle PagedList.dll, mais je ne sais pas où il est spécifié de charger la version 1.10.

Que puis-je essayer?

Répondre

2

Je remarqué dans le rapport d'erreur est MvcMembership.dll qui est appeler PagedList.dll, mais je ne sais pas où il est spécifié pour charger la version 1,10

Dans ses références liste. Vous devrez télécharger une version de MvcMembership.dll qui est compilé avec PagedList.dll, Version = 1.12.0.0.

+0

Une telle version n'existait pas, j'ai donc téléchargé le code source de MvcMembership et l'ai recompilé avec PagedList 1.12. Il semble fonctionner maintenant, bien que je n'ai pas testé toutes les fonctionnalités de MvcMembership depuis la mise à niveau vers PagedList 1.12. Je pensais aussi que les lignes de Web.config que je publierais se chargeraient de rediriger vers la bonne version de PagedList. –

Questions connexes