Microsoft.Windows.Compatibility 9.0.0-preview.4.24267.11

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:

Showing the top 20 packages that depend on Microsoft.Windows.Compatibility.

Packages Downloads
Devart.Data.Oracle
dotConnect for Oracle is an enhanced database connectivity solution built over ADO.NET architecture and a development framework with a number of innovative technologies. It introduces new approaches for designing a data access layer and boosts the productivity of DB application development. dotConnect offers a complete solution for developing DB-related applications and web sites. This package contains the .NET Standard/.NET Core compatible assemblies with general ADO.NET functionality of dotConnect for Oracle - main ADO.NET classes, Oracle data types support, etc. This package contains only runtime features of dotConnect for Oracle. dotConnect for Oracle is also provided as an installation package (exe), which installs runtime assemblies for Full .NET Framework and a set of design-time tools, integrated into Visual Studio - Server Explorer integration, DataSet tools, Windows Forms components with powerful design-time, etc. Besides, this installer generates the trial key files required for using this package on a trial basis. You can download it at www.devart.com.
6
DiffEngine
Enables simple verification of complex models and documents.
3
DiffEngine
Enables simple verification of complex models and documents.
4
DiffEngine
Enables simple verification of complex models and documents.
5
DiffEngine
Launches diff tools based on file extensions. Designed to be consumed by snapshot testing libraries.
3
DiffEngine
Launches diff tools based on file extensions. Designed to be consumed by snapshot testing libraries.
4
Topshelf
Topshelf is an open source project for hosting services without friction. By referencing Topshelf, your console application *becomes* a service installer with a comprehensive set of command-line options for installing, configuring, and running your application as a service.
3

https://go.microsoft.com/fwlink/?LinkID=799421

.NET 8.0

.NET Standard 2.0

.NET Standard 2.1

.NET 9.0

Version Downloads Last updated
9.0.0-preview.4.24267.11 1 06/02/2024
9.0.0-preview.3.24175.3 8 05/10/2024
9.0.0-preview.2.24128.10 2 05/05/2024
9.0.0-preview.1.24081.3 5 04/30/2024
8.0.4 5 05/20/2024
8.0.3 5 05/13/2024
8.0.2 5 05/01/2024
8.0.1 1 05/31/2024
8.0.0 4 05/25/2024
8.0.0-rc.2.23479.10 5 05/17/2024
8.0.0-rc.1.23420.5 3 06/02/2024
8.0.0-preview.7.23376.1 2 06/02/2024
8.0.0-preview.6.23329.4 3 05/06/2024
8.0.0-preview.5.23302.2 1 06/02/2024
8.0.0-preview.4.23260.1 3 05/03/2024
8.0.0-preview.3.23174.8 3 05/06/2024
8.0.0-preview.2.23128.3 5 06/02/2024
8.0.0-preview.1.23110.8 3 05/16/2024
7.0.6 5 05/19/2024
7.0.5 4 05/06/2024
7.0.4 4 05/31/2024
7.0.3 4 05/01/2024
7.0.1 1 05/31/2024
7.0.0 3 05/08/2024
7.0.0-rc.2.22472.3 5 05/02/2024
7.0.0-rc.1.22426.10 4 06/02/2024
7.0.0-preview.7.22375.6 5 06/02/2024
7.0.0-preview.6.22324.4 1 06/02/2024
7.0.0-preview.5.22301.12 4 05/05/2024
7.0.0-preview.4.22229.4 3 06/02/2024
7.0.0-preview.3.22175.4 5 05/01/2024
7.0.0-preview.2.22152.2 4 06/02/2024
7.0.0-preview.1.22076.8 1 06/02/2024
6.0.8 4 05/03/2024
6.0.7 4 05/31/2024
6.0.6 6 05/01/2024
6.0.4 2 05/11/2024
6.0.3 5 05/01/2024
6.0.2 2 05/01/2024
6.0.2-mauipre.1.22102.15 1 06/02/2024
6.0.2-mauipre.1.22054.8 3 06/02/2024
6.0.0 2 05/06/2024
6.0.0-rc.2.21480.5 4 05/09/2024
6.0.0-rc.1.21451.13 1 06/02/2024
6.0.0-preview.7.21377.19 4 05/02/2024
6.0.0-preview.6.21352.13 2 06/02/2024
6.0.0-preview.5.21301.5 3 05/22/2024
6.0.0-preview.4.21253.7 1 06/02/2024
6.0.0-preview.3.21201.4 5 05/07/2024
6.0.0-preview.2.21154.6 3 06/02/2024
6.0.0-preview.1.21102.12 1 06/02/2024
5.0.2 3 05/31/2024
5.0.1 1 05/31/2024
5.0.0 5 09/13/2022
5.0.0-rc.2.20475.5 2 05/25/2024
5.0.0-rc.1.20451.14 2 05/27/2024
5.0.0-preview.8.20407.11 2 06/02/2024
5.0.0-preview.7.20364.11 1 06/02/2024
5.0.0-preview.6.20305.6 4 06/02/2024
5.0.0-preview.5.20278.1 3 06/02/2024
5.0.0-preview.4.20251.6 1 06/02/2024
5.0.0-preview.3.20214.6 8 05/09/2024
5.0.0-preview.2.20160.6 4 06/02/2024
5.0.0-preview.1.20120.5 2 06/02/2024
3.1.5 4 05/08/2024
3.1.4 1 05/31/2024
3.1.2 4 05/11/2024
3.1.1 3 05/08/2024
3.1.0 689 03/03/2023
3.1.0-preview3.19551.4 2 05/02/2024
3.1.0-preview2.19523.17 2 05/04/2024
3.1.0-preview1.19504.10 4 05/01/2024
3.0.1 3 05/08/2024
3.0.0 2 05/10/2024
3.0.0-rc1.19456.4 2 06/02/2024
3.0.0-preview9.19421.4 3 06/02/2024
3.0.0-preview9.19416.11 1 06/02/2024
3.0.0-preview8.19405.3 3 06/02/2024
3.0.0-preview7.19362.9 1 06/02/2024
3.0.0-preview6.19303.8 2 05/01/2024
3.0.0-preview6.19264.9 2 05/01/2024
3.0.0-preview5.19224.8 3 06/02/2024
3.0.0-preview4.19212.13 4 05/01/2024
2.1.1 2 05/26/2024
2.1.0-preview3.19128.7 3 06/02/2024
2.1.0-preview.19073.11 3 06/02/2024
2.1.0-preview.18571.3 1 06/02/2024
2.0.1 3 05/04/2024
2.0.0 1 05/04/2024
2.0.0-rc1 4 06/02/2024
2.0.0-preview2-26406-04 4 05/22/2024
2.0.0-preview1-26216-02 5 05/01/2024
2.0.0-preview1-25914-04 2 05/23/2024