Search code examples
xamarin.androidmvvmcross

Port Xamarin Android project to .net6.0-android


I have a Xamarin Android Project that I want to migrate to .net6.0-android so I can use the new versions of MvvmCross. I have tried the upgrade-assistant. It claims to only upgrade Xamarin forms apps. I tried try-convert and it only seems to use msbuild through .net5.0. Can anyone tell me the correct steps to do this migration?

Thanks, Jim


Solution

  • I wanted to maintain consistency in my Git Repository, so here is what I did. I made sure my app used the new PackageReference (to do this, if your project has a packages.config, you can right click it and it will give you an option to migrate). I created a blank .net6.0-android app. I copied the contents of my original app .proj to notepad to keep track of what NuGet packages I had been using. I then overwrote the contents of my original app .proj file with the contents of the blank app .proj. I used Nuget to add back in the required packages. I had to delete AssemblyInfo.cs in the Properties folder and Resource.Designer.cs in the Resources folder. I deleted the obj and bin folders in the project folder. After that, I was able to compile and run fine.