RCON.Net 1.1.1

dotnet add package RCON.Net --version 1.1.1
                    
NuGet\Install-Package RCON.Net -Version 1.1.1
                    
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="RCON.Net" Version="1.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RCON.Net" Version="1.1.1" />
                    
Directory.Packages.props
<PackageReference Include="RCON.Net" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add RCON.Net --version 1.1.1
                    
#r "nuget: RCON.Net, 1.1.1"
                    
#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.
#:package RCON.Net@1.1.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=RCON.Net&version=1.1.1
                    
Install as a Cake Addin
#tool nuget:?package=RCON.Net&version=1.1.1
                    
Install as a Cake Tool

RCON.Net.Core

NuGet .NET .NET .NET

The core RCON client library - a lightweight, dependency-free implementation of the RCON protocol.

Overview

RCON.Net.Core provides the fundamental building blocks for RCON communication:

  • RconClient - The main client for connecting to and executing commands on RCON-enabled servers
  • RconClientBuilder - A fluent builder for configuring and creating RCON client instances
  • Command Framework - Base interfaces and classes for building typed command objects
  • RCON Protocol - Implementation of the RCON packet format and protocol handling

Installation

Install via NuGet:

dotnet add package RCON.Net

Key Components

RconClient

Manages RCON connections and command execution.

var client = new RconClient("127.0.0.1", 25575, "password");
await client.ConnectAsync();
var response = await client.ExecuteAsync("command");
await client.DisconnectAsync();

RconClientBuilder

Fluent API for configuring RCON clients with validation and default values.

var client = RconClientBuilder.Create()
    .WithHost("127.0.0.1")
    .WithPort(25575)
    .WithPassword("your-password")
    .WithTimeout(TimeSpan.FromSeconds(5))
    .Build();

Configuration Options:

  • WithHost(string) - Server hostname or IP address
  • WithPort(int) - Server RCON port (default: 25575)
  • WithPassword(string) - RCON authentication password
  • WithTimeout(TimeSpan) - Command execution timeout

ICommand Interface

Base interface for all command implementations.

public interface ICommand
{
    string Build();
    T? Parse<T>(string response) where T : class;
}

Commands implement:

  • Build() - Generates the command string to send to the server
  • Parse<T>() - Parses server response into a typed result object

RCON Protocol

The RCON protocol is handled internally:

  • Packet Structure - Standard RCON packet format with ID, type, and payload
  • Authentication - Secure password-based authentication
  • Request/Response - Async request/response communication
  • Error Handling - Comprehensive exception handling for connection and protocol errors

Exceptions

  • RconException - Base exception for all RCON-related errors
  • RconConnectionException - Connection failures
  • RconAuthenticationException - Authentication failures
  • RconTimeoutException - Command execution timeouts

Multi-Targeting

  • .NET 8.0, .NET 9.0, .NET 10.0

Usage Example

using RCON.Core;

// Create and configure client
var client = RconClientBuilder.Create()
    .WithHost("127.0.0.1")
    .WithPort(25575)
    .WithPassword("admin-password")
    .WithTimeout(TimeSpan.FromSeconds(10))
    .Build();

try
{
    // Connect to server
    await client.ConnectAsync();
    
    // Execute raw command
    var response = await client.ExecuteAsync("say Hello World");
    Console.WriteLine(response);
}
finally
{
    await client.DisconnectAsync();
    client.Dispose();
}

Features

? No external dependencies
? Async/await support
? Configurable timeouts
? Connection pooling support
? Thread-safe operations
? Comprehensive error handling

Documentation

For more information about the RCON protocol, see:

License

MIT License - See LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on RCON.Net:

Package Downloads
RCON.Net.Commands

RCON command lib.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.1 353 11/12/2025
1.1.0 320 11/12/2025
1.0.0 251 11/9/2025