MAUI Dependency error

Sergio 11 Reputation points
2022-12-07T16:25:51.73+00:00

Hi, I'm trying to create a new project in MAUI but I get dependency errors. I have VS Community installed and updated with all C# content. I have two PCs and did the same installation in both, but in one of them does not work. I have tried uninstalling, but still does not work.

268248-errors.png

This is what I have installed.

268276-content.png

Dependency error.

268249-dependency.png

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,578 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Leon Lu (Shanghai Wicresoft Co,.Ltd.) 76,386 Reputation points Microsoft Vendor
    2022-12-09T07:53:39.26+00:00

    Hello,​

    Based on your screenshot, your project lack of net6.0-android , net6.0-ios, net6.0-maccatalyst dependencies.

    Firstly, please open your VS installer, choose the VS 2022 Preview, click Modify, install the .NET Multi-platform App UI development workload like following document.
    https://learn.microsoft.com/en-us/dotnet/maui/get-started/first-app?pivots=devices-android#get-started-with-visual-studio-2022-173-preview

    It is recommended to install it from VS installer. However, if you want to install it with command line. Please close your VS. Delete all of files from C:\Program Files\dotnet\metadata\workloads. Then Run dotnet workload install maui in command line.

    Best Regards,

    Leon Lu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.