I have a program, which used NETlink to call Mathematica functions from C#. When we compile this program with .NET 4.0 or higher we get "An unhandled exception of type 'System.AccessViolationException' occurred in Wolfram.NETLink.dll"
And trace here:
System.AccessViolationException was unhandled HResult=-2147467261 Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt. Source=Wolfram.NETLink StackTrace: at Wolfram.NETLink.Internal.Win64MathLinkAPIProvider.MLNextPacket(IntPtr link) at Wolfram.NETLink.Internal.Win64MathLinkAPIProvider.extMLNextPacket(IntPtr link) at Wolfram.NETLink.Internal.NativeLink.NextPacket() at Wolfram.NETLink.WrappedKernelLink.NextPacket() at Wolfram.NETLink.KernelLinkImpl.WaitForAnswer() at Wolfram.NETLink.MathKernel.Compute()
Any thoughts?