Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not load file or assembly 'System.Web.Helpers, error on IIS 8

I have a MVC4 web application that works fine on Visual Studio 2012, using the local IIS Express Server. When I publish the application to an IIS 8 web server running on Windows 2012, the initial login page displays correctly. However, using remote debugging, I see that when I check the credentials using the following line:

if (ModelState.IsValid && WebSecurity.Login(model.UserName, model.Password, persistCookie: model.RememberMe)) 

I get the error shown in the figure below: System.Web.Helpers error
(source: usf.edu)

like image 462
Manish Avatar asked Oct 19 '13 04:10

Manish


2 Answers

Solution - Copy reference to local

  1. Right click on reference System.Web.Helpers and select Properties
  2. Change Copy Local to true.
  3. Build Solution
like image 68
Arvind Vishwakarma Avatar answered Sep 30 '22 10:09

Arvind Vishwakarma


Sounds as though MVC has not been installed on the server.

like image 41
Graham Laight Avatar answered Sep 30 '22 11:09

Graham Laight