Keep in touch

you can keep in touch with my all blogs and sites by install this Toolbar...
http://rworldtoolbar.ourtoolbar.com/

Monday, September 29, 2008

Error - GetTypeHashCode() : no suitable method found to override

I found it very useful so I want to it here. I found a need for it while transferring my site from vb.net to C#.

After creating an ASP.NET web form using Microsoft Visual Studio 2005 or Microsoft Visual Studio 2005 Team Suite, I renamed the form from it's default name "Default.aspx" to a more user-friendly name "Order.aspx" within MS VS. After adding more code to the C# code-behind page, I discovered the following line: "public partial class _Default"

Being new to the ASP.NET programming language, I changed the "_Default" to "Order" thinking MS VS had failed to rename items within the code it generates. This caused the following error to display at debug/run time: "GetTypeHashCode() : no suitable method found to override"

There were several other errors displayed as well.

The class names must match between the .aspx and .aspx.cs web pages. Here is what the lines in each file should look like:

In the ASPX source file: %@ Page Language="C#" codefile="FormName.aspx.cs" Inherits="FormName_aspx" %

In the ASPX.CS source file: public partial class FormName_aspx : Page

Once I changed the .ASPX file to match the class name in the .ASPX.CS file, the errors were resolved.

Ref::
http://forums.asp.net/t/1225330.aspx
http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/7dbed154-34c6-41e3-b44f-23a594e9ccba/

2 comments:

Anonymous said...

This is great.. thanks a lot.. i was hitting my head to wall for long for this error.

Anonymous said...

thanks a Lot.

Its correct answer