Andr谩s T贸th‘s professional blog
banditoth.net

Hey there 馃憢, I’m banditoth a .NET MAUI developer from Hungary.
I write about software development with .NET technologies.

You can find me on:
LinkedIn | Github | StackOverflow | X / Twitter | Threads

Run .NET MAUI apps with Visual Studio for Mac

This content has 3 years. Some of the information in this post may be out of date or no longer work. Please, read this page keeping its age in your mind.

VS for Mac 17.0 Preview version is not yet supporting MAUI applications. But you can run them on macOS too, but you will need a terminal window for it!

MAUI projects can not be set as a runnable project (yet)
.NET 6 Xamarin and MAUl projects are not supported with this version of Visual Studio. The included target frameworks are not supported: net6.0-android|net6.0-ios|net6.0-maccatalyst

If you are not familiar, how to set up your environment to start developing with .NET newest technology named MAUI, then read this article by me: https://www.banditoth.hu/2021/12/29/setup-net-maui-project-on-macos/

Build and run on macOS

Open up a terminal, and navigate next to your .sln file. Give out the following command:

dotnet build YourSolutionName -t:Run -f net6.0-maccatalyst

This will run your application on macOS. If you wish, you can change the last parameter to net6.0-android or net6.0-ios too.

4 responses to “Run .NET MAUI apps with Visual Studio for Mac”

  1. David McCollough Avatar
    David McCollough

    Andras,

    This is something the VS for Mac team did on purpose. In Preview 6 if I modified the project file to only target .net6.0-maccatalyst I could run a Maui project and debug on my Mac. Since preview 7 came out it no longer works, yes I can do it from the terminal as you suggest, but you cannot debug.

    1. banditoth Avatar
      banditoth

      Thanks for noting that David!

  2. Pierre Avatar
    Pierre

    Hi,
    I don’t know if you have or had the same issue than me.
    When I build and run the default template app it works fine.
    But when I modify the code behind c# (i.e.: MainPage.xaml.cs) my changes are not taking into account, event when cleaning, rebuilding or restarting VS.
    Any thoughts?

    1. banditoth Avatar
      banditoth

      Hey Pierre!

      Make sure that you are builing the same project where are you making changes in the code.
      Delete the bin / obj directories by hand, restart VS.

      It might help for you

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.