Eliran
Eliran

Reputation: 157

Could not load file or assembly 'System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKey

After doing push from git server I got this error when I build and open my project:

Could not load file or assembly 'System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=******' or one of its dependencies. The system cannot find the file specified.

The project is working pretty well with the same code in a different computer.

Upvotes: 0

Views: 1300

Answers (2)

Wurd
Wurd

Reputation: 475

I found nuget or some other update can bump the System.Web.MVC version to 4.0.0 unintentionally. So just check the dll that you have in your bin folder (or wherever the reference points) is of the same version specified in your web.config.

Upvotes: 0

Jeremy Thompson
Jeremy Thompson

Reputation: 65534

Problem

The error is a file not found, like the one I helped out with the other day:

Could not load file or assembly .. The system cannot find the file specified.

Troubleshooting

Open ProcessMonitor and run it when VS won't let you build your solution and throws the error. Stop the trace when it fails and investigate ProcMon's (Filemon) log to see where the IDE is looking for the DLL it cant find.

Solution

Put the DLL where its expected to be found (this will hopefully sort out the VS library referencing failure).


Also try:

  1. disable Resharper
  2. restart VS
  3. clean & rebuild

Upvotes: 1

Related Questions