Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF not rendering on remote desktop

I'm having problems with the rendering of a WPF app over a remote desktop connection.

The applications chrome is rendering, but none of the content is coming through, as if the window is not drawing. Instead the previous content of the screen is showing in it's place.

This has been a problem with the application running on both Vista & Win 7, with remote control being taken from XP and Win7.

The problem is not application specific, if I create a new WPF app, with just a textblock on the window, it will also not run. (Neather will the windows preview in VS2008 display.)

Is there some trick to getting WPF running under RDP?

like image 253
MrLink Avatar asked Aug 07 '09 10:08

MrLink


2 Answers

I read on Kevin Dente's blog (from a twitter post) that he was having trouble with WPF apps in virtual machines. While not the same as Remote Desktop, it's possible the problem could be the same. Kevin was able to fix his problem by disabling hardware accelleration by creating a DWORD registry value at

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Avalon.Graphics\DisableHWAcceleration

and then setting it to 1.

His original blog post is here: http://weblogs.asp.net/kdente/archive/2009/10/19/visual-studio-2010-beta-2-editor-performance-fix-running-on-a-virtual-machine.aspx

That may not be your exact solution, but maybe it points you in the right direction.

like image 108
Ben McCormack Avatar answered Oct 23 '22 21:10

Ben McCormack


WPF should render over RDP; it's smart enough to know when it can render in hardware, and when it can't it reverts to its own GDI+ based software rendering. I would make sure you're running .NET Framework 3.5 SP1 on the remote machine, since there were changes to remoting that might pose issues. (See link below.)

I've been developing a WPF app for the past 6 months and it works just fine over RDP. (From Vista and Win7 to XP, Vista and Server 2003.) One important caveat, however, is that it renders using the Classic theme. So if you're using controls that don't have a classic theme, they won't render. If you're just dropping a TextBox on a Window, then obviously that's not your problem.

Check out this question for some links that may be helpful: Are there problems with rendering WPF over Remote Desktop under Windows XP?

like image 2
AndyM Avatar answered Oct 23 '22 23:10

AndyM