部署asp.net MVC 3 RTM的站点托管,让剃须刀认为必须从WebViewPage,或WebViewPage&LT获得;&的TModel GT;错误 [英] Deployed asp.net mvc 3 RTM site to host, getting razor view must derive from WebViewPage, or WebViewPage<TModel> errors
问题描述
这是我得到的错误:
System.InvalidOperationException:在〜/查看/主页/ Root.cshtml的观点必须从WebViewPage派生,或WebViewPage&LT;的TModel取代。
运行在本地开发框罚款。发布到主机,错误嘉豪...
解决方案
是MVC 3安装在主机上
在服务器环境中使用MVC 3:<一href=\"http://weblogs.asp.net/scottgu/archive/2011/01/18/running-an-asp-net-mvc-3-app-on-a-web-server-that-doesn-t-have-asp-net-mvc-3-installed.aspx\" rel=\"nofollow\">http://weblogs.asp.net/scottgu/archive/2011/01/18/running-an-asp-net-mvc-3-app-on-a-web-server-that-doesn-t-have-asp-net-mvc-3-installed.aspx
的 3应用到web.html rel=\"nofollow\">http://drew-prog.blogspot.com/2011/01/how-to-deploy-aspnet-mvc-3-app-to-web.htmlHere's the error I get:
System.InvalidOperationException: The view at '~/Views/Home/Root.cshtml' must derive from WebViewPage, or WebViewPage<TModel>.
Runs fine on local dev box. Publish to host, errors galore...
is mvc 3 installed on the host? if not, do you have your mvc 3 assemblies set to "copy local" when building your app?
using mvc 3 in server environment: http://weblogs.asp.net/scottgu/archive/2011/01/18/running-an-asp-net-mvc-3-app-on-a-web-server-that-doesn-t-have-asp-net-mvc-3-installed.aspx
using mvc 3 in server that doesn't have mvc 3 installed in GAC: http://drew-prog.blogspot.com/2011/01/how-to-deploy-aspnet-mvc-3-app-to-web.html
这篇关于部署asp.net MVC 3 RTM的站点托管,让剃须刀认为必须从WebViewPage,或WebViewPage&LT获得;&的TModel GT;错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!