Visual studio 2022 Maui missing android and windows dependencies

Jay 20 Reputation points
2024-05-11T16:36:10.93+00:00

Hi,

I'm working on the maui and pretty sure when creating a project I had all dependencies - android, ios, mac, & window. Today I just noticed only two dependecies. How can I get the other two (android & windows) back?

Thanks,

J

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,698 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,977 questions
0 comments No comments
{count} votes

Accepted answer
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 37,031 Reputation points Microsoft Vendor
    2024-05-13T02:52:14.01+00:00

    Hello,

    This issue is caused by missing TargetFrameworks. You could open the .csproj file in the project folder and add the following code to the project folder to retrieve the missing dependencies.

    <TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
    <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
    

    Best Regards,

    Alec Liu.


    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.

    0 comments No comments

0 additional answers

Sort by: Most helpful