I had System.Web.Mvc v4.0.0.0 added in the GAC, so I installed manually Mvc via nuget with "Install-Package Microsoft.AspNet.Mvc -Version 5.2.3".
I have installed System.Web.Mvc v5.2.3.0 now,
and System.Web.Mvc v4.0.0.0 in the GAC
I have this in Web.config:
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
I build and run the project and I get the next error:
Could not load file or assembly 'System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
But I have configured and added MVC v5.2.3.0 package . Why this error appears?
SOLVED Dereference System.Web.Mvc References -> Right click -> Mange NuGet Packages... -> Uninstall MVC -> And now "Install".
The assembly you see listed is from the GAC. That doesn't necessarily mean you're using it in the project. If you want to see the actual package installed in your project, right click the project and click "Manage NuGet Packages".
Uncheck version 4 on the Add Reference screen, then use the Package Manager Console to install the specific version via NuGet. Make sure you have the correct project selected to install the package into.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With