dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.74k stars 1.07k forks source link

Project restore fails for .NET MAUI Hybrid App on .NET 8 - Workload dependency issue #40978

Closed egvijayanand closed 5 months ago

egvijayanand commented 6 months ago

Description

Have created a new .NET MAUI Hybrid app on .NET 8 and tried to restore the dependencies.

Unfortunately, the restore failed even after installing the prerequisite workloads.

Here's the list of workloads installed.

Installed Workload Id Manifest Version Installation Source
android 34.0.95/8.0.100 SDK 8.0.300, VS 17.10.34902.84
ios 17.2.8053/8.0.100 SDK 8.0.300, VS 17.10.34902.84
maccatalyst 17.2.8053/8.0.100 SDK 8.0.300, VS 17.10.34902.84
maui 8.0.21/8.0.100 SDK 8.0.300
maui-windows 8.0.21/8.0.100 SDK 8.0.300, VS 17.10.34902.84
wasi-experimental 8.0.5/8.0.100 SDK 8.0.300

Steps to Reproduce

  1. Create a new .NET MAUI Hybrid app on .NET 8
  2. Try to restore the project, it results in an error
  3. Run the workload restore command and then try project restore again
dotnet new maui-blazor -o MauiApp1
cd MauiApp1\
dotnet restore
dotnet workload restore

Link to public reproduction project repository

The default template itself is sufficient, no authored code

Version with bug

8.0.40 SR5

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.21 SR4.1

Affected platforms

Android

Affected platform versions

Android 34.0

Did you find any workaround?

Nope.

Relevant log output

C:\Program Files\dotnet\sdk\8.0.300\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147
: To build this project, the following workloads must be installed: wasi-experimental [E:\MauiApp1\MauiApp1.csproj::TargetFramework=net8.0-android]
C:\Program Files\dotnet\sdk\8.0.300\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147
: To install these workloads, run the following command: dotnet workload restore [E:\MauiApp1\MauiApp1.csproj::TargetFramework=net8.0-android]
github-actions[bot] commented 6 months ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

egvijayanand commented 6 months ago

This issue is not specific to the Hybrid app. Observed in the regular app as well.

A show stopper. Needs at least a workaround immediately.

marcpopMSFT commented 5 months ago

@egvijayanand are you able to provide the output of dotnet build -getItem:MissingWorkloadPack and the output of dotnet workload --info?

egvijayanand commented 5 months ago

@marcpopMSFT This issue can be marked as closed as I'm unable to reproduce this issue after updating to VS2022 17.11 Preview 1.0.