1

I tried updating my project from netstandard2.0 to net6.0 by changing MobileApp.csprj file line:

 <TargetFramework>netstandard2.0</TargetFramework>

To

 <TargetFramework>net6.0</TargetFramework>

Now I get errors:

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

How do I resolve this? I tried changing version to 13.0 manually in

<Reference Include="Mono.Android">
      <HintPath>..\..\..\..\..\..\..\..\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v13.0\Mono.Android.dll</HintPath>
  

But Visual Studio even after reopening it gives same error. So how do I resolve this? I tried updating my project in first place bacause I wasnt able to use some NuGet packages because of older version.

vytaute
  • 1,260
  • 4
  • 16
  • 36
  • Does this link [Xamarin - How to update Mono.Android version to resolve dependencies?](https://stackoverflow.com/questions/49246580/xamarin-how-to-update-mono-android-version-to-resolve-dependencies) answered your question? – Guangyu Bai - MSFT Apr 14 '23 at 06:46
  • @GuangyuBai-MSFT No because I dont know where to.find those settings that are show in pictures. On project properties I see only Common properties and Configuration properties but they have just few settings, nothing like in those screenshots – vytaute Apr 14 '23 at 07:19
  • Can you see the `Targetframeworkversion` in your Android.csproj file? – Guangyu Bai - MSFT Apr 14 '23 at 07:55
  • @GuangyuBai-MSFT It is pasted in a question, if we are talking about the same thing? this code snippet shows version: – vytaute Apr 16 '23 at 17:36
  • 1
    You can set the Targetframeworkversion to 13.0 in the Droid.csproj file. – Guangyu Bai - MSFT Apr 17 '23 at 02:24

0 Answers0