Is there such a thing as comment in IL?

I understand that no one sits down and does not develop software in direct IL (right?). But suppose you want to share a piece of IL code (as output, for example, with the C # compiler) with someone else for discussion, and you also want to annotate it with a few comments. Is there any real syntax for comments in IL so you can do this without invalidating the text like IL? Not a big deal, just curious.

+6
syntax comments cil il
source share
2 answers

Yes, you can use // and /* ... */ just like in C #.

I cannot find references to it in ECMA-335, but this IL guide includes:

The first two lines (starting with // ) are comments. In ILAsm, you can comment in the same way as in C # or C ++. To comment on multiple lines or part of a line, you can also use the /* ... */ block.

+8
source share

you use // in IL for comments as well ...

+2
source share

All Articles