Compatibility issue microsoft.identity.client / legacy project

zambinnizambinni Member

Environment: Visual Studio 2017 v15.8.4, .Net framework v4.8.03752; Xamarin Android, target framework 9.0; testing on Samsung Galaxy S8.

packages:
package id="Esri.ArcGISRuntime" version="100.6.0" targetFramework="monoandroid90"
package id="Esri.ArcGISRuntime.Toolkit" version="100.4.0" targetFramework="monoandroid90"
package id="Esri.ArcGISRuntime.Xamarin.Android" version="100.6.0" targetFramework="monoandroid90"
package id="Microsoft.AppCenter" version="1.14.0" targetFramework="monoandroid81"
package id="Microsoft.AppCenter.Analytics" version="1.14.0" targetFramework="monoandroid81"
package id="Microsoft.AppCenter.Crashes" version="1.14.0" targetFramework="monoandroid81"
package id="Microsoft.Identity.Client" version="4.7.1" targetFramework="monoandroid90"
package id="Newtonsoft.Json" version="12.0.1" targetFramework="monoandroid81"
package id="System.Numerics.Vectors" version="4.5.0" targetFramework="monoandroid90"
package id="System.Security.SecureString" version="4.3.0" targetFramework="monoandroid90"
package id="Xamarin.Android.Arch.Core.Common" version="1.1.1.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Arch.Core.Runtime" version="1.1.1.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Arch.Lifecycle.Common" version="1.1.1.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Arch.Lifecycle.LiveData" version="1.1.1.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Arch.Lifecycle.LiveData.Core" version="1.1.1.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Arch.Lifecycle.Runtime" version="1.1.1.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Arch.Lifecycle.ViewModel" version="1.1.1.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Support.Animated.Vector.Drawable" version="28.0.0.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Support.Annotations" version="28.0.0.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Support.AsyncLayoutInflater" version="28.0.0.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Support.Collections" version="28.0.0.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Support.Compat" version="28.0.0.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Support.Constraint.Layout" version="1.1.2" targetFramework="monoandroid81"
package id="Xamarin.Android.Support.Constraint.Layout.Solver" version="1.1.2" targetFramework="monoandroid81"
package id="Xamarin.Android.Support.CoordinaterLayout" version="28.0.0.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Support.Core.UI" version="28.0.0.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Support.Core.Utils" version="28.0.0.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Support.CursorAdapter" version="28.0.0.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Support.CustomTabs" version="28.0.0.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Support.CustomView" version="28.0.0.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Support.Design" version="28.0.0.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Support.DocumentFile" version="28.0.0.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Support.DrawerLayout" version="28.0.0.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Support.Fragment" version="28.0.0.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Support.Interpolator" version="28.0.0.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Support.Loader" version="28.0.0.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Support.LocalBroadcastManager" version="28.0.0.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Support.Media.Compat" version="28.0.0.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Support.Print" version="28.0.0.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Support.SlidingPaneLayout" version="28.0.0.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Support.SwipeRefreshLayout" version="28.0.0.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Support.Transition" version="28.0.0.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Support.v4" version="28.0.0.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Support.v7.AppCompat" version="28.0.0.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Support.v7.CardView" version="28.0.0.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Support.v7.MediaRouter" version="28.0.0.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Support.v7.Palette" version="28.0.0.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Support.v7.RecyclerView" version="28.0.0.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Support.Vector.Drawable" version="28.0.0.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Support.VersionedParcelable" version="28.0.0.3" targetFramework="monoandroid90"
package id="Xamarin.Android.Support.ViewPager" version="28.0.0.3" targetFramework="monoandroid90"
package id="Xamarin.Build.Download" version="0.4.11" targetFramework="monoandroid81"
package id="Xamarin.Essentials" version="1.3.1" targetFramework="monoandroid90"

I have a project that accesses backend web services in production, but recent upgrades to the network/changes to internal security profile have rendered it unuseable. I am trying to quickly implement authentication through Azure AD. when I added the microsoft.identity.client NuGet package, the build now throws the following error:

Severity Code Description Project File Line Suppression State
Error The "LinkAssemblies" task failed unexpectedly.
Java.Interop.Tools.Diagnostics.XamarinAndroidException: error XA2006: Could not resolve reference to 'System.Collections.Generic.Stack1' (defined in assembly 'Microsoft.Identity.Client, Version=4.7.1.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae') with scope 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'. When the scope is different from the defining assembly, it usually means that the type is forwarded. ---> Mono.Cecil.ResolutionException: Failed to resolve System.Collections.Generic.Stack1
at Mono.Linker.Steps.MarkStep.HandleUnresolvedType(TypeReference reference)
at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference)
at MonoDroid.Tuner.MonoDroidMarkStep.MarkType(TypeReference reference)
at Mono.Linker.Steps.MarkStep.MarkField(FieldReference reference)
at Mono.Linker.Steps.MarkStep.InitializeFields(TypeDefinition type)
at Mono.Linker.Steps.MarkStep.InitializeType(TypeDefinition type)
at Mono.Linker.Steps.MarkStep.InitializeAssembly(AssemblyDefinition assembly)
at Mono.Linker.Steps.MarkStep.Initialize()
at MonoDroid.Tuner.MonoDroidMarkStep.Process(LinkContext context)
at Mono.Linker.Pipeline.Process(LinkContext context)
at MonoDroid.Tuner.Linker.Process(LinkerOptions options, ILogger logger, LinkContext& context)
at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
--- End of inner exception stack trace ---
at Java.Interop.Tools.Diagnostics.Diagnostic.Error(Int32 code, Exception innerException, String message, Object[] args)
at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
at Xamarin.Android.Tasks.LinkAssemblies.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() CMIP

I've been scouring the internet for a solution, to no avail. How can I rectify this issue?

Tagged:

Best Answer

Answers

  • zambinnizambinni Member

    Indeed! The problem was solved by migrating the project to VS2019. Thanks.

Sign In or Register to comment.