WPF Windows 7 application hangs
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 bef开发者_开发问答ore 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);
}
I ran across this problem, and it appeared to be a corrupted font cache.
Steps to resolve:
- Run services.msc
- Stop the Windows Presentation Foundation Font Cache 3.0.0.0 service
- Delete FontCache3.0.0.0.dat.
- Delete the file GDIPFONTCACHEV1.DAT from the user's profile directory.
- Reboot the computer.
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
精彩评论