validate attribute usage

  • Thread starter Thread starter tolisss
  • Start date Start date
T

tolisss

Hi

i have to custom attributes for using with properties.
What i want to do is instruct the compiler to throw a warning or ever
better an error if both attributes are used in the same property. Is it
possible? any ideas?

thnks in advance
 
tolisss,

Unfortunately, custom attributes don't provide a hook through which
compiler checks can be done.

However, what you could do in .NET 2.0 is modify the MSBUILD script to
check the output after it is built. You can reflect on the produced
assemblies and see if the attributes are applied appropriately.

Hope this helps.
 
Back
Top