SaveFileDialog silently crashes WinForms app on WindowsXP

别等时光非礼了梦想. 提交于 2019-12-02 08:21:49

Enable unmanaged debugging in the project properties window. And ensure that Visual Studio is set to break on all exceptions (check the "Throw" option in the Debug\Exceptions menu).

Then run your application again. VS should now break on the exception - it should be a shell extension or file handler that's causing your app to fail.

You can try to call your SaveFileDialog in a new Thread, and tell us if it works.

You can have A first chance exception of type 'System.Threading.ThreadAbortException' occurred in System.Windows.Forms.dll, and that will crash your application.

I think this happens because the current Thread is not suitable for running a SaveFileDialog.

Advice: review if you're dealing with threads (in order to correct some), and try to launch a new Thread to start the desired file dialog.

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