the sysnative attribute cannot be placed on non-extern methods
The sysnative attribute must be used on methods that also use extern.
The following sample generates CS0627:
public class b { [sysnative] static public void mf() { // CS0627 } // try the following // [dllimport("mydll.dll")] static extern public void mf(); // or // [sysnative] static extern public void mf(); public static void Main() { } }