diff --git a/docs/standard/native-interop/best-practices.md b/docs/standard/native-interop/best-practices.md index ca439797deb37..8ed52a0994061 100644 --- a/docs/standard/native-interop/best-practices.md +++ b/docs/standard/native-interop/best-practices.md @@ -400,6 +400,8 @@ Pointers to structs in definitions must either be passed by `ref` or use `unsafe ✔️ DO use the C# `sizeof()` instead of `Marshal.SizeOf()` for blittable structures to improve performance. +❌ DON'T depend on internal representation of struct types exposed by .NET runtime libraries unless it is explicitly documented. + ❌ AVOID using classes to express complex native types through inheritance. ❌ AVOID using `System.Delegate` or `System.MulticastDelegate` fields to represent function pointer fields in structures.