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 6373045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:18:54+00:00 2026-05-25T01:18:54+00:00

In .NET you can mark certain methods as obsolete so that developers are alerted

  • 0

In .NET you can mark certain methods as obsolete so that developers are alerted when they attempt to use the deprecated method.

<Obsolete("Do not call this method.")> Private Sub FormerMethod()

The thing is you can only do this within classes you control. What do you do when you want your developers to avoid using certain methods on classes provided natively in .NET or by a vendor?

For example, what if you want your developer to prefer some custom extension method on DataTable rather than Select. I’d hate to have to define a custom version of the DataTable class if only to deprecate Select. That would leave us having to police whether or not the custom table was being used.

I’m aware that there are tools like (FxCop) that help enforce coding standards; however, my question is whether or not this can be handled without some third party tool.

  • 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-25T01:18:55+00:00Added an answer on May 25, 2026 at 1:18 am

    While you may not like the answer, I would think wrapping would be the appropriate choice.

    For a third party vendor’s code, wrapping should be mandatory just to produce a level of abstraction for unit testing. And being a wrapper, you can obviously mark methods as Obsolete.

    For .NET objects, it’s a little more tricky. Obviously, someone can just include the namespace and go to town; I don’t believe there is a ‘code-only’ solution to this problem like you want, other than perhaps making an integration test that searches over your solution and fails when that particular method you dont like is called.

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

Sidebar

Related Questions

Can I mark an entire namespace as obsolete in .NET Framework (3.5 and 4)
In .NET can I use any string as a dictionary key? This is part
Can you recommend a library for .NET that can receive FAXes? Window Fax server
How can I create or mark a file as hidden using .NET?
I'm attempting to eliminate the duplication accross two ASP.NET web projects that use exactly
Can anyone recommend software or a .NET library that will check for bounced emails
I have an asp.net form with bunch of sections that can be expanded/collapsed and
how the mark and sweep phases of .NET GC can run concurrently with application
how the mark and sweep phases of .NET GC can run concurrently with application
When I sent a mail using System.Net.Mail, it seems that the messages do not

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.