WPF Windows 7 应用程序挂起
我有一个 .Net 3.5 WPF 应用程序,它在许多 Windows 7 计算机上运行良好,但在少数计算机上,它在启动时直接挂起,然后显示窗口。
这些机器运行 64 位 win 7 并安装了 .Net 4。还有其他具有相同配置的机器也可以工作。
不显示任何错误消息,并且事件日志中不写入任何内容。我已经运行了进程监视器和fuslogw,并且所有依赖项都已加载。
任务管理器显示 0% Cpu 使用率
应用程序构造函数运行(打开启动屏幕),但从未调用启动事件。
有什么想法要寻找什么。
编辑:
今天我删除了启动屏幕,应用程序运行良好。恢复了以前的版本并带有启动画面,效果也很好。不知道是什么原因造成的。我执行的代码的唯一部分是
public App() {
SplashScreen splashScreen = new SplashScreen("Logo.png");
splashScreen.Show(true);
}
I have a .Net 3.5 WPF application that works fine on many windows 7 computers but on a few it hangs directly on startup before the window is displayed.
The machines are running 64-bit win 7 and .Net 4 is installed. There are other machines with the same configuration that works.
No error message is displayed and nothing is written in the event log. I have ran process monitor and fuslogw and all dependencies are loaded.
Task Manager shows 0% Cpu usage
The Application constructor runs (opening a splash screen) but the Startup event is never called.
Any ideas what to look for.
Edit:
Today I removed the splash screen and the application worked fine. Restored previous version with the splash screen and it worked as well. Have no idea what caused it. The only part of my code that executed was
public App() {
SplashScreen splashScreen = new SplashScreen("Logo.png");
splashScreen.Show(true);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我遇到了这个问题,它似乎是字体缓存损坏。
解决步骤:
在 Windows Vista 和 Windows 7 中,文件 FontCache3.0.0.0.dat 位于 %windir%\ServiceProfiles\LocalService\AppData\Local,文件 GDIPFONTCACHEV1.DAT 位于 %userprofile%\AppData\Local。
原始来源的修改步骤: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/7cc032c1-5f4d-4518-adc6-f53afd051e6b
I ran across this problem, and it appeared to be a corrupted font cache.
Steps to resolve:
In Windows Vista and Windows 7, the file FontCache3.0.0.0.dat is located in %windir%\ServiceProfiles\LocalService\AppData\Local, and the file GDIPFONTCACHEV1.DAT is located in %userprofile%\AppData\Local.
Modified steps from the original source: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/7cc032c1-5f4d-4518-adc6-f53afd051e6b