Did P/Invoke environment change in .NET 4.0?

前端 未结 4 2495
心在旅途
心在旅途 2021-02-19 15:17

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.

4条回答
  •  终归单人心
    2021-02-19 16:01

    It appears to be a bug in the Visual Studio 2010 debugger. It seems to be clobbering memory that doesn't belong to it. All of the problems I've observed (all of which can be reproduced reliably) disappear completely if I run the application directly, instead of through Visual Studio 2010.

    The bug is actually in the Managed Debug Assistant. If you turn it off completely (set HKLM\Software\Microsoft.NETFramework\MDA = "0"), the problem goes away. But of course you lose some debugging capability by doing so.

提交回复
热议问题