Rupesh Kahane

Rupesh Kahane

  • 98
  • 19.1k
  • 4.2m

System.Web.WebPages.Deployment Error

Jun 22 2016 12:59 PM
I have created web application MVC using .net framework 4.5. On local IIS my application is working fine.I have added new code for PagedList & added nuget packed for the same.
 
After deploying the application, I am getting error as
 
Could not load file or assembly 'System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:
System.IO.FileLoadException: Could not load file or assembly 'System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) 
 
Assembly Load Trace:
The following information can be helpful to determine why the assembly 'System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded. 
 
 I tried bellow solutions but it does not work
1. https://msdn.microsoft.com/en-us/library/e74a18c4%28v=vs.71%29.aspx
2. I have set local copy => True of System.Web.WebPages 
3. I removed the System.Web.WebPages reference from my project. Then in the Add Reference dialogue .NET tab there were two System.Web.WebPages references listed, a version 3.0.0.0 and a 2.0.0.0. I made sure to add the version 3.0.0.0
 
Bellow  is error screen shot
 
 
 Give me some suggestions. Thanks in adv.
 

Answers (3)