Configure CI pipeline with .NET MAUI Release candidate (for NuGets)

In order to do automated builds in Azure DevOps with the .NET MAUI Release Candidate release, we need a few extra steps in the pipeline configuration. I used these steps to ensure that the NuGet packages I develop are automatically compiled and uploaded to NuGet.org. In this article I won’t go into detail about how to create a CI pipeline, I just want to show you the difference from a normal CI pipeline. I haven’t tried building and deploying applications in the cloud at the moment, but it can probably be done. Also, I don’t go into how to make the package automatically go to NuGet.org, for that I recommend an earlier article (and also how to create a CI/CD pipeline): https://www.banditoth.net/2021/11/09/azure-devops-setup-private-nuget-feed-with-ci/

Since a final version of .NET MAUI has not been released as of today, in order to build our applications in the cloud, we need to install the MAUI Workload on the Agent.
If we do not do this, we may encounter the following error:

Error NETSDK1147: To build this project, the following workloads must be installed: maui-windows

Adjust your pipeline

In order to install the workload on our build agent, create a new task at the very beginning in the pipeline file, which is executes a command in the command line:

This will result the following task in the yaml file:

- task: CmdLine@2
  inputs:
    script: 'dotnet workload install maui'

The installation of the workload will take about 5 minutes.

From now on, you will be able to use .NET Maui references on the pipelines too. This will let you build your packages in the cloud.
Once MAUI will be officially available, probably you don’t need these steps.

Forms.RecurrenceToolkit is discontinued

Just as Xamarin.Forms is changing to a .NET MAUI, banditoth.Forms.RecurrenceToolkit will also undergo a change. As of today, I do not plan to develop any new functionality in the aforementioned package. Some parts of the package will be developed for .NET MAUI compatibility. You will be able to find the new packages in the future with the banditoth.MAUI prefix, which will also be available on GitHub.
I would like to thank you for the more than 2700 downloads.
Bug fixes will continue to be made, so if someone actually uses this for a live application, in that case no worries.

Let’s look at some statistics. The most popular package was MVVM with a total of 623 downloads. This was followed by the Logging package with 459 downloads. The Multilanguage and Converters packages were similarly successful, with around 430 downloads.

I will be back soon with MAUI packages 😉

.NET MAUI RC1 is available with VS for Mac support

Good news for .NET MAUI fans. We’ll soon have a stable version from the wonderful developers at Microsoft, but in the meantime, here we have the first RC version of .NET MAUI.
There’s a lot of new features in this version, including integration with the Essentials package, much more customizable styles, etc.
But today I want to talk about the most important thing for me, which is the support for Visual Studio for Mac. Well, it’s not so official yet, and it’s not so usable, but we can see progress. VS for Mac 2022 is no longer a stranger to MAUI projects. Unfortunately, I couldn’t get the debugging to work, but you can now start the project on almost any platform.

Let’s use MAUI in Visual Studio 2022 for Mac

First and most importantly, and I experienced it first hand.
If the IDE you want to use throws the following errors:

/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(5,5): Error NETSDK1147: To build this project, the following workloads must be installed: maui-maccatalyst
To install these workloads, run the following command: dotnet workload install maui-maccatalyst (NETSDK1147) (ResxEditorMaui)

/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(5,5): Error NETSDK1147: To build this project, the following workloads must be installed: maui-ios
To install these workloads, run the following command: dotnet workload install maui-ios (NETSDK1147) (ResxEditorMaui)

/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(5,5): Error NETSDK1147: To build this project, the following workloads must be installed: maui-android
To install these workloads, run the following command: dotnet workload install maui-android (NETSDK1147) (ResxEditorMaui)

And you can’t install the recommended packages because the following error is displayed:

Workload ID android-aot is not recognized.

Then be sure to install .NET version 6.0.3XX. You can do this from this url and select the appropriate processor architecture. https://github.com/dotnet/installer

To check which version is installed, you can check in the terminal with the following paranncs:

dotnet --info

If you have installed the required version of .NET 6.0, issue the following command:

sudo dotnet workload install maui

You can then use MAUI in Visual Studio for Mac.

Update: Moved banditoth.hu to banditoth.net

dotnet-bot (dotnet bot) · GitHub

Some weeks ago i decided to purchase my .hu domain’s .net version. How funny is that i do love .NET stuff to develop, and the domain associated to my blog is .net? 😀 From today, you will access my blog through https://www.banditoth.net/ instead of the .hu version. No worries, you will have time to rearrange your bookmarks, because banditoth.hu is available for almost two year from now, and it redirects users to the .net version of the site.

Xamarin: Project not selected to build for this solution configuration

If your Xamarin Android, iOS or UWP application is not starting when you are hitting the Run or F5 button, then probably your Build configurations are misconfigured. This usually happens when you are opening a too old source code. No worries, we will have a solution for it.

Solution

Right click on your solution, and select configuration manager
Ensure that the desired project has the deploy column ticked.