Run .NET MAUI apps with Visual Studio for Mac
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!
.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.
Tags In
4 Comments
Leave a Reply Cancel reply
This site uses Akismet to reduce spam. Learn how your comment data is processed.
Hi, I am András,
I am a seasoned software engineer from Budapest, Hungary with a strong focus on mobile app development using .NET MAUI and Xamarin.Forms. My expertise also extends to website building for my happy customers and other complex system designing. I am passionate about developing well-organized, maintainable software solutions.
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.
Thanks for noting that David!
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?
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