VS2022 没有MAUI模板的解决方法


原来是要安装 VS 2022 Preview 就是预览版。正式版还没有MAUI。。。。。

以下的尝试都是蛋疼,没有卵用。

命令行窗口输入:dotnet workload install maui

VS 2022 MAUI template is missing · Issue #1473 · dotnet/maui · GitHub

VS2022 final release also doesn't have MAUI templates. I was able to get the templates by running dotnet new --install Microsoft.Maui.Templates command in PowerShell window, but creating a new default MAUI project didn't compile and showed 20+ errors, mostly about types like GridScrollViewerContentPage etc. being undefined. I then went ahead and installed the full MAUI workload (dotnet workload install maui). Took ages and finished successfully, but I still see the same issue in VS2022, i.e. MAUI elements being undefined.

相关