Solution to Method has no implementation (no RVA) Error

If you get this exception

_System.TypeLoadException: Could not load type ‘x’ from assembly ‘xx, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’ because the method ‘SendMessage’ has no implementation (no RVA)._Make sure you have a DllImport attribute for the method.

This…

public static extern IntPtr SendMessage(IntPtr w, uint m, IntPtr p1, IntPtr p2);

Becomes this…

[DllImport("user32.dll")]
public static extern IntPtr SendMessage(IntPtr w, uint m, IntPtr p1, IntPtr p2);