1

Closed

assembly's manifest definition does not match the assembly reference

description

From a brand spanking new project in Visual Studio 11 Beta the first thing I did wast type the following in the package manager console:
      PM> install-package Mvc3ControlsToolkit
So far so good.
 
Updating Global.asax.cs file to register the core was the only other thing I did
 
protected void Application_Start()
    {
        MVCControlsToolkit.Core.Extensions.Register();
 
When I attempt to execute in debug mode I get the following:
 
Server Error in '/' Application.
 
Could not load file or assembly 'MVC3ControlsToolkit, Version=2.2.0.0, Culture=neutral, PublicKeyToken=b6277d1c804403e7' 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 'MVC3ControlsToolkit, Version=2.2.0.0, Culture=neutral, PublicKeyToken=b6277d1c804403e7' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
 
Source Error:
 
 
Line 8: public static void PreStart() {
Line 9: MVCControlsToolkit.Core.Extensions.Register();
Line 10: }
Line 11: }
Line 12: }
 
Source File: c:\Users\Jb\Documents\Visual Studio 11\Projects\MVC3ControlsToolkit\MVC3ControlsToolkit\App_Start\MySuperPackage.cs Line: 10
 
Assembly Load Trace: The following information can be helpful to determine why the assembly 'MVC3ControlsToolkit, Version=2.2.0.0, Culture=neutral, PublicKeyToken=b6277d1c804403e7' could not be loaded.
 
 
=== Pre-bind state information ===
LOG: User = Jb-laptop\Jb
LOG: DisplayName = MVC3ControlsToolkit, Version=2.2.0.0, Culture=neutral, PublicKeyToken=b6277d1c804403e7
(Fully-specified)
LOG: Appbase = file:///c:/users/jb/documents/visual studio 11/Projects/MVC3ControlsToolkit/MVC3ControlsToolkit/
LOG: Initial PrivatePath = c:\users\jb\documents\visual studio 11\Projects\MVC3ControlsToolkit\MVC3ControlsToolkit\bin

Calling assembly : MVC3ControlsToolkit, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.

LOG: This bind starts in default load context.
LOG: Using application configuration file: c:\users\jb\documents\visual studio 11\Projects\MVC3ControlsToolkit\MVC3ControlsToolkit\web.config
LOG: Using host configuration file: C:\Users\Jb\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: MVC3ControlsToolkit, Version=2.2.0.0, Culture=neutral, PublicKeyToken=b6277d1c804403e7
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/329a4ca7/6849099a/MVC3ControlsToolkit.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/329a4ca7/6849099a/MVC3ControlsToolkit/MVC3ControlsToolkit.DLL.
LOG: Attempting download of new URL file:///c:/users/jb/documents/visual studio 11/Projects/MVC3ControlsToolkit/MVC3ControlsToolkit/bin/MVC3ControlsToolkit.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Major Version
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
 
Stack Trace:
 
 
[FileLoadException: Could not load file or assembly 'MVC3ControlsToolkit, Version=2.2.0.0, Culture=neutral, PublicKeyToken=b6277d1c804403e7' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
MVC3ControlsToolkit.App_Start.MySuperPackage.PreStart() in c:\Users\Jb\Documents\Visual Studio 11\Projects\MVC3ControlsToolkit\MVC3ControlsToolkit\App_Start\MySuperPackage.cs:10
 
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +233
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +21
System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +19
WebActivator.BaseActivationMethodAttribute.InvokeMethod() +236
WebActivator.ActivationManager.RunActivationMethods() +370
WebActivator.ActivationManager.RunPreStartMethods() +41
WebActivator.ActivationManager.Run() +64
 
[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.InvokePreStartInitMethodsCore(ICollection1 methods, Func1 setHostingEnvironmentCultures) +550
System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +132
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath) +90
System.Web.Compilation.BuildManager.ExecutePreAppStart() +135
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +516
 
[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) +9775648
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +251
 
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17379
Closed by

comments

frankabbruzzese wrote Jul 20, 2012 at 1:48 PM

probably your project was a 4.5 dotnet project. The last release of the Mvc 3 toolkit just work with dotnet 4.0 either with Mvc 3 or with Mvc 4 RC.
What probably happened is that nuget was not able to find the right Mvc 4 dll and reverted to Mvc 3 dll...
Better tests will be possible with thi final releases of all tools.

frankabbruzzese wrote Jul 20, 2012 at 1:52 PM

Also possible you have installed Mv4 beta...in thius case yiu should pass to the Mvc4 RC