Microsoft.Windows.Compatibility 8.0.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
Verify
Enables verification of complex models and documents.
31
Verify
Enables verification of complex models and documents.
22
Verify
Enables simple verification of complex models and documents.
22
DiffEngine
Launches diff tools based on file extensions. Designed to be consumed by snapshot testing libraries.
21
Verify
Enables verification of complex models and documents.
21
Verify
Enables simple verification of complex models and documents.
21
Verify
Enables verification of complex models and documents.
20
Verify
Enables simple verification of complex models and documents.
20

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

.NET 6.0

.NET Standard 2.0

.NET 8.0

.NET Standard 2.1

.NET 7.0

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