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

  • SEARCH
  • Home
  • 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 983391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T04:51:00+00:00 2026-05-16T04:51:00+00:00

On a continued mission to clean up the codebase I inherited, via stylecop and

  • 0

On a continued mission to clean up the codebase I inherited, via stylecop and fxcop, and one of the warnings from fxcop was CA1801: Parameter ‘value’ of Something.MyProperty.set(string) is never used. Remove the parameter or use it in the method body.

The code it complains about is:

public class Something : ISomeInterface
    public new string MyProperty
    {
        get
        {
            throw new InvalidOperationException("MyProperty is not implemented.");
        }

        set
        {
            throw new InvalidOperationException("MyProperty is not implemented.");
        }
    }

This property is defined in the interface, but in this case is not needed in the derived class – Aside from the slightly questionable use of InvalidOperationException instead of NotImplementedException, which I believe is common, I wonder if I should just exclude the warning in FXCop with a note explaining why?

I don’t see what else I could do do in terms of best practice, to prevent the warning in FXCop, other than refactoring this particular property out into a second interface, and then updating all the other classes that use this interface? I think I may have just answered my own question? 😀

  • 1 1 Answer
  • 0 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-16T04:51:00+00:00Added an answer on May 16, 2026 at 4:51 am

    I believe it is because of the “new” keyword that you are receiving this warning. Try replacing removing new with override and see if the warning disappears.

    public class Something : ISomeInterface
        public string MyProperty
    

    BTW, I recommend using NotImplementedException instead of InvalidOperationException as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

[continued from Is there a way to tell whether two COM interface references point
Continued from the last question here: Log method name in Obj-C . I just
(Continued from this thread ) Suppose that I have the following view created: http://cl.ly/1USw/content
This is a continued question from: Android: How to interact with the default Contacts
This is continued from thread: Python array multiply I need to multiply array vs
This is continued from this thread: Python matrix, any solution? Input from numpy import
This is continued question from Par1 . Scenario: I've drop down shown below. Lets
Continued from this stackoverflow question . I have the following data structure: data =
I recently changed the type of one of my properties from @property (readonly) NSImage
(continued from Read N consequent items by ActiveRecord ) My project is C# and

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.