I\'ve started upgrading a .NET 2.0 WinForms application to .NET 4.0. Well, OK, the upgrade process was just a matter of switching platform target, but making it actually work.
I see a similar problem with a Delphi dll:
social_msdn
I have noticed that my library compiled with FreePascal (instead of Delphi) works even within VS2010 without any problems. Therefore I don't know if Delphi, the .NET4
debugger or the combination is the reason for the trouble.
There is some evidence that memory allocated during dll start-up (e.g. in the initialization section) is affected by the memory corruption.