在 XP 上使用 win32 对话框的 WPF 应用程序崩溃

发布于 2024-12-02 15:29:46 字数 664 浏览 1 评论 0原文

我们有一个使用 VS 2010 和 .NET 4.0 框架在 Windows 7 上开发的 WPF 应用程序。

我使用 Visual Studio 安装程序为其创建了一个安装包。

在 XP 上运行时,使用 win32 OpenFileDialog 后似乎会进入错误状态。我花了一段时间才找到这个问题,因为它不会立即失败。出现对话框,您选择要打开的文件,它会打开并显示在屏幕上。我使用了大约两分钟,然后就崩溃了。我收到消息说我的程序遇到问题需要关闭。

我现在可以运行我的应用程序,打开一个文件并使其立即崩溃,因为特定的操作总是会使其崩溃。它适用于我打开的任何文件,甚至是新文件。

因此,我尝试在不使用 OpenFileDialog 的情况下打开同一个文件,我有一个 MRU 列表,我从中选择了该文件,并且它工作完美。我没能让它崩溃。

有人经历过类似的行为或有什么想法吗?

由于我在 XP 计算机上没有调试环境,因此我尝试在应用程序中放入一些跟踪语句,以将其所在位置以及某些变量的值写入日志文件。真正奇怪的是,一旦调用 OpenFileDialog.ShowDialog 方法,所有对日志文件的写入都会停止。我只是使用标准文件 I/O,并实际打开、写入然后关闭每个日志消息的文件。这使得以这种方式进行调试变得困难,但也进一步支持了环境中出现问题的事实。

我在四台不同的 XP 机器上进行了尝试,结果都相同。

We have a WPF application that was developed on Windows 7 using VS 2010 and .NET 4.0 framework.

I have created an install package for it using the Visual Studio Installer.

When running on XP it appears to go into a bad state after using the win32 OpenFileDialog. It took me a while to track this down, as it doesn't fail right away. The dialog appears, you select the file you want to open, it opens up and is displayed on the screen. I was using it for about two minutes and then it crashed. I get the message that my program has encountered a problem and needs to close.

I can now run my application, open a file and make it crash right away, since a specific action always makes it crash. It does on any file I open, even a new one.

So I tried opening the same file without using the OpenFileDialog, I have a MRU list that I selected the file from, and it works flawlessly. I have not been able to make it crash.

Anyone experience similar behavior or have any ideas?

Since I do not have a debug environment on the XP machine I tried putting in some tracing statements within the application to write out to our log file where it is and what value some variables have. The really strange thing is that as soon as the OpenFileDialog.ShowDialog method is called all writing to our log file stops. I am just using standard file I/O and actually open, write and then close the file for every log message. This makes it difficult to debug this way, but also further supports the fact that something is gone wrong in the environment.

I have tried on four different XP machines, all with the same results.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文