Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add android C# library (Binding Library) to MAUI android references only

Tags:

maui

I have created a .Net C# Android Binding Library. I want to reference that project to only to android references(net6.0-android). When I'm trying to add it is referencing to net6.0, net6.0-android, net6.0-ios, which is not correct as the library is android C# library. How to add the android C# library to MAUI net6.0-android only.

android library should be referenced to MAUI net6.0-android only.

like image 441
Ajay Kumar Avatar asked Sep 11 '25 18:09

Ajay Kumar


1 Answers

It is simpler than it looks, but there is no way (or at least I have not found it) to do it visually or with a wizard.

Just add the reference, then download the project and edit the project file. Find the ItemGroup with the references you want unique to a platform(for example android) and add this: <ItemGroup Condition="$(TargetFramework.Contains('-android')) != false ">

like image 196
Jonathan Martínez Barriuso Avatar answered Sep 14 '25 11:09

Jonathan Martínez Barriuso



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!