Reputation: 45
I downloaded the web app from my company's server and running it on my machine. It works well except when I click on one of the menu items (all the others are good). It is showing me this error. I checked my web.config and the version I set for web.mvc is 4.0.0.0. I have no idea how is this happen.
I checked the similar problem on the websites but the solutions are not working for me. Here is the assembly load trace info that might be helpful:
Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.
=== Pre-bind state information === LOG: DisplayName = System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 (Fully-specified) LOG: Appbase = file:///%working root%/WebApplication/ LOG: Initial PrivatePath = %working root%\WebApplication\bin
LOG: This bind starts in default load context. LOG: Using application configuration file: %working root%\WebApplication\web.config LOG: Using host configuration file: C:\Users\Kevin\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: System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 LOG: Attempting download of new URL file:///C:/Users/Kevin/AppData/Local/Temp/Temporary ASP.NET Files/root/57d1caa4/e98fbd78/System.Web.Mvc.DLL. LOG: Attempting download of new URL file:///C:/Users/Kevin/AppData/Local/Temp/Temporary ASP.NET Files/root/57d1caa4/e98fbd78/System.Web.Mvc/System.Web.Mvc.DLL. LOG: Attempting download of new URL file:///%working root%/WebApplication/bin/System.Web.Mvc.DLL. LOG: Attempting download of new URL file:///%working root%/WebApplication/bin/System.Web.Mvc/System.Web.Mvc.DLL. LOG: Attempting download of new URL file:///C:/Users/Kevin/AppData/Local/Temp/Temporary ASP.NET Files/root/57d1caa4/e98fbd78/System.Web.Mvc.EXE. LOG: Attempting download of new URL file:///C:/Users/Kevin/AppData/Local/Temp/Temporary ASP.NET Files/root/57d1caa4/e98fbd78/System.Web.Mvc/System.Web.Mvc.EXE. LOG: Attempting download of new URL file:///%working root%/WebApplication/bin/System.Web.Mvc.EXE. LOG: Attempting download of new URL file:///%working root%/WebApplication/bin/System.Web.Mvc/System.Web.Mvc.EXE.
I am really confused that I am using MVC4 but the error message is version of 3.0.0.0. This problem has annoyed me for a long time. Please help me and thanks in advance.
Upvotes: 2
Views: 1803
Reputation: 45
Problem solved by installing MVC 3.0 in my computer. Now it's working.
Upvotes: 1
Reputation: 68400
On your web.config, be sure to have this inside assemblyBinding
section
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
It forces to use 4.0.0.0 no matter what assembly version is trying to bind
Upvotes: 0