1、解决方法很简单,只要添加属性:CallingConvention=CallingConvention.Cdecl即可。例如:[DllImport("TestApi.dll")] internal extern static IntPtr TestApi();添加属性CallingConvention=CallingConvention.Cdecl改成[DllImport("TestApi.dll",CallingConvention=CallingConvention.Cdecl)] internal extern static IntPtr TestApi(); 即可。