1

I have added the MAUI workload in Visual Studio 2022 v17.3.0 Preview 1.1 and I have the following set of errors after creating my project.

206489-image.png

Errors:

Severity Code Description Project File Line Suppression State Warning NU1505 Duplicate 'PackageDownload' items found. Remove the duplicate items or use the Update functionality to ensure a consistent restore behavior. The duplicate 'PackageDownload' items are: Microsoft.NETCore.App.Host.win-x64 [6.0.3], Microsoft.NETCore.App.Host.win-x64 [6.0.3], Microsoft.NETCore.App.Host.win-x64 [6.0.3], Microsoft.NETCore.App.Host.win-x64 [6.0.3]. MauiApp2 C:\Users\Trevoir\source\repos\MauiApp2\MauiApp2\MauiApp2.csproj 1
Error NU1012 Platform version is not present for one or more target frameworks, even though they have specified a platform: net6.0-android, net6.0-ios, net6.0-maccatalyst MauiApp2 C:\Users\Trevoir\source\repos\MauiApp2\MauiApp2\MauiApp2.csproj 1
Error NU1012 Platform version is not present for one or more target frameworks, even though they have specified a platform: net6.0-android, net6.0-ios, net6.0-maccatalyst MauiApp2 C:\Users\Trevoir\source\repos\MauiApp2\MauiApp2\MauiApp2.csproj 1
Error NU1012 Platform version is not present for one or more target frameworks, even though they have specified a platform: net6.0-android, net6.0-ios, net6.0-maccatalyst MauiApp2 C:\Users\Trevoir\source\repos\MauiApp2\MauiApp2\MauiApp2.csproj 1
Error NU1012 Platform version is not present for one or more target frameworks, even though they have specified a platform: net6.0-android, net6.0-ios, net6.0-maccatalyst MauiApp2 C:\Users\Trevoir\source\repos\MauiApp2\MauiApp2\MauiApp2.csproj 1
Error NETSDK1139 The target platform identifier android was not recognized. MauiApp2 C:\Program Files\dotnet\sdk\7.0.100-preview.3.22179.4\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets 112 Error NETSDK1139 The target platform identifier ios was not recognized. MauiApp2 C:\Program Files\dotnet\sdk\7.0.100-preview.3.22179.4\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets 112 Error NETSDK1139 The target platform identifier maccatalyst was not recognized. MauiApp2 C:\Program Files\dotnet\sdk\7.0.100-preview.3.22179.4\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets 112

I have done the maui-check and it always ends with the following: maui-check

.NET SDK - Workloads (6.0.200) Checkup... x android-aot (Microsoft.NET.Sdk.Android.Manifest-6.0.200 : 31.0.200-preview.12.2) not installed. x ios (Microsoft.NET.Sdk.iOS.Manifest-6.0.200 : 15.2.200-preview.12.4) not installed. x maccatalyst (Microsoft.NET.Sdk.MacCatalyst.Manifest-6.0.200 : 15.2.200-preview.12.4) not installed. x tvos (Microsoft.NET.Sdk.tvOS.Manifest-6.0.200 : 15.2.200-preview.12.4) not installed. x macos (Microsoft.NET.Sdk.macOS.Manifest-6.0.200 : 12.1.200-preview.12.4) not installed. x maui (Microsoft.NET.Sdk.Maui.Manifest-6.0.200 : 6.0.200-preview.12.2441) not installed. ! Managing Workload installation from the CLI is NOT recommended. Instead you should install the latest Visual Studio preview to automatically get the newest release of .NET MAUI workloads installed.

3
  • please do not post code or errors as images Commented May 30, 2022 at 0:13
  • Is that better? Commented May 30, 2022 at 1:59
  • 1
    DON'T run mauicheck. NOR any "old" way of getting Maui workload. I recommend start all over. UNINSTALL VS Preview. REBOOT pc. Run VS Installer, select Preview version, and Workload ".NET Multi-platform App UI development". CREATE a new project using "Maui" template. BUILD. Commented May 30, 2022 at 3:46

2 Answers 2

1

On PC: IMHO, DON'T run mauicheck. NOR any "old" way of installing Maui workload.

(On Mac, VS 17.3.0 Preview 1.1 still requires a command line step for Android.)

I recommend start all over.

  • UNINSTALL VS Preview.
  • REBOOT pc.
  • Run VS Installer, select
    • Preview version, and
    • Workload ".NET Multi-platform App UI development".
  • CREATE a new project using "Maui" template.
  • BUILD.
Sign up to request clarification or add additional context in comments.

4 Comments

Thank you for taking the time out to make the suggestion. This unfortunately hasn't worked.
If you get different errors now (when build), add them to question. My only other idea is to upgrade to Windows 11 - though I am running fine on Windows 10.
I didn't get any different errors and am running windows 11 I am afraid...
Seems like something is messed up in the VS or Maui installation. I thought uninstalling VS Preview would eliminate whatever is causing the problem. Maybe google clear VS cache.
0

I was able to get it to work by running the following command in the folder containing the .csproj file.

 dotnet workload restore

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.