WPF 未在远程桌面上呈现
我在通过远程桌面连接呈现 WPF 应用程序时遇到问题。
应用程序 chrome 正在渲染,但没有任何内容通过,就好像窗口没有绘制一样。 相反,屏幕上以前的内容会显示在它的位置。
这是在 Vista 和 Windows 上运行的应用程序的问题。 Win 7,远程控制取自XP和Win7。
问题不是特定于应用程序的,如果我创建一个新的 WPF 应用程序,窗口上只有一个文本块,它也将无法运行。 (VS2008 中的 Windows 预览也不会显示。)
是否有一些技巧可以让 WPF 在 RDP 下运行?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
我和提问者有同样的问题。 标准的开箱即用复选框无法正确呈现。 我只能在用鼠标悬停复选框时才能看到它是否被选中。 否则,检查和未检查之间没有区别。 重要提示:将前景设置为白色时会发生这种情况(请参见此处:https://social.msdn.microsoft。 com/Forums/vstudio/en-US/1c03db49-7e53-4cbb-9dd1-b328017c4453/wpf-checkbox-and-radiobutton-check-mark-not-showing-under-xp-windows-classic-theme-and-remote?论坛=wpf)
I have the same problem than the asker. The standard, out-of-the-box Checkbox is not rendering correctly. I can only see if it is checked when hoovering the checkbox. Otherwhise, no difference between checked and unchecked. Important note : It occurs when setting the foreground to white (see here : https://social.msdn.microsoft.com/Forums/vstudio/en-US/1c03db49-7e53-4cbb-9dd1-b328017c4453/wpf-checkbox-and-radiobutton-check-mark-not-showing-under-xp-windows-classic-theme-and-remote?forum=wpf)
我们的应用程序曾经在自定义进度条时遇到过这个问题。
我们通过将边框控件的背景颜色设置为白色来修复此问题。 这让我认为透明背景存在问题
Our application used to have this problem with a custom progress bar.
We fixed this by setting the background color of the Border control to White. This leads me to think there is an issue with transparent backgrounds
无需特殊技巧即可让 WPF 内容在远程桌面上显示。 我们基于 WPF 的应用程序在 RDP 上渲染得很好(在许多机器上尝试过),没有任何问题。 我们甚至使用动画、渐变、WriteableBitmap 等,没有任何问题。
There is no special trick needed to get WPF content to show across remote desktop. Our WPF-based app renders just fine over RDP (tried from numerous machines) with no problems. We're even using animations, gradients, WriteableBitmap, etc. w/ no problems.
我在 Kevin Dente 的博客(来自 Twitter 帖子)上读到,他在虚拟机中使用 WPF 应用程序时遇到了问题。虽然与远程桌面不同,但问题可能是相同的。 Kevin 能够通过在
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Avalon.Graphics\DisableHWAcceleration
创建 DWORD 注册表值并将其设置为 1 来
禁用硬件加速来解决他的问题。他的原始博客文章位于:http://weblogs.asp.net/kdente/archive/2009/10/19/visual-studio-2010-beta-2-editor-performance-fix -running-on-a-virtual-machine.aspx
这可能不是您的确切解决方案,但也许它为您指明了正确的方向。
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.
WPF 应通过 RDP 进行渲染; 它足够聪明,知道何时可以在硬件中渲染,何时不能,则恢复到自己的基于 GDI+ 的软件渲染。 我会确保您在远程计算机上运行 .NET Framework 3.5 SP1,因为远程处理的更改可能会引起问题。 (请参阅下面的链接。)
过去 6 个月我一直在开发 WPF 应用程序,它通过 RDP 运行得很好。 (从 Vista 和 Win7 到 XP、Vista 和 Server 2003。)但是,一个重要的警告是它使用 Classic 主题进行渲染。 因此,如果您使用的控件没有经典主题,它们将不会呈现。 如果您只是将文本框放在窗口上,那么显然这不是您的问题。
查看此问题以获取一些可能有用的链接:在 Windows XP 下通过远程桌面渲染 WPF 是否存在问题?
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?
我只是在第一次通过 RDP 进行测试时遇到了功能区窗口无法正确显示的问题 - 透明背景为白色,关闭的最小化/最大化按钮丢失,窗口底部的圆角是方形的,顶部是方形的一排丝带按钮几乎无法选择。
事实证明对我来说有一个简单的解决办法。 右键单击 RDP 连接图标(我将其保存在桌面上),选择“编辑”,然后选择“体验”选项卡,并将“自动检测连接质量”更改为“LAN(10 Mbps 或更高)”。
这为我解决了这个问题。
阿德
I just had this problem with the ribbonwindow not displaying correctly when testing for the first time via RDP - the transparent background was white, the close minimize/maximize buttons were missing, the rounded corners on the bottom of the window were square, and the top row of ribbon buttons were almost impossible to select.
Turns out there was a simple fix for me. Right-click the RDP connection icon (I have it saved on my desktop), select "Edit", then the "experience" tab, and change "detect connection quality automatically" to "LAN (10 Mbps or higher)".
This fixed it for me.
Ade
您是否也尝试过Win7最新的RDP - Win7连接? 问题是 WPF 不使用 GDI 来绘制元素。
VNC 客户端(如 UltraVNC)可能会为您提供帮助,因为它们使用更简单的算法,更像是发送位图。
Did you also try Win7 latest RDP - Win7 connection? The thing is WPF doesn't use GDI to draw elements.
VNC clients (like UltraVNC) probably will do the trick for you as they using much simplier algorithms more like of sending bitmaps.