On Tue, Aug 17, 2010 at 12:20 PM, Knight Commander
<rabbit...@gmail.com> wrote:
> Is FieldDefinition.InitialValue what should appear in ".data" section? I
> created a type which contains a byte[] field with a large initialValue but
> there is no sign of ".data" in output of ildasm but the assembly binary
> image contains the initialvalue content.
Weird. Do you have a small snippet of code reproducing the issue?
--
Jb Evain <j...@nurv.fr>
--
Jb Evain <j...@nurv.fr>
--
--
mono-cecil
You should pass the import of typeof (object) as the base type of your class.
> ModuleDefinition mod = assm.Modules[0];
> mod.Types.Add(type);
> FieldDefinition fild = new FieldDefinition("initdar",
> FieldAttributes.Private, mod.Import(typeof (byte[])));
You have to pass FieldAttributes.Static | FieldAttributes.HasFieldRVA
--
Jb Evain <j...@nurv.fr>
You should pass the import of typeof (object) as the base type of your class.
You have to pass FieldAttributes.Static | FieldAttributes.HasFieldRVA
--
Relative Virtual Address. It's just a way of addressing data in a PE
file. It means that the field has a «pointer» to some data in the
module.
--
Jb Evain <j...@nurv.fr>