JasonBock
unread,Nov 5, 2008, 3:28:56 PM11/5/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mono-cecil
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