Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2005
Visual Studio
Visual C#
C# Reference
C# Compiler Options
C# Compiler Errors
 Compiler Warning (level 3) CS0659

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
Visual C# Reference: Errors and Warnings 
Compiler Warning (level 3) CS0659 

Error Message

'class' overrides Object.Equals(object o) but does not override Object.GetHashCode()

The compiler detected an override of the Equals function but no override for GetHashCode. An override of Equals implies that you also want to override GetHashCode.

For more information, see

The following sample generates CS0659:

// CS0659.cs
// compile with: /W:3 /target:library
class Test   
{
   public override bool Equals(object o) { return true; }   // CS0659
}

// OK
class Test2
{
   public override bool Equals(object o) { return true; }
   public override int GetHashCode() { return 0; }
}
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker