Search code examples
c#class-library.net-standard-2.0maui

Will .Net MAUI be comptabile with .NET Standard 2.0?


We currently just started to write class libraries in .NET Standard so we can use this for WPF, Winforms and .Net Core with Ubuntu Server (but then without GUI). .Net 5 does not support Winforms or WPF for our .NET 4.6.x applications.

My question is, will .NET MAUI be compatible with .NET Standard 2.0 class libraries?

When I look at the .NET Standard website its says compatibility with .NET 6.0, but I can't find if that also the .NET MAUI framework.

https://dotnet.microsoft.com/platform/dotnet-standard#versions


Solution

  • My question is, will .NET MAUI be compatible with .NET Standard 2.0 class libraries?

    Yes, because, as it was mentioned in comments, .NET MAUI is just a library. You don't compile with MAUI, but rather with .NET 6.
    All .NET Core versions starting from 2.0 can reference .NET Standard 2.0 libraries, and since .NET 6 is just a rename of what would be .NET Core 5, that is certainly possible.

    The problem, however, is here:

    We currently just started to write class libraries in .NET Standard so we can use this for WPF, Winforms and .Net Core with Ubuntu Server. .Net 5 does not support Winforms or WPF.

    You can't use WPF nor Winforms in Linux/MacOS. You also can't use .NET MAUI in Linux as there is (currently) no target for that environment. The desktop environments supported are the same as for Xamarin: Windows and MacOS.

    Notice that it was mentioned here that support for Linux is being considered for .NET 7, which should be released in around a year.