sdk: Unable to build the .NET MAUI Preview 9 project, VS IDE reports missing components, maui-check tool unable to find the package as it still points to RC 1 source feed

Description

Unable to build the .NET MAUI Preview 9 project, VS IDE reports missing components, maui-check tool unable to find the package as it still points to RC 1 source

Steps to Reproduce

  1. Update VS2022 to Preview 5 (17.0.0 Preview 5.0) with .NET MAUI (Preview) optional workload installed
  2. Updated the .NET MAUI templates to the latest (preview 9) dotnet new --install Microsoft.Maui.Templates
  3. Tried creating a new .NET MAUI project from both CLI and VS IDE, upon loading the project in VS IDE, it reports missing components, but upon launching VS installer, it reports all the required components are up-to-date. Refer attached screenshots
  4. Tried to update the workloads/missing components to the latest using both dotnet workload update and maui-check and they end up in error as they still point to the RC1 feeds
  5. Error reported by dotnet workload update command - microsoft.net.sdk.maui.manifest-6.0.100.msi.x64::6.0.101-preview.9.1805 is not found in NuGet feeds
  6. Error reported by maui-check command - microsoft.maui.core.ref.android.msi.x64::6.0.101-preview.9.1805 is not found in NuGet feeds

Kindly let me know the RC2 source feed URL to try the same and I tried the below URL but it’s not available (https://pkgs.dev.azure.com/dnceng/public/_packaging/6.0.100-rc.2.21505.57-shipping/nuget/v3/index.json).

Expected Behavior

The project should build and run on all the supported platforms.

Actual Behavior

Reports missing components and there is no solution to install/update them for now.

Basic Information

  • Version with issue: .NET MAUI Preview 9
  • Last known good version: NA
  • IDE: VS 2022 Preview 5 (17.0.0 Preview 5.0)
  • Platform Target Frameworks:
    • iOS:
    • Android:
    • UWP:
  • Android Support Library Version:
  • Nuget Packages:
  • Affected Devices:

Screenshots

dotnetmaui-preview9-component-issue-1 dotnetmaui-preview9-component-issue-2 dotnetmaui-preview9-component-issue-3 dotnetmaui-preview9-component-issue-4

Reproduction Link

Workaround

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 3
  • Comments: 21 (5 by maintainers)

Most upvoted comments

I got mine problem as well, but did resolve which follow like the other preview.

The recommended fix is to manually delete everything under “C:\Program Files\dotnet\metadata\workloads” and then install the workloads manually followed by another run at maui-check. And yup maui-check still help for me.

hope it helps.

Many errors here too after VS update (=> 17.1.0 Preview 1.1)

First quit all VS instances

Then I deleted the content of C:\Program Files\dotnet\metadata\workloads\ (thanks to @mindtalk69)

Finally Powershell with admin rights

dotnet workload update
dotnet workload list
dotnet workload install maui
dotnet workload install maui-android
dotnet workload install maui-ios
maui-check

And all these issues disappeared. Hop it helps.

Post-installation of the Manifest MSI, executing dotnet workload update / maui-check installed all the required components, thus resolving the issue and am able to run the App on Android and Windows.

Request to investigate the issue on why it has not detected the change even though the Manifest already installed as part of VS IDE update.

dotnetmaui-preview9-component-issue-5 dotnetmaui-preview9-component-issue-6

Found a temporary workaround by installing Microsoft.NET.Sdk.Maui.Manifest from this URL

https://download.visualstudio.microsoft.com/download/pr/183b6111-ff83-4e7c-bb14-5dc5ec2aef03/151f076c530b97cc52b98903685eadb11d598150467c7e43db2e536f1850c781/Microsoft.NET.Sdk.Maui.Manifest-6.0.100.6.0.101-preview.9.1843-x64.msi

Download the installer package, launch it and run it in Repair mode even if it is already installed.

As highlighted by @LuohuaRain, there is a lot of NU1603 warnings but am able to deploy the app to an Android physical device.

But still the Windows platform is having issues, trying to resolve it.

It didn’t resolve, the issue still persists. BTW, What’s the source feed for RC2 packages? Here is the output of the build command and the suggested solution from the same (workload install command): E:\Maui\Preview 9\MauiApp2\MauiApp2>dotnet build -f:net6.0-android Microsoft ® Build Engine version 17.0.0-preview-21501-01+bbcce1dff for .NET Copyright © Microsoft Corporation. All rights reserved. Determining projects to restore… C:\Program Files\dotnet\sdk\6.0.100-rc.2.21505.57\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To build this project, the following workloads must be installed: maui-android [E:\Maui\Preview 9\MauiApp2\MauiApp2\MauiApp2.csproj] C:\Program Files\dotnet\sdk\6.0.100-rc.2.21505.57\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To install these workloads, run the following command: dotnet workload install maui-android [E:\Maui\Preview 9\MauiApp2\MauiApp2\MauiApp2.csproj] E:\Maui\Preview 9\MauiApp2\MauiApp2>dotnet workload install maui-android Updated advertising manifest microsoft.net.sdk.android. Updated advertising manifest microsoft.net.sdk.maui. Updated advertising manifest microsoft.net.sdk.macos. Updated advertising manifest microsoft.net.sdk.ios. Updated advertising manifest microsoft.net.workload.emscripten. Updated advertising manifest microsoft.net.workload.mono.toolchain. Updated advertising manifest microsoft.net.sdk.tvos. Updated advertising manifest microsoft.net.sdk.maccatalyst. Downloading Microsoft.Maui.Core.Ref.android.Msi.x64 (6.0.101-preview.9.1805) Downloading Microsoft.Maui.Core.Ref.android.Msi.x64 (6.0.101-preview.9.1805) Workload installation failed. Rolling back installed packs… Downloading microsoft.net.sdk.maui.manifest-6.0.100.msi.x64 (6.0.101-preview.9.1805) Installation rollback failed: One or more errors occurred. (microsoft.net.sdk.maui.manifest-6.0.100.msi.x64::6.0.101-preview.9.1805 is not found in NuGet feeds https://api.nuget.org/v3/index.json;C:\Program Files (x86)\Microsoft SDKs\NuGetPackages;E:\Tasks\Projects\Templates\Release\NuGet".) Workload installation failed: One or more errors occurred. (microsoft.maui.core.ref.android.msi.x64::6.0.101-preview.9.1805 is not found in NuGet feeds https://api.nuget.org/v3/index.json;C:\Program Files (x86)\Microsoft SDKs\NuGetPackages;E:\Tasks\Projects\Templates\Release\NuGet".) Regards, Vijay Anand E G

The solution of @juanlao has worked for me. have you tried restarting VS2022 after executing the command @juanlao says? Have you run the maui-check?

Yes, tried all those possibilities. Workload update, maui-check, VS restart, Machine restart.

From the command of fix applied by maui-check, it is evident that the package source feed still points to RC 1.

dotnet workload update --no-cache --disable-parallel --from-rollback-file "C:\Users\devuser\AppData\Local\Temp\maui-check-36fcb5c0\workload.json" --source "https://api.nuget.org/v3/index.json" --source "https://pkgs.dev.azure.com/dnceng/public/_packaging/6.0.100-rc.1.21458.32-shipping/nuget/v3/index.json"

Could not able to figure out the source feed URL for RC 2/Preview 9, can someone from the MAUI engineering team share the feed URL to resolve this issue?

After run “dotnet build -t:Run -f net6.0-android” in the csproj folder, we were able to deploy again and see all emulators 😃