π₯οΈ A .NET-native VNC client and server library π₯οΈ
It supports Raw, Hextile, Copyrect, and Zlib encodings, and ships ready-to-use controls for Windows Forms, WPF, and cross-platform Avalonia UI, making it extremely easy to embed VNC in your program on Windows, Linux, or macOS.
β¨ Features β’ π¦ Installation β’ π Usage β’ π― Frameworks β’ π License
- π· Pure .NET Implementation - No native dependencies required
- π VNC Client & Server - Full support for both client and server roles
- π¦ Multiple Encodings - Raw, Hextile, Copyrect, and Zlib compression
- π¨ Color Depth Support - 8-bit, 16-bit, and 32-bit color modes
- πͺ UI Controls - Ready-to-use controls for Windows Forms, WPF, and Avalonia (cross-platform)
- π Cross-Platform UI - Avalonia control runs on Windows, Linux, and macOS with no native VNC dependencies
- π Clipboard Sharing - Bidirectional clipboard synchronization
- π Performance Monitoring - Built-in FPS, bandwidth, and CPU statistics
- π AutoSize Mode - Automatic scaling with proper coordinate transformation
Available on NuGet:
| Package | NuGet |
|---|---|
| Lemutec.RemoteViewing | |
| Lemutec.RemoteViewing.Windows.Forms | |
| Lemutec.RemoteViewing.WPF | |
| Lemutec.RemoteViewing.Avalonia |
Install via NuGet Package Manager:
# Core library
dotnet add package Lemutec.RemoteViewing
# Windows Forms control
dotnet add package Lemutec.RemoteViewing.Windows.Forms
# WPF control
dotnet add package Lemutec.RemoteViewing.WPF
# Avalonia control (Windows / Linux / macOS)
dotnet add package Lemutec.RemoteViewing.Avaloniausing RemoteViewing.Vnc;
using RemoteViewing.Windows.Forms;
// Add VncControl to your form, then connect:
var options = new VncClientConnectOptions();
options.Password = "your-password".ToCharArray();
vncControl.Client.Connect("hostname", 5900, options);using RemoteViewing.Vnc;
using RemoteViewing.WPF;
// Add VncControl to your window, then connect:
var options = new VncClientConnectOptions();
options.Password = "your-password".ToCharArray();
vncControl.Client.Connect("hostname", 5900, options);XAML:
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vnc="https://github.com/lemutec/RemoteViewing">
<vnc:VncControl x:Name="VncControl"
SizeMode="Zoom"
AllowClipboardSharingFromServer="True"
AllowClipboardSharingToServer="True" />
</Window>Code-behind:
using RemoteViewing.Vnc;
using RemoteViewing.Avalonia;
var options = new VncClientConnectOptions();
options.Password = "your-password".ToCharArray();
// Connect on a background thread so the UI stays responsive.
await Task.Run(() => VncControl.Client.Connect("hostname", 5900, options));Publish for any desktop platform from a single codebase:
# Windows
dotnet publish -f net8.0 -r win-x64 --self-contained false
# Linux (x64 / arm64)
dotnet publish -f net8.0 -r linux-x64 --self-contained false
dotnet publish -f net8.0 -r linux-arm64 --self-contained false
# macOS (Intel / Apple Silicon)
dotnet publish -f net8.0 -r osx-x64 --self-contained false
dotnet publish -f net8.0 -r osx-arm64 --self-contained falseusing System.Net;
using System.Net.Sockets;
using RemoteViewing.Vnc;
using RemoteViewing.Vnc.Server;
using RemoteViewing.Windows.Forms.Server;
// Listen for connections
var listener = new TcpListener(IPAddress.Any, 5900);
listener.Start();
var client = listener.AcceptTcpClient();
// Configure server options
var options = new VncServerSessionOptions();
options.AuthenticationMethod = AuthenticationMethod.Password;
// Create and start session
var session = new VncServerSession();
session.PasswordProvided += (s, e) => e.Accept("password".ToCharArray());
session.SetFramebufferSource(new VncScreenFramebufferSource("Desktop", Screen.PrimaryScreen));
session.Connect(client.GetStream(), options);| Package | Supported Frameworks | Supported OS |
|---|---|---|
| Lemutec.RemoteViewing | .NET Framework 4.6.2-4.8, .NET Standard 2.0/2.1, .NET 5.0-10.0 | Windows / Linux / macOS |
| Lemutec.RemoteViewing.Windows.Forms | .NET Framework 4.6.2-4.8, .NET 5.0-10.0 | Windows |
| Lemutec.RemoteViewing.WPF | .NET Framework 4.6.2-4.8, .NET 5.0-10.0 | Windows |
| Lemutec.RemoteViewing.Avalonia | .NET Standard 2.0, .NET 6.0-10.0 (Avalonia 11.x) | Windows / Linux / macOS |
| Feature | Client | Server |
|---|---|---|
| Raw Encoding | β | β |
| Hextile Encoding | β | β |
| Copyrect Encoding | β | β |
| Zlib Encoding | β | β |
| Password Authentication | β | β |
| Clipboard Sharing | β | β |
| 8-bit Color | β | β |
| 16-bit Color | β | β |
| 32-bit Color | β | β |
This project is licensed under the BSD 2-Clause License. See LICENSE.txt for details.
- π¨βπ» Original author: James F. Bellinger
- π zlib compression support uses a C# port of zlib's deflate code
