Hi

You need to do create a RequiredModifietType :

var fieldIndex = 0;
 var assembly = AssemblyDefinition.ReadAssembly(AssemblyPath);
var type = assembly.MainModule.Types[1];

var field = type.Fields[fieldIndex];
 var newField = new FieldDefinition(
 field.Name,
field.Attributes,
new RequiredModifierType(
 assembly.MainModule.Import(typeof(IsVolatile)), field.FieldType));

type.Fields[fieldIndex]  = newField;

Hope this helps

Best

Adriano

On Sat, May 26, 2012 at 12:00 PM, Simon <[email protected]> wrote:

>
>  --
> --
> mono-cecil

-- 
--
mono-cecil

Reply via email to