Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 633549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:11:55+00:00 2026-05-13T20:11:55+00:00

I have a class that inherits from a base class and implements the following…

  • 0

I have a class that inherits from a base class and implements the following…

    Public Function CompareTo(ByVal obj As Object) As Integer Implements System.IComparable.CompareTo

Now the base class it inherits from also implements this System.IComparable.CompareTo so I’m getting the following compiler warning:

Warning: ‘System.IComparable.CompareTo’ is already implemented by the base class. Re-implementation of function assumed.

I’m fine with that so my question is how can I suppress this warning for just this function (i.e. not all such warnings).

Clarifications:

  • Here is a link to the error on MSDN.
  • I’ve already tried both Shadows and Overrides and neither eliminates the warning.
  • The warning isn’t on the method itself (unless Shadows or Overrides are omitted), but rather it’s on “Implements System.IComparable.CompareTo” specifically.
  • I am not looking to suppress all warnings of this type (if they crop up), just this one.

Solution:
I was hoping to use the System.Diagnostics.CodeAnalysis.SuppressMessage attribute or something like C#’s #pragma but looks like there’s no way to suppress the warning for a single line. There is a way to turn this message off for this project though, without turning all warnings off.

I manually edited the .vbproj file and included 42015 in the node for Debug and Release compilations. Not ideal but better than always seeing the warning in the IDE.

If someone has a better solution please add it and I’ll gladly try it flag the answer.

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T20:11:55+00:00Added an answer on May 13, 2026 at 8:11 pm

    Only use ‘Implements’ in the base class:

    Signature in the base class:

    Public Overridable Function CompareTo(ByVal obj As Object) As Integer Implements System.IComparable.CompareTo
    

    Signature in the inherited class:

    Public Overrides Function CompareTo(ByVal obj As Object) As Integer
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class that inherits from a base class (this contains a lot
Suppose I have a Base class and a Child class that inherits from Base
I have a class (Descendant1) that inherits from a base class (BaseClass). An instance
I have a class that inherits from Page, called APage. public abstract class APage:
Example: I have an class that inherits from UIImageView. An object creates an instance
I have a parent class in rails that inherits from ActiveRecord::Base. I'm trying to
I have a class e.g. DerivedClass that inherits from a base class e.g. BaseClass.
I have a base class called Object. PhysicsObject inherits from Object. Ball inherits from
I have a series of composite user controls that inherit from a base class
I have a class that inherits from ObservableCollection(Of MyObject) and the MyObject class handles

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.