The .NET 6 team has done another step in the direction of uniforming the processes and tools of writing code for different platforms. Now it is possible to install the stack to compile applications for Android and work with it only via dotnet cli.


Developing cross-platform mobile apps can be done with a large variety of frameworks and tools, but, for native applications (or close-to-native performance), the selection is limited. Xamarin is one of the frameworks that is considered native, and it has evolved a lot over time to stay updated with the latest improvements and features of the mobile OSes.

Up until recently, Xamarin could only be developed with ease in the Visual Studio IDE. The downside is that someone might consider it limiting when it comes to license. On the other hand, VS Code is more widely used by a large group of developers.

The latest version of .NET 6 brought Xamarin inside the dotnet tooling in the form of workload and it’s now possible to get a fully functional development environment, that requires only the dotnet SDK.

What changes

Now it is possible to target Android in a C# project file using the standard SDK project. Here is an example file:

<Project Sdk="Microsoft.NET.Sdk">
<PackageReference Include="Xamarin.AndroidX.Arch.Core.Runtime" Version="" />

VS Code setup

  1. Have VS Code ready
  2. Install dotnet SDK
  3. Add dotnet workload for Android
    dotnet workload install android-aot
  4. Open the sample project
  5. Install the extensions
  6. Start the emulator from the task


  1. Start the build task
  2. Select the target Run
  3. Wait until the emulator is loaded with the app and it’s showing a white screen
  4. Attach the debugger to start the application

And more

Another area with huge improvements is binding libraries. Just change <OutputType>Library</OutputType> and add the jar or aar. Add Metadata.xml if needed. That’s it.
For more information, have a look here.