I'm trying to emit a box opcode based on the value type of a given
property:

if(property.PropertyType.IsValueType)
{
   worker.Append(worker.Create(OpCodes.Box,
property.PropertyType));
}

The problem is that this is what ends up in the IL (assume that the
property is a System.Int32):

box        [mscorlib]System.Runtime.InteropServices.GuidAttribute

I thought that it would be this:

box        int32

If I have a Guid-based property, this is what I see:

box
[CecilInjector.Attributes]CecilInjector.Attributes.ToStringAttribute

And I should have this:

box        [mscorlib]System.Guid

The PropertyType value looks right in the debugger but something isn't
working as I thought it would. Any ideas why this is occuring, and
also what I can do to put the right type in?

Thanks,
Jason


--~--~---------~--~----~------------~-------~--~----~
--
mono-cecil
-~----------~----~----~----~------~----~------~--~---

Reply via email to