Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

289
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda