Microsoft.Windows.Compatibility 9.0.0-preview.7.24405.2

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.
11
DiffEngine
Enables simple verification of complex models and documents.
10
DiffEngine
Enables simple verification of complex models and documents.
11
DiffEngine
Enables simple verification of complex models and documents.
12
DiffEngine
Launches diff tools based on file extensions. Designed to be consumed by snapshot testing libraries.
10
DiffEngine
Launches diff tools based on file extensions. Designed to be consumed by snapshot testing libraries.
11

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