Tech Dreams

How to fix “WPF Application hangs” Problem in Windows 7

WPFI have a  WPF based application which was working fine on my “Windows 7” laptop till last night.Today when i tried to launch ,it just hanged and becomes non responsive .There is no information regarding any exception or error, except an “Application hang” event in the event Viewer.

After a whole day of failed attempts, i found out the cause for the problem and a simple solution (it just took me a minute) to resolve it

Problem

The problem is due to corrupt “Windows Presentation Font Cache 3.0.0”. This happens mostly due to abrupt shutdown of your system

Solution

The solution to the problem is to delete the corrupt font cache and restart the machine.The detailed steps are given below.

Step1:

  • Go to Run and  type “services.msc”
  • Look for a service name “Windows Presentation Foundation Font Cache 3.0.0.0” and stop it

Step 2:

  • Delete the file “FontCache3.0.0.0.dat”.This file is normally placed under the following file path.
    • Windows 7 / Vista – “%windir%\ServiceProfiles\LocalService\AppData\Local”
    • Windows XP – “%systemdrive%\Documents and Settings\LocalService\Local Settings\Application Data”

Step 3:

  • Restart the machine.

Update [14/01/11]

If the problem continues you can disable the “Windows Presentation Foundation Font Cache 3.0.0.0” service permanently. This will not have any impact to the application behaviour.