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
  2. abdul avatar

    hlp me...

    abdul — August 3, 2010 3:03 AM
  3. Ricardo avatar

    Thanks bro! Good one!!! I was having the same problem... lol

    Ricardo — March 10, 2012 6:51 PM
  4. David Brown avatar

    You sir, are a Scholar and a Gent! I have been wrestling this issue for the last hour and changing ViewUserControl to ViewPage made the page load instantly! Copy Pasta was indeed the cause but this was the fix! Legend! :)

    David Brown — May 11, 2012 8:32 AM

» Leave a Comment