I'm trying to deploy ASP.NET MVC 2 project (VS2010) to Win Server 2008 R2
It works perfectly on dev machine. But strange error occurs at Server 2008 R2: When .ascx file has header that uses generic type:
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<MyProj.Web.Models.RangeViewModel>" %>
Server reports Could not load type 'System.Web.Mvc.ViewUserControl<MyProj.Web.Models.RangeViewModel>'.
But when I declare somewhere in .cs file type like
public class AA : System.Web.Mvc.ViewUserControl<MyProj.Web.Models.RangeViewModel>
{
}
and use it instead in <%@ Control header. Then it works as it should.
Am I missing something?
UPDATE
I deploy app in two steps (on server):
- Rebuild VS solution from source using command-line MSBuild (for .NET 4)
- Launch custom msbuild task (have publih.msbuild file for this) that executes two targets: Targets="ResolveReferences;_CopyWebApplication"