Debugging winform crash - C# [ADPlus + Windbg]

吃可爱长大的小学妹 提交于 2019-12-02 01:10:48
karephul

In Visual Studio, go to project properties and enable "unmanaged code degubbing" then start the debugger.

[not sure if below step is required but I just did it] execute .load SOS.dll in Immediate Window of visual studio

I was able find the root cause of the problem: A callback was made on a garbage collected delegate of type 'ABC.Form1+SendMessageDelegate::Invoke'. This may cause application crashes, corruption and data loss. When passing delegates to unmanaged code, they must be kept alive by the managed application until it is guaranteed that they will never be called.

Thanks everyone who posted a reply or comments.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!