We've recently been testing our DHCP management API on 64bit platforms and have found that though this works correctly when the application is targeted at x86 it works correctly however when targeted at Any CPU or x64 in release mode the application crashes and the following error is reported to the event log.
.NET Runtime version 2.0.50727.5456 - Fatal Execution Engine Error (000007FEF6B27916) (80131506)
This error is caused by a data types being incorrectly assigned.
As 64bit platforms determine data sizes differentlyit is important to debug the code and find which unmanaged method or struct is being worked with and review the documentation for that method or struct.
In our case we found we had incorrectly used an Integer value in a struct rather than a pointer to an integer. Pointers on 32bit platforms are 32bit however on 64bit platforms they are 64bit so as .NET iterates through objects in an array we were fortunate it worked on 32bit however on 64bit platforms things didn't line up so well and the iteration of the array fails.