Compilation error “Could not load type 'System

2019-06-25 09:00发布

问题:

i'm getting the below error, When compiling the Asp.Net web deploy project

Could not load type 'System.Web.Mvc.ViewPage<System.Web.Mvc.HandleErrorInfo>'. /Shared/Error.aspx

But when I compile the web project, It is not showing any error.

回答1:

Make sure that there is appropriate dll files in your bin folder on deployment server.

System.Web.Abstractions.dll

System.Web.Mvc.dll

System.Web.Routing.dll

Also, make sure that web.config contains proper configuration for those dlls in compilation/assemblies section:

<add assembly="System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

Here is example for 1.0 version of MVC, you should insert yours (for RC2)