I have been publishing my MVC3 project to IIS including "All Project Files", this has been working fine, but when I changed it to "Only files needed to run this application", the project published fine, but if I try and browse the site in IIS, I get this error.
Parser Error Description: An error occurred durin开发者_StackOverflow中文版g the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type 'System.Web.Mvc.ViewUserControl'.
Source Error:
Line 1: <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
I remember that I read something a while ago about issues with deploying web projects that only have files required to run it and that by including all source code it works.
I am including the .mvc, .routing, .abstraction dll's as copy local in project.
Has anybody else come across this issue? I cannot find anything on the web concerning this anymore.
Cool,
I just found the answer and it worked, i added this bit of code to my web.config and its now working fine.
<pages
validateRequest="false"
pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
could somebody please tell me why i had to do this.
regards,
p.
精彩评论