I\'m attempting to call the following trivial C function from C#:
SIMPLEDLL_API const char* ReturnString() { return \"Returning a static string!\"; }
I ran into a similar problem and specifying the "CharSet" seemed to fix it.
[DllImport("SimpleDll", CharSet = CharSet.Ansi)]
Not sure why this would be different in debug and release.