'function' : sysimport cannot be used on a non-static member function of a managed class
Because sysimport implies a native function, and because the NGWS runtime controls the layout of a class, a native function cannot access members of an instance of a class. However, a static member function has no such restriction as it can only access static data members or other global data, not per-instance object data.
The following sample generates C3614:
#using <mscorlib.dll> __gc class C { [sysimport(dll="Some.dll")] int f1(); // C3614 // try this // [sysimport(dll="Some.dll")] static int f1(); }; void main() { }