WPF hardware acceleration in RDP
WPF applications use by default software rendering when accessed over remote desktop, even if the system has hardware rendering capabilities. With .NET 8, a new option is introduced which allows you to opt into hardware acceleration when using the Remote Desktop Protocol. This can result in improved performance and an overall more responsive application.
You can opt in by setting the Switch.System.Windows.Media.EnableHardwareAccelerationInRdp
flag to true
inside a runtimeconfig.json
file, like so:
{
"configProperties": {
"Switch.System.Windows.Media.EnableHardwareAccelerationInRdp": true
}
}
Code language: JSON / JSON with Comments (json)
You can also configure this setting in your project by adding a RuntimeHostConfigurationOption
, example below:
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<RuntimeHostConfigurationOption Include="Switch.System.Windows.Media.EnableHardwareAccelerationInRdp" Value="true" />
</ItemGroup>
</Project>
Code language: HTML, XML (xml)
Note: the hardware acceleration in RDP option cannot be configured through DOTNET_
environment variables.
One Comment