WPF application freezes Windows 7

I have a .NET 3.5 WPF application on Windows 7 64bit. I am experiencing a strange system freeze problem that occurs when dragging and moving the main application window. Basically the whole system freezes (UI) and the application stops rendering. Bringing the task manager ( CTRL + ALT + DEL ) defrosts both the system and the application.

The application itself is a trading application that processes a large number of messages in the background stream.

Has anyone encountered such problems? Especially the oddity of the task manager, opening the freeze. What could be causing this strange behavior?

I am pretty sure that it has something to do with sending certain actions to the UI thread.

+7
source share
4 answers

The problem was the dead end of the WCF service. The problem is similar to this

In the service that processed the messages, incoming messages should have been added to the user interface stream in the collection as follows.

 Action action = new Action(() => { lock (_messagesLock) { _messages.Remove(message); } }); _dispatcher.Invoke(DispatcherPriority.Normal, action); 

Change

 _dispatcher.Invoke(DispatcherPriority.Normal, action); 

To

 _dispatcher.BeginInvoke(DispatcherPriority.Normal, action); 

Solved a problem.

+2
source

Some old post on StackOverflow has been found that might help. It is said that this may be due to the font cache.

"I had the same problem. It was a damaged font cache!

See http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/7cc032c1-5f4d-4518-adc6-f53afd051e6b for a solution.

"

WPF Application Widget

Here are the steps to take.

In win 7

 1. Run services.msc 2. Stop Windows Presentation Foundation Font Cache 3.0.0.0 service 3. Delete FontCache3.0.0.0.dat in XP: %systemdrive%\Documents and Settings\LocalService\Local Settings\Application Data in Vista: %windir%\ServiceProfiles\LocalService\AppData\Local 4. Restart the machine 

I know that you can do the following.

On Windows, there is a font cache file located here: C: \ Windows \ System32 \ FNTCACHE.DAT

Delete this file and reboot the system.

+4
source

Since WPF uses DirectX, you also need to make sure that DirectX and your video drivers are up to date and working properly. An incorrect video card or video driver may cause problems for WPF that may not appear in other Win32 applications.

+1
source

If you use VS2010 and run the WPF application in Win 7 64 bit, the answer to your question may be as follows:

Increase productivity by changing visual experience.

You may have a hardware acceleration issue in VS2010. Because of this, I had a problem with rendering applications created using WPF.

Try: http://blogs.msdn.com/b/zainnab/archive/2010/06/22/improving-performance-by-changing-the-visual-experience-vstipenv0017.aspx

And if this does not fix your problem, go to the settings of your video card (nvidia or amd) and make the settings "reset". Then try again.

0
source

All Articles