Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

288
Views
Is there a way to make a C# custom attribute raise a message at compile time?

A colleague of mine is using ObsoleteAttribute on not-yet-implemented methods so we get the warning at compile time.

Since a method to be implemented is in the exact opposite place of an obsolete one, however, that bugs me.

I don't see a NotYetImplementedButPleaseBePatientWeVeGotLoadsOfOtherThingsToDoAsWellAttribute in the documentation, so I'm figuring maybe we could create one.

ObsoleteAttribute is sealed, so we can't inherit it. (Yes, I found that out when I tried it. Nice try, me.)

Is there another way to imitate ObsoleteAttribute, but with a more appropriate name?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You cannot achieve exactly the same as [Obsolete], because that is handled directly by the compiler. However, you could write a "Roslyn analyzer" that looks for anything you like, and adds warnings, errors, suggestions, etc, based on your preferences. It could perhaps even (perhaps additionally) try to look for throw new NotImplementedException();. Writing a Roslyn analyzer is not, however, a trivial task.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!