DYK #3 - How can you find out if a method/class/field was annotated with any Attributes without looking at the code?

by rahul 12/12/2008 4:52:00 AM

Well... first of all, open ILDASM and drag/drop your EXE.

 image

The application is called Attributes, and contains an annotated class, some annotated methods and fields. Notice the .custom instance void Attributes.xxxxxxxxx highlighted above. This tells you that the class is annotated.

Now, how would you tell if Bar, Foo, and FooBar methods or AttributedVar, NonAttributedVar are annotated or not? (as if the names were not self-explanatory) Tongue out

Double clicking on AnotherAttributedVar and NonAttributedVar would give you the following respectively...

image

image

The story is pretty similar for annotated methods.

Cheers,
Rahul


Quote of the day:
Electricity is actually made up of extremely tiny particles called electrons, that you cannot see with the naked eye unless you have been drinking. - Dave Barry


blog comments powered by Disqus

Search


Tags



Categories

Calendar

<<  March 2010  >>
MoTuWeThFrSaSu
22232425262728
1234567
891011121314
15161718192021
22232425262728
2930311234

View posts in large calendar

All Items
Sign in

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2010, Rahul Soni

Powered by BlogEngine.NET 1.4.5.0