[mono] System.Reflection.Emit doesn't propagate marshalling attributes to the created type
#58 783 ouverte le 8 sept. 2021
Métriques du dépôt
- Stars
- (17 886 stars)
- Métriques de merge PR
- (Merge moyen 12j 11h) (661 PRs mergées en 30 j)
Description
See the comment below for a concise repro: https://github.com/dotnet/runtime/issues/58783#issuecomment-915439461
Some values relevant to marshaling from a StructLayoutAttribute and MarshalAsAttribute are not propagated to the dynamically created type.
Original bug report:
I tested it in Xamarin, but dotnet runtime also exists:

The correct size should be 100, which is correct on .net framework but wrong on mono. When I debug this code with mono on win, I found that this error is related to mono’s implementation of DynamicImage, which is caused by the attribute not being successfully applied during marshal.