I have installed Windows 10 20H2 version in my system. And Visual Studio Professional 2019 and Visual Studio Professional 2019 preview. Followed the below link for MAUI setup.
https://docs.microsoft.com/en-us/dotnet/maui/get-started/installation.
I have installed .Net MAUI preview 5. And ensured maui-check. All looks great.
But, when I create new project in MAUI and try to build, following errors showing.
error NETSDK1112: The runtime pack for Microsoft.iOS.Runtime.iossimulator-x64 was not downloaded. Try running a NuGet restore with the RuntimeIdentifier 'iossimulator-x64'. 1>Done building project "MauiApp5.csproj" -- FAILED.
error NETSDK1112: The runtime pack for Microsoft.MacCatalyst.Runtime.maccatalyst-x64 was not downloaded. Try running a NuGet restore with the RuntimeIdentifier 'maccatalyst-x64'. 1>Done building project "MauiApp5.csproj" -- FAILED.
I have done Visual Studio repair several times and cleaned nuget cache. I don't know what is the problem.
And showing below warning also.
Warning MSB3779 The processor architecture of the project being built "Any CPU" is not supported by the referenced SDK "Microsoft.VCLibs.Desktop, Version=14.0". Please consider changing the targeted processor architecture of your project (in Visual Studio this can be done through the Configuration Manager) to one of the architectures supported by the SDK: "x86, x64, ARM, ARM64". MauiApp5.WinUI C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets 2472
I try to resolve these problem, but no luck.
I am playing with MAUI in VS2022. And I had similar problem.
if you run
dotnet workload list you probably won't see anything in that list`
Running dotnet workload search will show available workloads
I installed all available maui workloads:
Workload Id
------------
maui
maui-android
maui-core
maui-desktop
maui-ios
maui-mobile
I see the same thing - here is what I did.
Right click your WinUI project in your MAUI solution and choose Properties. Then on the Build tab change the target framework to x86, x64 etc.
That solved the problem you are seeing but I still see lots of other problems even following Microsoft's step by step guide.
HTH
Andy
Per Andy's suggestion, I switched from "Any CPU" to "x64", etc. Then switch backed to "Any CPU", and the problem went away.