SimConnect.NET 0.1.17

dotnet add package SimConnect.NET --version 0.1.17
                    
NuGet\Install-Package SimConnect.NET -Version 0.1.17
                    
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="SimConnect.NET" Version="0.1.17" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SimConnect.NET" Version="0.1.17" />
                    
Directory.Packages.props
<PackageReference Include="SimConnect.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 SimConnect.NET --version 0.1.17
                    
#r "nuget: SimConnect.NET, 0.1.17"
                    
#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 SimConnect.NET@0.1.17
                    
#: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=SimConnect.NET&version=0.1.17
                    
Install as a Cake Addin
#tool nuget:?package=SimConnect.NET&version=0.1.17
                    
Install as a Cake Tool

SimConnect.NET

A modern, high-performance C# wrapper for Microsoft Flight Simulator's SimConnect SDK. It simplifies flight simulation development by providing async/await patterns and high-level abstractions, enabling real-time aircraft data monitoring, AI object management, and seamless integration with the simulator through a clean, type-safe API.

⚠️ Beta Software Notice

SimConnect.NET is currently in beta development. APIs may change, features may be added or removed, and breaking changes are expected between releases. Use in production environments at your own discretion and always test thoroughly before deploying.

Features

  • Async/Await Support: Modern asynchronous patterns for all SimConnect operations
  • High-Level Abstractions: Simplified API for common flight simulation tasks
  • Type-Safe Interface: Strong typing with automatic data type inference
  • Real-Time Data: Efficient aircraft data monitoring and SimVar access
  • AI Object Management: Create and manage AI aircraft and objects
  • Multi-Framework Support: Compatible with .NET 8.0 and .NET 9.0

Quick Start

  1. Install the NuGet package:

    dotnet add package SimConnect.NET
    
  2. Basic usage example:

    using SimConnect.NET;
    
    var client = new SimConnectClient();
    await client.ConnectAsync();
    
    // Get aircraft data
    var altitude = await client.SimVars.GetAsync<double>("PLANE ALTITUDE", "feet");
    var airspeed = await client.SimVars.GetAsync<double>("AIRSPEED INDICATED", "knots");
    
    Console.WriteLine($"Altitude: {altitude:F0} ft");
    Console.WriteLine($"Airspeed: {airspeed:F0} kts");
    

Requirements

  • Microsoft Flight Simulator 2020 or later
  • .NET 8.0 or .NET 9.0 runtime
  • SimConnect SDK (included with Flight Simulator)

Documentation

For comprehensive documentation, examples, and API reference, visit our GitHub repository: https://github.com/stopbars/SimConnect.NET

Contributing

We welcome contributions from the community! Please visit our GitHub repository for contribution guidelines, issue reporting, and development information.

License

This project is licensed under the MIT License. See the LICENSE file in the GitHub repository for details.

Disclaimer

SimConnect.NET is an independent third-party software project. We are not affiliated with, endorsed by, or connected to Microsoft Flight Simulator or any other simulation software.

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 was computed.  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.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

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
0.1.17 285 11/14/2025
0.1.16-beta 180 10/20/2025
0.1.15-beta 231 9/23/2025
0.1.14-beta 339 8/25/2025
0.1.13-beta 195 8/24/2025
0.1.12-beta 97 8/23/2025
0.1.11-beta 124 8/22/2025
0.1.10-beta 175 8/21/2025
0.1.9-beta 178 8/20/2025
0.1.8-beta 182 8/10/2025
0.1.7-beta 121 8/10/2025
0.1.6-beta.1 122 8/9/2025
0.1.5-beta 156 8/9/2025
0.1.4-beta 207 8/8/2025
0.1.3-beta 248 8/7/2025

### Added

-   Introduced `ExceptionHelper` and wired it into the client, SimVar manager, logger, and input-event flows so background loops now swallow only non-critical exceptions while allowing fatal runtime issues to surface.
-   Automatic SimVar type inference now understands `SimConnectDataInitPosition`, letting scalar and struct-based calls pick the correct `SimConnectDataType.InitPosition` without manual annotations.

### Changed

-   Struct-based `SimVars.SetAsync<TStruct>` reuses a cached writer delegate and layout per definition ID (`defToWriter`) and fails fast with a clear error when a writer is missing, keeping writes aligned with the cached reader pipeline.
-   String fields written through the struct pipeline now emit fixed-size, null-terminated ANSI buffers without intermediate allocations, matching SimConnect’s expectations and avoiding buffer overruns.
-   Validation and messaging now consistently reference `[SimConnect]` attributes, and `SimVars.SetAsync` switches to `ArgumentNullException` for the `unit` parameter so SimVars that rely on default units (e.g., “INITIAL POSITION”) can be written.
-   SimConnect client message loops, the SimVar manager, and `SimConnectLogger` gate debug logging with `SimConnectLogger.IsLevelEnabled`, use the shared `ExceptionHelper`, and improve diagnostics (e.g., disconnect/reconnect cancellation messages, suppressed callback logging) for quieter yet more informative logs.
-   Input event enumeration and value parsing became more defensive: node names default to empty strings, doubles are only decoded when the payload actually contains eight bytes, and `InputEventValue` try-get helpers catch `InvalidCastException`, `FormatException`, and `OverflowException` to prevent spurious crashes.
-   Integration tests received maintenance—`TestRunner` now reuses a single `SimConnectClient`, AI object tests use double arithmetic for position offsets, and connection tests drop unused locals—leading to steadier end-to-end coverage.

### Fixed

-   Struct writers now enforce cached layouts plus fixed-size ANSI encoding when sending data back to SimConnect, eliminating garbled string fields and layout drift when multiple structs are written in succession.
-   `SimVarManager` logs and safely ignores null pending-request slots, reports unknown definition IDs cleanly, and surfaces missing struct writers instead of breaking the message loop.
-   Subscription callbacks dispatched through `SimVarRequest` now log suppressed user exceptions (without crashing the SimConnect thread), improving observability when user code faults.