NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Compiler Error CS0601

The dllimport attribute must be specified on a method marked static and extern

The dllimport attribute was used on a method that did not have the correct access keywords.

The following sample generates CS0601:

using System;
public class C {
   [dllimport("KERNEL32.DLL")]
   extern int GetCurDirectory(int bufSize, StringBuilder buf);   // CS0601
   // try the following line instead
   // static extern int GetCurDirectory(int bufSize, StringBuilder buf);

}

public class MainClass {
   public static void Main () {
   }
}