Could not load type 'System.Web.Mvc.ViewUserControl<SOMETYPE>'.

Posted by Evgenyt on Stack Overflow See other posts from Stack Overflow or by Evgenyt
Published on 2010-05-10T14:30:09Z Indexed on 2010/05/10 14:34 UTC
Read the original article Hit count: 890

Filed under:
|
|

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?

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about .NET