[Mono-list] Are constants accessible via reflection?

Holger Arnold harnold@imn.htwk-leipzig.de
Mon, 5 Aug 2002 12:39:51 +0200


for a research project I'm developing a compiler that targets the CLI. This 
compiler, which is developed partly in C# using Mono, has to store additional 
semantic information in the compiled PE files. The information will be stored 
either in the Constant table (0x0B), or in the data section of the PE file, 
referenced through the FieldRVA table (0x1D).

The questions I have are, (i) are there any real differences 
(advantages/disadvantages) between storing this data in the Constants table 
or in the data section, and (ii) does anyone know if data stored this way is 
accessible via the standard System.Reflection mechanism, or if I have to use 
a more low-level metadata library?

There should be a way to access such data via System.Reflection, as at least 
constants can easily be generated via the SetConstant() method of the 
System.Reflection.Emit.FieldBuilder class, but I'm unable to find out how.

Can anyone help?

Holger Arnold