Is the class NativeMethods handled specially in .NET?

前端 未结 4 1546
广开言路
广开言路 2021-01-11 20:33

https://msdn.microsoft.com/en-us/library/ms182161.aspx

Are the three classes described on this paged handled specially in the .NET Framework? (NativeMethods, SafeNa

4条回答
  •  臣服心动
    2021-01-11 21:21

    They aren't handled specially by the CLR. It's simply recommended practice to have your P/Invokes inside a class named NativeMethods, SafeNativeMethods, or UnsafeNativeMethods.

    You'll see this recommendation come into play if you run FxCop on your assemblies.

提交回复
热议问题