Migrate traditional Xamarin.Android app to support NET6.0 libraries

%3CLINGO-SUB%20id%3D%22%5C%26quot%3Blingo-sub-3162298%5C%26quot%3B%22%20slang%3D%22%5C%26quot%3Ben-US%5C%26quot%3B%22%3EMigrate%20traditional%20Xamarin.Android%20app%20to%20support%20NET6.0%20libraries%26lt%3B%5C%2Flingo-sub%26gt%3B%3CLINGO-BODY%20id%3D%22%5C%26quot%3Blingo-body-3162298%5C%26quot%3B%22%20slang%3D%22%5C%26quot%3Ben-US%5C%26quot%3B%22%3E%3CP%3EI%20have%20a%20%22traditional%22%20xamarin.android%20app%20that%20uses%20a%20lot%20of%20custom%20external%20libraries%20all%20with%20.NET%20standard%202.1%20as%20target%20framework.%20I%20already%20have%20migrated%20my%20xamarin%20droid%20project%20to%20use%20only%20androidX%20libraries%2C%20and%20it%20currently%20has%20Android%2011%20as%20target%20and%20compile%20framework%2C%20so%20now%20I%20just%20want%20to%20migrate%20all%20the%20libraries%20from%20.NET%20standard%20to%20NET6.0.%26lt%3B%5C%2FP%26gt%3B%3C%2FP%3E%3CP%3EIf%20I%20simply%20change%20the%20target%20framework%20of%20my%20libraries%20I%20receveing%20an%20error%20telling%20that%3A%26lt%3B%5C%2FP%26gt%3B%3C%2FP%3E%3CBLOCKQUOTE%3E%3CP%3EProject%20'xxx.csproj'%20targets%20'net6.0'.%20It%20cannot%20be%20referenced%20by%20a%20project%20that%20targets%20'MonoAndroid%2CVersion%3Dv11.0'.%26lt%3B%5C%2FP%26gt%3B%26lt%3B%5C%2FBLOCKQUOTE%26gt%3B%3C%2FP%3E%3CP%3ESo%2C%20I'm%20trying%20to%20understand%20what%20are%20the%20right%20steps%20to%20support%20the%20latest%20NET%20framework%20in%20my%20app.%20What%20should%20have%20I%20to%20do%3F%20Migrate%20all%20my%20Droid%20projects%20to%20NET6%2C%20and%20if%20yes%2C%20how%3F%26lt%3B%5C%2FP%26gt%3B%3C%2FP%3E%3CP%3EI'm%20unable%20to%20find%20official%20neither%20unofficial%20documentation%20about%20this.%26lt%3B%5C%2FP%26gt%3B%26lt%3B%5C%2Flingo-body%26gt%3B%3CLINGO-LABS%20id%3D%22%5C%26quot%3Blingo-labs-3162298%5C%26quot%3B%22%20slang%3D%22%5C%26quot%3Ben-US%5C%26quot%3B%22%3E%3CLINGO-LABEL%3EAndroid%26lt%3B%5C%2Flingo-label%26gt%3B%26lt%3B%5C%2Flingo-labs%26gt%3B%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3C%2FP%3E%3C%2FBLOCKQUOTE%3E%3C%2FLINGO-BODY%3E%3C%2FLINGO-SUB%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3162298%22%20slang%3D%22en-US%22%3EMigrate%20traditional%20Xamarin.Android%20app%20to%20support%20NET6.0%20libraries%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3162298%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20%22traditional%22%20xamarin.android%20app%20that%20uses%20a%20lot%20of%20custom%20external%20libraries%20all%20with%20.NET%20standard%202.1%20as%20target%20framework.%20I%20already%20have%20migrated%20my%20xamarin%20droid%20project%20to%20use%20only%20androidX%20libraries%2C%20and%20it%20currently%20has%20Android%2011%20as%20target%20and%20compile%20framework%2C%20so%20now%20I%20just%20want%20to%20migrate%20all%20the%20libraries%20from%20.NET%20standard%20to%20NET6.0.%3C%2FP%3E%3CP%3EIf%20I%20simply%20change%20the%20target%20framework%20of%20my%20libraries%20I%20receveing%20an%20error%20telling%20that%3A%3C%2FP%3E%3CBLOCKQUOTE%3E%3CP%3EProject%20'xxx.csproj'%20targets%20'net6.0'.%20It%20cannot%20be%20referenced%20by%20a%20project%20that%20targets%20'MonoAndroid%2CVersion%3Dv11.0'.%3C%2FP%3E%3C%2FBLOCKQUOTE%3E%3CP%3ESo%2C%20I'm%20trying%20to%20understand%20what%20are%20the%20right%20steps%20to%20support%20the%20latest%20NET%20framework%20in%20my%20app.%20What%20should%20have%20I%20to%20do%3F%20Migrate%20all%20my%20Droid%20projects%20to%20NET6%2C%20and%20if%20yes%2C%20how%3F%3C%2FP%3E%3CP%3EI'm%20unable%20to%20find%20official%20neither%20unofficial%20documentation%20about%20this.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3162298%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAndroid%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
New Contributor

I have a "traditional" xamarin.android app that uses a lot of custom external libraries all with .NET standard 2.1 as target framework. I already have migrated my xamarin droid project to use only androidX libraries, and it currently has Android 11 as target and compile framework, so now I just want to migrate all the libraries from .NET standard to NET6.0.

If I simply change the target framework of my libraries I receveing an error telling that:

Project 'xxx.csproj' targets 'net6.0'. It cannot be referenced by a project that targets 'MonoAndroid,Version=v11.0'.

So, I'm trying to understand what are the right steps to support the latest NET framework in my app. What should have I to do? Migrate all my Droid projects to NET6, and if yes, how?

I'm unable to find official neither unofficial documentation about this.

2 Replies

Hi @Fjacko ,

Thanks for posting your issue here.However this platform is used for how-to discussions and sharing best practices for building any app with .NET.Since your issue is a technical question, welcome to post it in Microsoft Q&A forum, the support team and communities on Microsoft Q&A will help you for any technical questions.
Besides, it will be appreciated if you can share it here once you post this technical question Microsoft Q&A.
Best Regards,
Lan Huang

@LanHuang thank you for your reply, I just created a new question in Microsoft Q&A forum, have a nice day!