我嘗試部署ASP.NET MVC 2項目(VS2010)贏得Server 2008 R2的未能加載類型 'System.Web.Mvc.ViewUserControl <SOMETYPE>'
它完美的dev的機器。但是在Server 2008 R2中會出現奇怪的錯誤: 當.ascx文件具有使用泛型類型頭:
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<MyProj.Web.Models.RangeViewModel>" %>
Server報告未能加載類型「System.Web.Mvc.ViewUserControl < MyProj.Web.Models。 RangeViewModel >'。
但是,當我宣佈在某處cs文件類型像
public class AA : System.Web.Mvc.ViewUserControl<MyProj.Web.Models.RangeViewModel>
{
}
和<%@控制頭用它來代替。然後,它就像它應該那樣工作。
我錯過了什麼嗎?
UPDATE
我在兩個步驟中(在服務器)部署應用程式:
- 使用命令行的MSBuild(用於.NET 4)重建從源VS溶液
- 發射定製的msbuild任務(具有publih.msbuild文件)執行兩個目標:Targets =「ResolveReferences; _CopyWebApplication」
你是如何部署? – 2010-05-10 14:34:02
已更新我的初始帖子 – Evgenyt 2010-05-10 14:39:00
您是否試過'Inherits =「System.Web.Mvc.ViewUserControl'1 [[MyProj.Web.Models.RangeViewModel]]''? – 2010-05-10 14:41:07