我们目前刚刚开始在 .NET Standard 中编写类库,因此我们可以将其用于 WPF、Winforms 和 .Net Core 与 Ubuntu Server(但没有 GUI)。对于我们的 .NET 4.6.x 应用程序,.Net 5 不支持 Winforms 或 WPF。
我的问题是,.NET MAUI 是否与 .NET Standard 2.0 类库兼容?
当我查看 .NET Standard 网站时,它说与 .NET 6.0 兼容,但我找不到是否也与 .NET MAUI 框架兼容。
https://dotnet.microsoft.com/platform/dotnet-standard#versions
最佳答案
My question is, will .NET MAUI be compatible with .NET Standard 2.0 class libraries?
是的,因为正如评论中提到的那样,.NET MAUI 只是一个库。您不使用 MAUI 进行编译,而是使用 .NET 6。
从 2.0 开始的所有 .NET Core 版本都可以引用 .NET Standard 2.0 库,并且由于 .NET 6 只是 .NET Core 5 的重命名,这当然是可能的。
然而,问题就在这里:
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.
您不能在 Linux/MacOS 中使用 WPF 或 Winforms。您也不能在 Linux 中使用 .NET MAUI,因为(当前)没有针对该环境的目标。支持的桌面环境与 Xamarin 相同:Windows 和 MacOS。
注意它被提到了here .NET 7 正在考虑对 Linux 的支持,它应该会在大约一年内发布。
关于c# - .Net MAUI 是否与 .NET Standard 2.0 兼容?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69300333/