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 12:04:00 PM

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

Rahul Soni

Rahul Soni  Twitter

 LinkedIn

 Facebook

 Email me



Vivek Kumbhar

Vivek Kumbhar  Twitter

 LinkedIn

 Facebook

 Email me


Stack Exchange

profile for Vivek at Server Fault, Q&A for system administrators and IT professionals

profile for Rahul Soni at Stack Overflow, Q&A for professional and enthusiast programmers

Calendar

<<  February 2012  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
2728291234
567891011

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 2012, Rahul Soni

Powered by BlogEngine.NET 1.4.5.0