AlanR
AlanR

Reputation: 1172

Some compiler help for "kind of" public methods in .Net

Is anyone aware of any attribute (analogous to [Obsolete]) or similar mechanism to ask the compiler to raise a warning if a particular class is referenced (at design-time) by other projects? Note I cannot make it 'internal' because I'm databinding to System.* (or 3rd-party) controls so they have to be public.

Note I use [Obsolete] as an analogy, the class is not obsolete. I just want compiler warnings for out-of-project design-time references.

Upvotes: 2

Views: 110

Answers (2)

M.Babcock
M.Babcock

Reputation: 18965

Based on the answer to this question, it looks like it would be doable using PostSharp. Here is a link from the answer that describes some detail which might help.

Upvotes: 1

Related Questions