Microsoft.Windows.Compatibility 10.0.0-preview.7.25380.108

Prefix Reserved
This is a prerelease version of Microsoft.Windows.Compatibility.
dotnet add package Microsoft.Windows.Compatibility --version 10.0.0-preview.7.25380.108
                    
NuGet\Install-Package Microsoft.Windows.Compatibility -Version 10.0.0-preview.7.25380.108
                    
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="Microsoft.Windows.Compatibility" Version="10.0.0-preview.7.25380.108" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Microsoft.Windows.Compatibility" Version="10.0.0-preview.7.25380.108" />
                    
Directory.Packages.props
<PackageReference Include="Microsoft.Windows.Compatibility" />
                    
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 Microsoft.Windows.Compatibility --version 10.0.0-preview.7.25380.108
                    
#r "nuget: Microsoft.Windows.Compatibility, 10.0.0-preview.7.25380.108"
                    
#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 Microsoft.Windows.Compatibility@10.0.0-preview.7.25380.108
                    
#: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=Microsoft.Windows.Compatibility&version=10.0.0-preview.7.25380.108&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Microsoft.Windows.Compatibility&version=10.0.0-preview.7.25380.108&prerelease
                    
Install as a Cake Tool

Microsoft.Windows.Compatibility

The Microsoft.Windows.Compatibility package provides Windows-specific APIs to help you port your .NET Framework applications to .NET Core 2.0+, .NET 5+ or .NET Standard. This package offers a smoother transition for those looking to modernize their applications without losing access to familiar Windows functionalities.

Getting Started

To start using the Microsoft.Windows.Compatibility package, you'll first need to install it via NuGet Package Manager, Package Manager Console, or by editing your project file.

Usage

After installing the package, you can access Windows-specific APIs just like you would in a .NET Framework application. Below are some examples in both C# and VB:

Writing to the Windows Registry

C#
using Microsoft.Win32;

class Program
{
    static void Main()
    {
        using (RegistryKey key = Registry.CurrentUser.CreateSubKey("Software\\MyApp"))
        {
            key.SetValue("MySetting", "MyValue");
        }
    }
}
VB
Imports Microsoft.Win32

Module Program
    Sub Main()
        Using key As RegistryKey = Registry.CurrentUser.CreateSubKey("Software\MyApp")
            key.SetValue("MySetting", "MyValue")
        End Using
    End Sub
End Module

Using the Serial Port

C#
using System.IO.Ports;

class Program
{
    static void Main()
    {
        using (SerialPort port = new SerialPort("COM1", 9600))
        {
            port.Open();
            port.WriteLine("Hello, world!");
        }
    }
}
VB
Imports System.IO.Ports

Module Program
    Sub Main()
        Using port As New SerialPort("COM1", 9600)
            port.Open()
            port.WriteLine("Hello, world!")
        End Using
    End Sub
End Module

Additional Documentation

For more in-depth tutorials and API references, you can check the following resources:

Feedback

We value your feedback! Here are ways to get in touch with us:

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

GitHub repositories (96)

Showing the top 20 popular GitHub repositories that depend on Microsoft.Windows.Compatibility:

Repository Stars
microsoft/PowerToys
Windows system utilities to maximize productivity
PowerShell/PowerShell
PowerShell for every system!
NickeManarin/ScreenToGif
🎬 ScreenToGif allows you to record a selected area of your screen, edit and save it as a gif or video.
unoplatform/uno
Open-source platform for building cross-platform native Mobile, Web, Desktop and Embedded apps quickly. Create rich, C#/XAML, single-codebase apps from any IDE. Hot Reload included! 90m+ NuGet Downloads!!
subhra74/xdm
Powerfull download accelerator and video downloader
PrismLibrary/Prism
Prism is a framework for building loosely coupled, maintainable, and testable XAML applications in WPF, Xamarin Forms, and Uno / Win UI Applications..
mono/SkiaSharp
SkiaSharp is a cross-platform 2D graphics API for .NET platforms based on Google's Skia Graphics Library. It provides a comprehensive 2D API that can be used across mobile, server and desktop models to render images.
dotnet/samples
Sample code referenced by the .NET documentation
memstechtips/Winhance
Application designed to optimize and customize your Windows experience.
cairoshell/cairoshell
Cairo is a customizable, intuitive desktop environment for Windows.
RoundedTB/RoundedTB
Add margins, rounded corners and segments to your taskbars!
microsoft/AttackSurfaceAnalyzer
Attack Surface Analyzer can help you analyze your operating system's security configuration for changes during software installation.
thepirat000/Audit.NET
An extensible framework to audit executing operations in .NET and .NET Core.
NuGetPackageExplorer/NuGetPackageExplorer
Create, update and deploy Nuget Packages with a GUI
shaked6540/YoutubePlaylistDownloader
A tool to download whole playlists, channels or single videos from youtube and also optionally convert them to almost any format you would like
SteamAutoCracks/Steam-auto-crack
Steam Game Automatic Cracker
ArduPilot/MissionPlanner
Mission Planner Ground Control Station for ArduPilot (c# .net)
zsh2401/AutumnBox
图形化ADB工具箱
MCCTeam/Minecraft-Console-Client
Lightweight console for Minecraft chat and automated scripts
imDema/FreeMove
Move directories without breaking shortcuts or installations