Could not load file or assembly 'xxx' or one of its dependencies error

  • Updated

Customers may run into a very common error message during development as shown below:

The system could not find the 'Episerver.Forms.Core' assembly file to load. There are some workarounds for this issue:

  1. The dll file may not be in /bin folder. Just copy the dll file to /bin folder or set this preference Copy Local = True from Visual Studio.
     
  2. If the problem persists, check if the version of the assembly that is referenced is different than the version it is looking for. In the first image, the v4.7.0 assembly is referred to but the assembly is actually 4.6.1 version. Check the <dependentAssembly> setting in web.config:

and in the packages.config file:

This shows a mismatching dll version. The bindingRedirect setting may not be updated when you downgrade Forms from 4.7.0 to 4.6.1. Set newVersion = "4.6.1.0" and try reload the website.