txdv/sundown.net — pull request #5 by lslab (2013-09-30 10:22:28+00:00)
Title: add dllimport property:CallingConvention=CallingConvention.Cdecl

Hi,I use your code in .Net Framework 4. Compiler produce exception
The details of the exception are:
``` that A call to PInvoke function 'TestConsoleGrids!TestConsoleGrids.Program::process' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.
The default callingconvention has always been StdCall.```
The Reason is:
```
Starting with the .NET Framework 4, a streamlined interop marshaling architecture provides a significant performance improvement for transitions from managed code to unmanaged code. In earlier versions of the .NET Framework, the marshaling layer detected incorrect platform invoke declarations on 32-bit platforms and automatically fixed the stack.```