Should it be possible to build a Windows MAUI app on a Mac?

James Lavery 20 Reputation points
2023-07-23T11:13:51.4666667+00:00

I've got Visual Studio 2022 installed on my Mac, and can build for Android, iOS and Mac. However, building for Windows is failing with the error:

Error CS5001: Program does not contain a static 'Main' method suitable for an entry point (CS5001) (MAUIApp3)

I know I won't be able to run the Windows version on the Mac, but should I be able to build it on the Mac?

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

Accepted answer
  1. Leon Lu (Shanghai Wicresoft Co,.Ltd.) 72,251 Reputation points Microsoft Vendor
    2023-07-24T07:12:21.14+00:00

    Hello,

    should I be able to build it on the Mac?

    No, MAUI application for windows platform is using Windows UI Library (WinUI) 3.

    Currently, WinUI 3 applications cannot be built directly on macOS using Visual Studio for Mac. WinUI 3 is a user interface framework provided by Microsoft for building modern Windows applications.

    WinUI 3 applications require Windows as the development environment because they rely on the Windows App SDK and the underlying Windows operating system components.

    If you want to build MAUI application for windows platform, you will need to use a Windows machine with Visual Studio installed.

    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.

1 additional answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 61,731 Reputation points
    2023-07-25T01:56:10.95+00:00

    You could install parallels and run the windows vs to build the windows app.