RoyalApps.Community.FreeRdp.WinForms 1.0.0

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package RoyalApps.Community.FreeRdp.WinForms --version 1.0.0                
NuGet\Install-Package RoyalApps.Community.FreeRdp.WinForms -Version 1.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RoyalApps.Community.FreeRdp.WinForms" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add RoyalApps.Community.FreeRdp.WinForms --version 1.0.0                
#r "nuget: RoyalApps.Community.FreeRdp.WinForms, 1.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install RoyalApps.Community.FreeRdp.WinForms as a Cake Addin
#addin nuget:?package=RoyalApps.Community.FreeRdp.WinForms&version=1.0.0

// Install RoyalApps.Community.FreeRdp.WinForms as a Cake Tool
#tool nuget:?package=RoyalApps.Community.FreeRdp.WinForms&version=1.0.0                

FreeRDP Control

NuGet Version NuGet Downloads .NET Framework .NET

RoyalApps.Community.FreeRDP contains projects/packages to easily embed/use FreeRDP in a Windows (WinForms) application. Screenshot

The FreeRDP control starts the executable wfreerdp.exe and passes on the correct parent-window handle in order to render the remote desktop session in an embeddable WinForms control. The executable is shipped with the control (as embedded resource) and will be "extracted" to a configurable path (default is %temp%) before it is executed.

Getting Started

Installation

You should install the RoyalApps.Community.FreeRDP with NuGet:

Install-Package RoyalApps.Community.FreeRDP.WinForms

or via the command line interface:

dotnet add package RoyalApps.Community.FreeRDP.WinForms

Using the FreeRdpControl

Add Control

Place the FreeRdpControl on a form or in a container control (user control, tab control, etc.) and set the Dock property to DockStyle.Fill

Set Properties

To configure all RDP relevant settings, use the properties of the FreeRdpConfiguration class which is accessible through the FreeRdpControl.Configuration property.

Connect and Disconnect

Once the configuration is set, call:

FreeRdpControl.Connect();

to start a connection.

[!Note] Before you call Connect();, make sure you have set the Server (hostname or IP address) and the credential properties (Username and Password). An exception will be thrown if these properties are not set.

To disconnect, simply call:

FreeRdpControl.Disconnect();
Subscribe to Events

When the connection has been established, the Connected event is raised.

The Disconnected event is raised when:

  • the connection couldn't be established (server not reachable, incorrect credentials)
  • the connection has been interrupted (network failure)
  • the connection was closed by the user (logoff or disconnect)
  • the wfreerdp.exe died for some reason

The DisconnectedEventArgs may have an error code or error message for more information.

Exploring the Demo Application

The demo application is quite simple. The Connection menu has the following items:

Connect

Starts the remote desktop connection. If you click Connect the first time, you get a prompt for the server name to connect to and the a prompt for the credentials. If you want to change the server or the credentials, use the Settings window.

Disconnect

Stops the remote desktop connection by killing the wfreerdp.exe process associated with the session.

Settings

Shows a window with all the settings from the FreeRdpConfiguration class. Edit/change the settings before you click on Connect.

Notable Features

Auto Expand Desktop Size

If DesktopWidth and DesktopHeight properties are set to 0 (default), the remote desktop size is determined by the container size the control is placed on.

Desktop Scaling

For High-DPI scenarios, you can set the DesktopScaleFactor to a value between 100 and 500. If you set it to > 100, make sure you also set DeviceScaleFactor to 140 or 180.

Smart Reconnect

If SmartReconnect is set to true and the container size has changed, the connection will automatically be closed and re-opened to adapt to the new desktop size.

Acknowledgements

Special thanks to Marc-André Moreau and akallabeth for all the help.

Product Compatible and additional computed target framework versions.
.NET net5.0-windows7.0 is compatible.  net6.0-windows was computed.  net6.0-windows7.0 is compatible.  net7.0-windows was computed.  net8.0-windows was computed.  net9.0-windows was computed. 
.NET Framework net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.1.1 89 1/20/2025
2.1.0 175 11/14/2024
2.1.0-beta2 71 10/9/2024
2.1.0-beta1 70 9/19/2024
2.0.2 456 9/26/2023
2.0.1 217 9/20/2023
2.0.0 175 9/19/2023
1.3.1 307 6/22/2023
1.3.0 410 2/17/2023
1.2.8 368 11/22/2022
1.2.7 341 11/22/2022
1.2.6 396 11/7/2022
1.2.5 390 11/7/2022
1.2.4 370 11/7/2022
1.2.3 361 11/7/2022
1.2.2 381 11/7/2022
1.2.1 394 11/7/2022
1.2.0 388 11/4/2022
1.1.5 450 9/30/2022
1.1.4 473 9/15/2022
1.1.3 410 8/3/2022
1.1.1 431 7/18/2022
1.1.0 423 7/17/2022
1.0.1 448 5/18/2022
1.0.0 505 5/9/2022