C# ASP.NET SQL SERVER

ASP.NET MVC GetTypeHashCode() no suitable method found to override

I was getting this error when running a page from an ASP.NET MVC site and it was driving me batty:

Error Message: c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\296bde83\3fd88bdf\App_Web_create.aspx.1486a709.vkhqok-s.0.cs(291): error CS0115: 'ASP.views_mycontroller_create_aspx.GetTypeHashCode()': no suitable method found to override

I fixed it by deleting the old view and creating a new one and then just pasting in the bits I'd already done testing it after each paste to see what it was. This showed nothing.

I then compared the old view with the new one and discovered that the only difference was in the @page directive:

Old View: Inherits="System.Web.Mvc.ViewUserControl<Model.EditorViewModel>"

New View: Inherits="System.Web.Mvc.ViewPage<Model.EditorViewModel>"

Not sure how I ended up with ViewUserControl in the old view instead of ViewPage but this was my error and fixed the problem.

» Similar Posts

  1. Deployed ASP.NET MVC app gives 404 on About Page
  2. VS2010 "cannot create the window"
  3. Combine, compress, and update your CSS file in ASP.NET MVC

» Trackbacks & Pingbacks

    No trackbacks yet.
Trackback link for this post:
http://guyellisrocks.com/trackback.ashx?id=220

» Comments

  1. Alec Dobbie avatar

    Thank you, just saved me. Mine was a result of a copy paste crime.

    Thanks.

    Alewc

    Alec Dobbie — April 27, 2010 10:13 AM

» Leave a Comment