7

I would like to know if there is a way to access comments on a class through Reflection or if they are completely stripped from the binaries.

Pranay Rana
  • 175,020
  • 35
  • 237
  • 263
Ignacio Soler Garcia
  • 21,122
  • 31
  • 128
  • 207

4 Answers4

13

No. Comments are stripped by the compiler - they're not present in the binaries, so there's no way to get them back.

RichieHindle
  • 272,464
  • 47
  • 358
  • 399
3

Comments are ignored when code is compiled.

This means you can't get them "back" as they were never there in the first place.

ChrisF
  • 134,786
  • 31
  • 255
  • 325
3

Comments are ignored when code get complied by compiler.

But you can pass information in the Attributes by creating your own user defined attribute class.

RichieHindle
  • 272,464
  • 47
  • 358
  • 399
Pranay Rana
  • 175,020
  • 35
  • 237
  • 263
2

Comments are not available from the binaries, but they are via XML. See this SO answer.

Community
  • 1
  • 1
Muckle Beats
  • 121
  • 2