Lokad / ILPack

Serialize .NET Core assemblies

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fail to serialize: Method marked runtime has non-zero RVA

dmiller opened this issue · comments

Attempting to serialize a class with a constructor that has the implementation attributes MethodImplAttributes.Runtime | MethodImplAttributes.Managed results in the method in the assembly having a non-zero RVA. PEVerify indicates this error in the written assembly. An attempt to load the assembly and access the type throws an Exception with message "Runtime-implemented method with-zero RVA."

Real example: the constructor on a subclass of MulticastDelegate. Of possible interest: the Invoke method also is "runtime managed" but PEVerify does not flag it.