AzureAD / microsoft-authentication-library-for-dotnet

Microsoft Authentication Library (MSAL) for .NET
https://aka.ms/msal-net
MIT License
1.4k stars 341 forks source link

[Bug] Microsoft.Identity.Client doesn't support IL Trimming #3407

Closed azchohfi closed 2 years ago

azchohfi commented 2 years ago

.NET6 added IL Trimming (https://devblogs.microsoft.com/dotnet/announcing-net-6/#il-trimming) Unfortunately, MSAL.Net doesn't support it.

Which version of MSAL.NET are you using? Microsoft.Identity.Client 4.44.0

Platform .NET 6

What authentication flow has the issue?

Is this a new or existing app? This is a new app or experiment.

Repro

A very simple .NET 6 app:

string[] scopes = new string[] { "user.read" };
var clientId = "...";
var app = PublicClientApplicationBuilder
    .Create(clientId)
    .WithRedirectUri("http://localhost")
    .Build();
var accounts = await app.GetAccountsAsync();
try
{
    result = await app.AcquireTokenSilent(scopes, accounts.FirstOrDefault())
                .ExecuteAsync();
}
catch (MsalUiRequiredException)
{
    result = await app.AcquireTokenInteractive(scopes)
                .ExecuteAsync();
}

With:

    <PublishTrimmed>true</PublishTrimmed>
    <PublishSingleFile>true</PublishSingleFile>

And built with: dotnet publish --self-contained -r win-x64 /p:Configuration=Release /p:TrimmerSingleWarn=false

Will produce dozens of warnings/errors, such as:

ILLink : Trim analysis error IL2070: Microsoft.Identity.Json.Serialization.DefaultContractResolver.<>c.<GetExtensionDataMemberForType>b__43_0(Type): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties', 'DynamicallyAccessedMemberTypes.NonPublicProperties' in call to 'System.Type.GetProperties(BindingFlags)'. The parameter 'baseType' of method 'Microsoft.Identity.Json.Serialization.DefaultContractResolver.<>c.<GetExtensionDataMemberForType>b__43_0(Type)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
ILLink : Trim analysis error IL2070: Microsoft.Identity.Json.Serialization.DefaultContractResolver.<>c.<GetExtensionDataMemberForType>b__43_0(Type): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicFields', 'DynamicallyAccessedMemberTypes.NonPublicFields' in call to 'System.Type.GetFields(BindingFlags)'. The parameter 'baseType' of method 'Microsoft.Identity.Json.Serialization.DefaultContractResolver.<>c.<GetExtensionDataMemberForType>b__43_0(Type)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
ILLink : Trim analysis error IL2070: Microsoft.Identity.Json.Converters.BinaryConverter.EnsureReflectionObject(Type): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicConstructors' in call to 'System.Type.GetConstructor(Type[])'. The parameter 't' of method 'Microsoft.Identity.Json.Converters.BinaryConverter.EnsureReflectionObject(Type)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
ILLink : Trim analysis error IL2026: Microsoft.Identity.Json.Utilities.DynamicUtils.BinderWrapper.CreateMemberCalls(): Using member 'Microsoft.CSharp.RuntimeBinder.Binder.GetMember(CSharpBinderFlags,String,Type,IEnumerable<CSharpArgumentInfo>)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Using dynamic types might cause types or members to be removed by trimmer.
ILLink : Trim analysis error IL2026: Microsoft.Identity.Json.Utilities.DynamicUtils.BinderWrapper.CreateMemberCalls(): Using member 'Microsoft.CSharp.RuntimeBinder.Binder.SetMember(CSharpBinderFlags,String,Type,IEnumerable<CSharpArgumentInfo>)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Using dynamic types might cause types or members to be removed by trimmer.
ILLink : Trim analysis error IL2070: Microsoft.Identity.Json.Utilities.CollectionUtils.ResolveEnumerableCollectionConstructor(Type,Type,Type): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicConstructors' in call to 'System.Type.GetConstructors(BindingFlags)'. The parameter 'collectionType' of method 'Microsoft.Identity.Json.Utilities.CollectionUtils.ResolveEnumerableCollectionConstructor(Type,Type,Type)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
ILLink : Trim analysis error IL2057: Microsoft.Identity.Json.Utilities.ConvertUtils.TryConvertInternal(Object,CultureInfo,Type,Object&): Unrecognized value passed to the parameter 'typeName' of method 'System.Type.GetType(String,Boolean)'. It's not possible to guarantee the availability of the target type.
ILLink : Trim analysis error IL2072: Microsoft.Identity.Json.Utilities.ConvertUtils.TryConvertInternal(Object,CultureInfo,Type,Object&): 'type' argument does not satisfy 'DynamicallyAccessedMemberTypes.All' in call to 'System.ComponentModel.TypeDescriptor.GetConverter(Type)'. The return value of method 'System.Object.GetType()' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
ILLink : Trim analysis error IL2026: Microsoft.Identity.Json.Utilities.ConvertUtils.TryConvertInternal(Object,CultureInfo,Type,Object&): Using member 'System.ComponentModel.TypeDescriptor.GetConverter(Type)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Generic TypeConverters may require the generic types to be annotated. For example, NullableConverter requires the underlying type to be DynamicallyAccessedMembers All.
ILLink : Trim analysis error IL2067: Microsoft.Identity.Json.Utilities.ConvertUtils.TryConvertInternal(Object,CultureInfo,Type,Object&): 'type' argument does not satisfy 'DynamicallyAccessedMemberTypes.All' in call to 'System.ComponentModel.TypeDescriptor.GetConverter(Type)'. The parameter 'targetType' of method 'Microsoft.Identity.Json.Utilities.ConvertUtils.TryConvertInternal(Object,CultureInfo,Type,Object&)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
ILLink : Trim analysis error IL2026: Microsoft.Identity.Json.Utilities.ConvertUtils.TryConvertInternal(Object,CultureInfo,Type,Object&): Using member 'System.ComponentModel.TypeDescriptor.GetConverter(Type)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Generic TypeConverters may require the generic types to be annotated. For example, NullableConverter requires the underlying type to be DynamicallyAccessedMembers All.
ILLink : Trim analysis error IL2067: Microsoft.Identity.Json.Converters.DataSetConverter.ReadJson(JsonReader,Type,Object,JsonSerializer): '#0' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicParameterlessConstructor' in call to 'System.Activator.CreateInstance(Type)'. The parameter 'objectType' of method 'Microsoft.Identity.Json.Converters.DataSetConverter.ReadJson(JsonReader,Type,Object,JsonSerializer)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
ILLink : Trim analysis error IL2072: Microsoft.Identity.Json.Converters.DataTableConverter.CreateRow(JsonReader,DataTable,JsonSerializer): 'dataType' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicFields', 'DynamicallyAccessedMemberTypes.PublicProperties' in call to 'System.Data.DataColumn.DataColumn(String,Type)'. The return value of method 'Microsoft.Identity.Json.Converters.DataTableConverter.GetColumnDataType(JsonReader)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
ILLink : Trim analysis error IL2067: Microsoft.Identity.Json.Converters.DataTableConverter.ReadJson(JsonReader,Type,Object,JsonSerializer): '#0' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicParameterlessConstructor' in call to 'System.Activator.CreateInstance(Type)'. The parameter 'objectType' of method 'Microsoft.Identity.Json.Converters.DataTableConverter.ReadJson(JsonReader,Type,Object,JsonSerializer)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
ILLink : Trim analysis error IL2070: Microsoft.Identity.Json.Serialization.DefaultContractResolver.GetAttributeConstructor(Type): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicConstructors', 'DynamicallyAccessedMemberTypes.NonPublicConstructors' in call to 'System.Type.GetConstructors(BindingFlags)'. The parameter 'objectType' of method 'Microsoft.Identity.Json.Serialization.DefaultContractResolver.GetAttributeConstructor(Type)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
ILLink : Trim analysis error IL2070: Microsoft.Identity.Json.Serialization.DefaultContractResolver.GetAttributeConstructor(Type): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicConstructors' in call to 'System.Type.GetConstructor(Type[])'. The parameter 'objectType' of method 'Microsoft.Identity.Json.Serialization.DefaultContractResolver.GetAttributeConstructor(Type)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
ILLink : Trim analysis error IL2070: Microsoft.Identity.Json.Serialization.DefaultContractResolver.GetImmutableConstructor(Type,JsonPropertyCollection): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicConstructors' in call to 'System.Type.GetConstructors()'. The parameter 'objectType' of method 'Microsoft.Identity.Json.Serialization.DefaultContractResolver.GetImmutableConstructor(Type,JsonPropertyCollection)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
ILLink : Trim analysis error IL2070: Microsoft.Identity.Json.Serialization.DefaultContractResolver.GetParameterizedConstructor(Type): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicConstructors' in call to 'System.Type.GetConstructors(BindingFlags)'. The parameter 'objectType' of method 'Microsoft.Identity.Json.Serialization.DefaultContractResolver.GetParameterizedConstructor(Type)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
ILLink : Trim analysis error IL2065: Microsoft.Identity.Json.Serialization.DefaultContractResolver.SetExtensionDataDelegates(JsonObjectContract,MemberInfo): Value passed to implicit 'this' parameter of method 'System.Type.GetProperty(String,BindingFlags,Binder,Type,Type[],ParameterModifier[])' can not be statically determined and may not meet 'DynamicallyAccessedMembersAttribute' requirements.
ILLink : Trim analysis error IL2026: Microsoft.Identity.Json.Serialization.DefaultSerializationBinder.GetGenericTypeFromTypeName(String,Assembly): Using member 'System.Reflection.Assembly.GetType(String)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed.
ILLink : Trim analysis error IL2055: Microsoft.Identity.Json.Serialization.DefaultSerializationBinder.GetGenericTypeFromTypeName(String,Assembly): Call to 'System.Type.MakeGenericType(Type[])' can not be statically analyzed. It's not possible to guarantee the availability of requirements of the generic type.
ILLink : Trim analysis error IL2026: Microsoft.Identity.Json.Serialization.DefaultSerializationBinder.GetTypeFromTypeNameKey(StructMultiKey<String,String>): Using member 'System.Reflection.Assembly.GetType(String)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed.
ILLink : Trim analysis error IL2057: Microsoft.Identity.Json.Serialization.DefaultSerializationBinder.GetTypeFromTypeNameKey(StructMultiKey<String,String>): Unrecognized value passed to the parameter 'typeName' of method 'System.Type.GetType(String)'. It's not possible to guarantee the availability of the target type.
ILLink : Trim analysis error IL2070: Microsoft.Identity.Json.Utilities.DynamicReflectionDelegateFactory.GenerateCreateDefaultConstructorIL(Type,ILGenerator,Type): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicConstructors', 'DynamicallyAccessedMemberTypes.NonPublicConstructors' in call to 'System.Type.GetConstructor(BindingFlags,Binder,Type[],ParameterModifier[])'. The parameter 'type' of method 'Microsoft.Identity.Json.Utilities.DynamicReflectionDelegateFactory.GenerateCreateDefaultConstructorIL(Type,ILGenerator,Type)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
ILLink : Trim analysis error IL2057: Microsoft.Identity.Json.Converters.EntityKeyMemberConverter.ReadJson(JsonReader,Type,Object,JsonSerializer): Unrecognized value passed to the parameter 'typeName' of method 'System.Type.GetType(String)'. It's not possible to guarantee the availability of the target type.
ILLink : Trim analysis error IL2055: Microsoft.Identity.Json.Utilities.FSharpUtils.BuildMapCreator<TKey,TValue>(): Call to 'System.Type.MakeGenericType(Type[])' can not be statically analyzed. It's not possible to guarantee the availability of requirements of the generic type.
ILLink : Trim analysis error IL2060: Microsoft.Identity.Json.Utilities.FSharpUtils.CreateSeq(Type): Call to 'System.Reflection.MethodInfo.MakeGenericMethod(Type[])' can not be statically analyzed. It's not possible to guarantee the availability of requirements of the generic method.
ILLink : Trim analysis error IL2026: Microsoft.Identity.Json.Utilities.FSharpUtils.EnsureInitialized(Assembly): Using member 'System.Reflection.Assembly.GetType(String)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed.
ILLink : Trim analysis error IL2026: Microsoft.Identity.Json.Utilities.FSharpUtils.EnsureInitialized(Assembly): Using member 'System.Reflection.Assembly.GetType(String)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed.
ILLink : Trim analysis error IL2026: Microsoft.Identity.Json.Utilities.FSharpUtils.EnsureInitialized(Assembly): Using member 'System.Reflection.Assembly.GetType(String)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed.
ILLink : Trim analysis error IL2026: Microsoft.Identity.Json.Utilities.FSharpUtils.EnsureInitialized(Assembly): Using member 'System.Reflection.Assembly.GetType(String)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed.
ILLink : Trim analysis error IL2026: Microsoft.Identity.Json.Utilities.FSharpUtils.EnsureInitialized(Assembly): Using member 'System.Reflection.Assembly.GetType(String)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed.
ILLink : Trim analysis error IL2026: Microsoft.Identity.Json.Utilities.ImmutableCollectionsUtils.TryBuildImmutableForArrayContract(Type,Type,Type&,ObjectConstructor`1&): Using member 'System.Reflection.Assembly.GetType(String)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed.
ILLink : Trim analysis error IL2026: Microsoft.Identity.Json.Utilities.ImmutableCollectionsUtils.TryBuildImmutableForArrayContract(Type,Type,Type&,ObjectConstructor`1&): Using member 'System.Reflection.Assembly.GetType(String)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed.
ILLink : Trim analysis error IL2055: Microsoft.Identity.Json.Utilities.ImmutableCollectionsUtils.TryBuildImmutableForArrayContract(Type,Type,Type&,ObjectConstructor`1&): Call to 'System.Type.MakeGenericType(Type[])' can not be statically analyzed. It's not possible to guarantee the availability of requirements of the generic type.
ILLink : Trim analysis error IL2060: Microsoft.Identity.Json.Utilities.ImmutableCollectionsUtils.TryBuildImmutableForArrayContract(Type,Type,Type&,ObjectConstructor`1&): Call to 'System.Reflection.MethodInfo.MakeGenericMethod(Type[])' can not be statically analyzed. It's not possible to guarantee the availability of requirements of the generic method.
ILLink : Trim analysis error IL2026: Microsoft.Identity.Json.Utilities.ImmutableCollectionsUtils.TryBuildImmutableForDictionaryContract(Type,Type,Type,Type&,ObjectConstructor`1&): Using member 'System.Reflection.Assembly.GetType(String)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed.
ILLink : Trim analysis error IL2026: Microsoft.Identity.Json.Utilities.ImmutableCollectionsUtils.TryBuildImmutableForDictionaryContract(Type,Type,Type,Type&,ObjectConstructor`1&): Using member 'System.Reflection.Assembly.GetType(String)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed.
ILLink : Trim analysis error IL2055: Microsoft.Identity.Json.Utilities.ImmutableCollectionsUtils.TryBuildImmutableForDictionaryContract(Type,Type,Type,Type&,ObjectConstructor`1&): Call to 'System.Type.MakeGenericType(Type[])' can not be statically analyzed. It's not possible to guarantee the availability of requirements of the generic type.
ILLink : Trim analysis error IL2060: Microsoft.Identity.Json.Utilities.ImmutableCollectionsUtils.TryBuildImmutableForDictionaryContract(Type,Type,Type,Type&,ObjectConstructor`1&): Call to 'System.Reflection.MethodInfo.MakeGenericMethod(Type[])' can not be statically analyzed. It's not possible to guarantee the availability of requirements of the generic method.
ILLink : Trim analysis error IL2026: Microsoft.Identity.Json.Linq.JContainer.System.ComponentModel.ITypedList.GetItemProperties(PropertyDescriptor[]): Using member 'System.ComponentModel.ICustomTypeDescriptor.GetProperties()' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. PropertyDescriptor's PropertyType cannot be statically discovered.
ILLink : Trim analysis error IL2046: Microsoft.Identity.Json.Linq.JObject.System.ComponentModel.ICustomTypeDescriptor.GetConverter(): Interface member 'System.ComponentModel.ICustomTypeDescriptor.GetConverter()' with 'RequiresUnreferencedCodeAttribute' has an implementation member 'Microsoft.Identity.Json.Linq.JObject.System.ComponentModel.ICustomTypeDescriptor.GetConverter()' without 'RequiresUnreferencedCodeAttribute'. 'RequiresUnreferencedCodeAttribute' annotations must match across all interface implementations or overrides.
ILLink : Trim analysis error IL2046: Microsoft.Identity.Json.Linq.JObject.System.ComponentModel.ICustomTypeDescriptor.GetDefaultEvent(): Interface member 'System.ComponentModel.ICustomTypeDescriptor.GetDefaultEvent()' with 'RequiresUnreferencedCodeAttribute' has an implementation member 'Microsoft.Identity.Json.Linq.JObject.System.ComponentModel.ICustomTypeDescriptor.GetDefaultEvent()' without 'RequiresUnreferencedCodeAttribute'. 'RequiresUnreferencedCodeAttribute' annotations must match across all interface implementations or overrides.
ILLink : Trim analysis error IL2046: Microsoft.Identity.Json.Linq.JObject.System.ComponentModel.ICustomTypeDescriptor.GetDefaultProperty(): Interface member 'System.ComponentModel.ICustomTypeDescriptor.GetDefaultProperty()' with 'RequiresUnreferencedCodeAttribute' has an implementation member 'Microsoft.Identity.Json.Linq.JObject.System.ComponentModel.ICustomTypeDescriptor.GetDefaultProperty()' without 'RequiresUnreferencedCodeAttribute'. 'RequiresUnreferencedCodeAttribute' annotations must match across all interface implementations or overrides.
ILLink : Trim analysis error IL2046: Microsoft.Identity.Json.Linq.JObject.System.ComponentModel.ICustomTypeDescriptor.GetEditor(Type): Interface member 'System.ComponentModel.ICustomTypeDescriptor.GetEditor(Type)' with 'RequiresUnreferencedCodeAttribute' has an implementation member 'Microsoft.Identity.Json.Linq.JObject.System.ComponentModel.ICustomTypeDescriptor.GetEditor(Type)' without 'RequiresUnreferencedCodeAttribute'. 'RequiresUnreferencedCodeAttribute' annotations must match across all interface implementations or overrides.
ILLink : Trim analysis error IL2046: Microsoft.Identity.Json.Linq.JObject.System.ComponentModel.ICustomTypeDescriptor.GetEvents(Attribute[]): Interface member 'System.ComponentModel.ICustomTypeDescriptor.GetEvents(Attribute[])' with 'RequiresUnreferencedCodeAttribute' has an implementation member 'Microsoft.Identity.Json.Linq.JObject.System.ComponentModel.ICustomTypeDescriptor.GetEvents(Attribute[])' without 'RequiresUnreferencedCodeAttribute'. 'RequiresUnreferencedCodeAttribute' annotations must match across all interface implementations or overrides.
ILLink : Trim analysis error IL2026: Microsoft.Identity.Json.Linq.JObject.System.ComponentModel.ICustomTypeDescriptor.GetProperties(): Using member 'System.ComponentModel.ICustomTypeDescriptor.GetProperties(Attribute[])' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. PropertyDescriptor's PropertyType cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.
ILLink : Trim analysis error IL2046: Microsoft.Identity.Json.Linq.JObject.System.ComponentModel.ICustomTypeDescriptor.GetProperties(Attribute[]): Interface member 'System.ComponentModel.ICustomTypeDescriptor.GetProperties(Attribute[])' with 'RequiresUnreferencedCodeAttribute' has an implementation member 'Microsoft.Identity.Json.Linq.JObject.System.ComponentModel.ICustomTypeDescriptor.GetProperties(Attribute[])' without 'RequiresUnreferencedCodeAttribute'. 'RequiresUnreferencedCodeAttribute' annotations must match across all interface implementations or overrides.
ILLink : Trim analysis error IL2046: Microsoft.Identity.Json.Linq.JObject.System.ComponentModel.ICustomTypeDescriptor.GetProperties(): Interface member 'System.ComponentModel.ICustomTypeDescriptor.GetProperties()' with 'RequiresUnreferencedCodeAttribute' has an implementation member 'Microsoft.Identity.Json.Linq.JObject.System.ComponentModel.ICustomTypeDescriptor.GetProperties()' without 'RequiresUnreferencedCodeAttribute'. 'RequiresUnreferencedCodeAttribute' annotations must match across all interface implementations or overrides.
ILLink : Trim analysis error IL2026: Microsoft.Identity.Json.Serialization.JsonTypeReflector.CanTypeDescriptorConvertString(Type,TypeConverter&): Using member 'System.ComponentModel.TypeDescriptor.GetConverter(Type)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Generic TypeConverters may require the generic types to be annotated. For example, NullableConverter requires the underlying type to be DynamicallyAccessedMembers All.
ILLink : Trim analysis error IL2067: Microsoft.Identity.Json.Serialization.JsonTypeReflector.CanTypeDescriptorConvertString(Type,TypeConverter&): 'type' argument does not satisfy 'DynamicallyAccessedMemberTypes.All' in call to 'System.ComponentModel.TypeDescriptor.GetConverter(Type)'. The parameter 'type' of method 'Microsoft.Identity.Json.Serialization.JsonTypeReflector.CanTypeDescriptorConvertString(Type,TypeConverter&)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
ILLink : Trim analysis error IL2070: Microsoft.Identity.Json.Serialization.JsonTypeReflector.GetAttribute<T>(Type): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.Interfaces' in call to 'System.Type.GetInterfaces()'. The parameter 'type' of method 'Microsoft.Identity.Json.Serialization.JsonTypeReflector.GetAttribute<T>(Type)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
ILLink : Trim analysis error IL2070: Microsoft.Identity.Json.Converters.KeyValuePairConverter.InitializeReflectionObject(Type): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicConstructors' in call to 'System.Type.GetConstructor(Type[])'. The parameter 't' of method 'Microsoft.Identity.Json.Converters.KeyValuePairConverter.InitializeReflectionObject(Type)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
ILLink : Trim analysis error IL2062: Microsoft.Identity.Client.MsalException.FromJsonString(String): Value passed to parameter '#0' of method 'System.Activator.CreateInstance(Type,Object[])' can not be statically determined and may not meet 'DynamicallyAccessedMembersAttribute' requirements.
ILLink : Trim analysis error IL2070: Microsoft.Identity.Json.Utilities.ReflectionObject.Create(Type,MethodBase,String[]): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicConstructors', 'DynamicallyAccessedMemberTypes.PublicMethods', 'DynamicallyAccessedMemberTypes.PublicFields', 'DynamicallyAccessedMemberTypes.PublicNestedTypes', 'DynamicallyAccessedMemberTypes.PublicProperties', 'DynamicallyAccessedMemberTypes.PublicEvents' in call to 'System.Type.GetMember(String,BindingFlags)'. The parameter 't' of method 'Microsoft.Identity.Json.Utilities.ReflectionObject.Create(Type,MethodBase,String[])' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
ILLink : Trim analysis error IL2070: Microsoft.Identity.Json.Utilities.ReflectionUtils.GetChildPrivateFields(IList<MemberInfo>,Type,BindingFlags): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicFields', 'DynamicallyAccessedMemberTypes.NonPublicFields' in call to 'System.Type.GetFields(BindingFlags)'. The parameter 'targetType' of method 'Microsoft.Identity.Json.Utilities.ReflectionUtils.GetChildPrivateFields(IList<MemberInfo>,Type,BindingFlags)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
ILLink : Trim analysis error IL2070: Microsoft.Identity.Json.Utilities.ReflectionUtils.GetChildPrivateProperties(IList<PropertyInfo>,Type,BindingFlags): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties', 'DynamicallyAccessedMemberTypes.NonPublicProperties' in call to 'System.Type.GetProperties(BindingFlags)'. The parameter 'targetType' of method 'Microsoft.Identity.Json.Utilities.ReflectionUtils.GetChildPrivateProperties(IList<PropertyInfo>,Type,BindingFlags)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
ILLink : Trim analysis error IL2070: Microsoft.Identity.Json.Utilities.ReflectionUtils.GetDefaultConstructor(Type,Boolean): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicConstructors' in call to 'System.Type.GetConstructors(BindingFlags)'. The parameter 't' of method 'Microsoft.Identity.Json.Utilities.ReflectionUtils.GetDefaultConstructor(Type,Boolean)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
ILLink : Trim analysis error IL2067: Microsoft.Identity.Json.Utilities.ReflectionUtils.GetDefaultValue(Type): '#0' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicParameterlessConstructor' in call to 'System.Activator.CreateInstance(Type)'. The parameter 'type' of method 'Microsoft.Identity.Json.Utilities.ReflectionUtils.GetDefaultValue(Type)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
ILLink : Trim analysis error IL2070: Microsoft.Identity.Json.Utilities.ReflectionUtils.GetFields(Type,BindingFlags): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicFields', 'DynamicallyAccessedMemberTypes.NonPublicFields' in call to 'System.Type.GetFields(BindingFlags)'. The parameter 'targetType' of method 'Microsoft.Identity.Json.Utilities.ReflectionUtils.GetFields(Type,BindingFlags)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
ILLink : Trim analysis error IL2070: Microsoft.Identity.Json.Utilities.ReflectionUtils.GetMemberInfoFromType(Type,MemberInfo): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties', 'DynamicallyAccessedMemberTypes.NonPublicProperties' in call to 'System.Type.GetProperty(String,BindingFlags,Binder,Type,Type[],ParameterModifier[])'. The parameter 'targetType' of method 'Microsoft.Identity.Json.Utilities.ReflectionUtils.GetMemberInfoFromType(Type,MemberInfo)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
ILLink : Trim analysis error IL2070: Microsoft.Identity.Json.Utilities.ReflectionUtils.GetMemberInfoFromType(Type,MemberInfo): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicConstructors', 'DynamicallyAccessedMemberTypes.NonPublicConstructors', 'DynamicallyAccessedMemberTypes.PublicMethods', 'DynamicallyAccessedMemberTypes.NonPublicMethods', 'DynamicallyAccessedMemberTypes.PublicFields', 'DynamicallyAccessedMemberTypes.NonPublicFields', 'DynamicallyAccessedMemberTypes.PublicNestedTypes', 'DynamicallyAccessedMemberTypes.NonPublicNestedTypes', 'DynamicallyAccessedMemberTypes.PublicProperties', 'DynamicallyAccessedMemberTypes.NonPublicProperties', 'DynamicallyAccessedMemberTypes.PublicEvents', 'DynamicallyAccessedMemberTypes.NonPublicEvents' in call to 'System.Type.GetMember(String,MemberTypes,BindingFlags)'. The parameter 'targetType' of method 'Microsoft.Identity.Json.Utilities.ReflectionUtils.GetMemberInfoFromType(Type,MemberInfo)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
ILLink : Trim analysis error IL2070: Microsoft.Identity.Json.Utilities.ReflectionUtils.GetProperties(Type,BindingFlags): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties', 'DynamicallyAccessedMemberTypes.NonPublicProperties' in call to 'System.Type.GetProperties(BindingFlags)'. The parameter 'targetType' of method 'Microsoft.Identity.Json.Utilities.ReflectionUtils.GetProperties(Type,BindingFlags)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
ILLink : Trim analysis error IL2070: Microsoft.Identity.Json.Utilities.ReflectionUtils.GetProperties(Type,BindingFlags): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.Interfaces' in call to 'System.Type.GetInterfaces()'. The parameter 'targetType' of method 'Microsoft.Identity.Json.Utilities.ReflectionUtils.GetProperties(Type,BindingFlags)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
ILLink : Trim analysis error IL2065: Microsoft.Identity.Json.Utilities.ReflectionUtils.GetProperties(Type,BindingFlags): Value passed to implicit 'this' parameter of method 'System.Type.GetProperties(BindingFlags)' can not be statically determined and may not meet 'DynamicallyAccessedMembersAttribute' requirements.
ILLink : Trim analysis error IL2070: Microsoft.Identity.Json.Utilities.ReflectionUtils.ImplementsGenericDefinition(Type,Type,Type&): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.Interfaces' in call to 'System.Type.GetInterfaces()'. The parameter 'type' of method 'Microsoft.Identity.Json.Utilities.ReflectionUtils.ImplementsGenericDefinition(Type,Type,Type&)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
ILLink : Trim analysis error IL2070: Microsoft.Identity.Json.Utilities.ReflectionUtils.IsMethodOverridden(Type,Type,String): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicMethods', 'DynamicallyAccessedMemberTypes.NonPublicMethods' in call to 'System.Type.GetMethods(BindingFlags)'. The parameter 'currentType' of method 'Microsoft.Identity.Json.Utilities.ReflectionUtils.IsMethodOverridden(Type,Type,String)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
ILLink : Trim analysis error IL2070: Microsoft.Identity.Json.Utilities.TypeExtensions.AssignableToTypeName(Type,String,Boolean,Type&): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.Interfaces' in call to 'System.Type.GetInterfaces()'. The parameter 'type' of method 'Microsoft.Identity.Json.Utilities.TypeExtensions.AssignableToTypeName(Type,String,Boolean,Type&)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
ILLink : Trim analysis error IL2070: Microsoft.Identity.Json.Utilities.TypeExtensions.ImplementInterface(Type,Type): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.Interfaces' in call to 'System.Type.GetInterfaces()'. The parameter 'type' of method 'Microsoft.Identity.Json.Utilities.TypeExtensions.ImplementInterface(Type,Type)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
ILLink : Trim analysis error IL2026: System.Data.DataSet.System.Xml.Serialization.IXmlSerializable.GetSchema(): Using member 'System.Data.DataSet.WriteXmlSchema(DataSet,XmlWriter)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. DataSet.GetSchema uses TypeDescriptor and XmlSerialization underneath which are not trimming safe. Members from serialized types may be trimmed if not referenced directly.
ILLink : Trim analysis error IL2026: System.Data.DataSet.System.Xml.Serialization.IXmlSerializable.ReadXml(XmlReader): Using member 'System.Data.DataSet.ReadXmlSerializableInternal(XmlReader)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. DataSet.ReadXml uses XmlSerialization underneath which is not trimming safe. Members from serialized types may be trimmed if not referenced directly.
ILLink : Trim analysis error IL2026: System.Data.DataSet.System.Xml.Serialization.IXmlSerializable.WriteXml(XmlWriter): Using member 'System.Data.DataSet.WriteXmlInternal(XmlWriter)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. DataSet.WriteXml uses XmlSerialization underneath which is not trimming safe. Members from serialized types may be trimmed if not referenced directly.
ILLink : Trim analysis error IL2026: System.Data.DataTable.System.Xml.Serialization.IXmlSerializable.GetSchema(): Using member 'System.Data.DataTable.GetXmlSchema()' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. DataTable.GetSchema uses TypeDescriptor and XmlSerialization underneath which are not trimming safe. Members from serialized types may be trimmed if not referenced directly.
ILLink : Trim analysis error IL2026: System.Data.DataTable.System.Xml.Serialization.IXmlSerializable.ReadXml(XmlReader): Using member 'System.Data.DataTable.ReadXmlSerializableInternal(XmlReader)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. DataTable.ReadXml uses XmlSerialization underneath which is not trimming safe. Members from serialized types may be trimmed if not referenced directly.
ILLink : Trim analysis error IL2026: System.Data.DataTable.System.Xml.Serialization.IXmlSerializable.WriteXml(XmlWriter): Using member 'System.Data.DataTable.WriteXmlInternal(XmlWriter)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. DataTable.WriteXml uses XmlSerialization underneath which is not trimming safe. Members from serialized types may be trimmed if not referenced directly.
  Optimizing assemblies for size, which may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
C:\Program Files\dotnet\sdk\6.0.400-preview.22301.10\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ILLink.targets(109,5): error NETSDK1144: Optimizing assemblies for size failed. Optimization can be disabled by setting the PublishTrimmed property to false.

Expected behavior No build errors or warnings when building a self-contained exe.

Actual behavior Multiple errors, and very hard to workaround/fix manually.

Possible solution Most errors seems related to JSON deserialization, and .NET6 now supports source generation for this, so it should be possible to support this.

bgavrilMS commented 2 years ago

Excellent bug. Just so happens that we are also exploring this area, as we want to make MSAL compile with NET7's AOT compiler. Here's are the notes that @pmaytak wrote on the subject.

Problem statement:

Possible solutions:

  1. Update current Newtonsoft JSON.NET implementation via flags to disable reflection as was done for Unity. a.
  1. Add System.Text.Json package for supported targets, while keeping JSON.NET for older targets ? a. First need to research System.Text.Json feature and framework availability. i. Source generation is only for .NET 5+. How to choose reflection or source generation in System.Text.Json | Microsoft Docs/ ii. Differences with JSON.NET need to be verified. Migrate from Newtonsoft.Json to System.Text.Json - .NET | Microsoft Docs b. Need to look over what existing features we use from JSON.NET. i. There are 71 references to JSON.NET namespace in MSAL and tests projects. c. Ideally individual usages should be consolidated in JSON helper class and used from there. d. Add pre-processor flags to load the relevant implementations based on the target framework. e. Existing tests should be enough, but coverage should still be verified. f. ETA is at least 3+ days. Research of current used functionality is the most important part. Code changes should be easy once migration steps are defined.

  2. Replace Newtonsoft.Json with System.Text.Json source code from https://github.com/dotnet/runtime/tree/main/src/libraries/System.Text.Json. a. The current System.Text.Json minimal requirements might not be a functional limitation and the code might simply work in 4.5.2 since it works in net 4.6.1 b. Same as above, except JSON.NET code will be removed.

  3. Use System.Text.Json generator code a. We could pull the reflection less code generator into the repo and run it outside of minimal generation

  4. Write your own code generation based on contract classes: a. Move json manipulation into data contract classes or multi b. Create a build task that would generate json string serializers using JsonDocument writers etc.

One of the challenges in estimating time are the unknowns that need to be researched - what exactly needs to be excluded in JSON.NET and making sure System.Text.Json supports everything that we use from JSON.NET.

Unity related work: [Feature Request] [L] Stop using reflection to deserialize JSON · Issue #2343 Update JSON.NET code to work with Unity. by pmaytak · Pull Request #2428 Remove the HAVE_CAS define so that Newtonsoft.Json never uses dynamic code generation as its not supported in Unity. by najadojo · Pull Request #2588

System.Text.Json framework support: .NET API Catalog (apisof.net)

azchohfi commented 2 years ago

Hey @Sergio0694, do you happen to be aware of any common pitfalls for the approaches above? cc/ @michael-hawker

Sergio0694 commented 2 years ago

Just want to clarify this:

"Reflection-based code does not work well with Ahead-Of-Time (AOT) compliers."

This is not correct. There's nothing inherently problematic with AOT and reflection. The issue is not using AOT, the issue is the package not using proper trimming annotations to inform the linker when performing trimming. You could publish a non-trimmed fully AOT binary with no code changes, and there would be no problems whatsoever.

Just to give an example, we use reflection in several places in the Microsoft Store, and we also use Newtonsoft.Json. That's not an issue with AOT at all (the Store is compiled with .NET Native, so it's 100% AOT, and also trimmed). It's just a matter of preserving the right metadata to make reflection work. In our case, we had to manually add runtime directives where needed. In this case, since you're on .NET 6+, you have trimming annotations at your disposal, so you can leverage them to inform the linker.

Essentially, removing reflection is of course nice as it helps performance and binary size, but it is not required.

A first, low-risk approach should be to just enable trimming for the assembly and add the necessary annotations to eliminate trimming warnings. This should be done regardless of any other changes you might want in the future, as it's just a baseline you should start from. Then, definitely, moving to System.Text.Json and source generators would be nice to have 🙂

michael-hawker commented 2 years ago

@bgavrilMS what's the minimum target framework you're looking to support?

According to the support policy here:

Support for .NET Framework 4.5.2, 4.6, and 4.6.1 ended on April 26, 2022. Customers and developers must have completed the in-place update to .NET Framework 4.6.2 or later by April 26, 2022 to continue receiving technical support and security updates.

As it'd be nice to just switch over to System.Text.Json as its continually getting performance improvements.

pmaytak commented 2 years ago

@Sergio0694 you're right. I think initially that was written to mean as you have to pay attention to reflection-based code when using AOT.

@michael-hawker net45 is one of the targets that we still support but not supported by System.Text.Json. And also perhaps some of the older Xamarin targets might not be supported. But we're thinking deprecating support for those, so we should be fine to use System.Text.Json. One thing that's not clear to me yet, is if the source generation is only supported in net6+, or in earlier frameworks via the package also (if so, it would suit us well).

michael-hawker commented 2 years ago

@pmaytak source generators in general w/ .NET need to be built with .NET 6+, but the outputted code doesn't have to be limited to run on .NET 6. We use them in the Toolkit to interop with .NET Standard 2.0 and UWP for instance.

According to the intro dev blog here, the System.Text.Json generators should behave similarly:

The source generator is compatible with other target framework monikers (TFMs) aside from .NET 6.0, that is .NET 5.0 and lower, .NET Framework, and .NET Standard. The API shape of the generated source code is consistent across the TFMs, but the implementation may vary based on the framework APIs that are available on each TFM.

bgavrilMS commented 2 years ago

About dependencies

MSAL tfm System.Text.Json
NET 4.6.2 4.*
NetStandard 4.*
NET 5 5.*
NET 6 6.*

About Json operations

Apart from the regular serialize / deserialize operations, MSAL uses a more advanced serialization technique when it comes to the token cache. MSAL will preserve unknown JSON nodes (think distributed system, where node A uses MSAL 4.1 and node B uses MSAL 4.2).

As such, it might be easier to make changes to existing newtonsoft serializer.

Related issue: https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/issues/3413

tipa commented 2 years ago

Please also consider that the Newtonsoft.JSON dependency is extremely large. Multiple megabytes, especially when AOT is enabled (which is a must in iOS apps). Using System.Text.Json would significantly reduce the app size, which does matter especially for mobile apps. The MS Graph library (which I assume is commonly used in combination with MSAL) already did the switch to System.Text.Json

Would it be possible to re-open this feature request?

bgavrilMS commented 2 years ago

CC @pmaytak

azchohfi commented 2 years ago

Working on using System.Text.Json. Got most of the tests passing again. Sending PR soon.

bgavrilMS commented 2 years ago

@michael-hawker - can you please elaborate on this? MSAL is built against .NET 4.6.x, .NET Core App 2.1 and .NETStandard 2.0. The build scripts today I believe use .NET SDK 3.1

To ensure code generators work, what do we need to do? Ensure that the build machines use .NET 6 SDK ? Or add NET 6 target framework to MSAL explicitly?

michael-hawker commented 2 years ago

@bgavrilMS all you should need is for the build environment to install the .NET 6 SDK (for instance with GitHub Actions it'd be):

      - name: Install .NET 6 SDK
        uses: actions/setup-dotnet@v1
        with:
          dotnet-version: '6.0.301'

Though if you're still building for an older target netcore app, you may need to install both SDKs? But you don't have to change the multi-targeting unless you want to make specific optimizations for newer platforms (like .NET 6 wouldn't need the System.Text.Json NuGet package as it's included w/ .NET itself now).

Net Core App 2.1 is out of support now, so it looks like Alex updated to 3.1 in his PR here as well

mjcheetham commented 2 years ago

One of the blockers for us (Git Credential Manager) from dropping .NET Framework on Windows (and going .NET6/7 etc) would be the ability to publish our app trimmed. Since MSAL is a hard dependency for us, this work would be really helpful for us! Would love to publish AOT compiled too in .NET 7 if MSAL can work.

charlesroddie commented 10 months ago

I believe this is still not solved. We publish an ios app with NativeAOT and get these warnings:

2024-01-15T21:50:38.8130720Z ILC : Trim analysis warning IL2026: Microsoft.Identity.Json.Serialization.DefaultSerializationBinder.GetTypeFromTypeNameKey(StructMultiKey`2<String,String>): Using member 'System.Reflection.Assembly.GetType(String)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed. 
2024-01-15T21:50:38.8132400Z ILC : Trim analysis warning IL2057: Microsoft.Identity.Json.Serialization.DefaultSerializationBinder.GetTypeFromTypeNameKey(StructMultiKey`2<String,String>): Unrecognized value passed to the parameter 'typeName' of method 'System.Type.GetType(String)'. It's not possible to guarantee the availability of the target type. 
2024-01-15T21:50:39.5941890Z ILC : Trim analysis warning IL2026: Microsoft.Identity.Json.Serialization.DefaultSerializationBinder.GetGenericTypeFromTypeName(String,Assembly): Using member 'System.Reflection.Assembly.GetType(String)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed. 
2024-01-15T21:50:39.5943380Z ILC : Trim analysis warning IL2055: Microsoft.Identity.Json.Serialization.DefaultSerializationBinder.GetGenericTypeFromTypeName(String,Assembly): Call to 'System.Type.MakeGenericType(Type[])' can not be statically analyzed. It's not possible to guarantee the availability of requirements of the generic type. 
2024-01-15T21:50:39.5944840Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Serialization.DefaultSerializationBinder.GetGenericTypeFromTypeName(String,Assembly): Using member 'System.Type.MakeGenericType(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime. 
2024-01-15T21:50:42.9465030Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader,Type,JsonContract,JsonProperty,Object,String): Using member 'System.Array.CreateInstance(Type,Int32)' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The code for an array of the specified type might not be available. 
2024-01-15T21:50:42.9632670Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Utilities.DynamicProxyMetaObject`1.GetArgArray(DynamicMetaObject[],DynamicMetaObject): Using member 'System.Linq.Expressions.Expression.NewArrayInit(Type,IEnumerable`1<Expression>)' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. Creating arrays at runtime requires dynamic code generation. 
2024-01-15T21:50:42.9658270Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Utilities.DynamicProxyMetaObject`1.GetArgArray(DynamicMetaObject[]): Using member 'System.Linq.Expressions.Expression.NewArrayInit(Type,IEnumerable`1<Expression>)' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. Creating arrays at runtime requires dynamic code generation. 
2024-01-15T21:50:42.9791650Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Serialization.DefaultContractResolver.CreateArrayContract(Type): Using member 'System.Type.MakeGenericType(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime. 
2024-01-15T21:50:42.9795370Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Serialization.DefaultContractResolver.CreateDictionaryContract(Type): Using member 'System.Type.MakeGenericType(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime. 
2024-01-15T21:50:42.9796660Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Serialization.DefaultContractResolver.CreateDictionaryContract(Type): Using member 'System.Type.MakeGenericType(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime. 
2024-01-15T21:50:42.9802660Z ILC : Trim analysis warning IL2080: Microsoft.Identity.Json.Serialization.DefaultContractResolver.CreateISerializableContract(Type): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicConstructors', 'DynamicallyAccessedMemberTypes.NonPublicConstructors' in call to 'System.Type.GetConstructor(BindingFlags,Binder,Type[],ParameterModifier[])'. The field 'Microsoft.Identity.Json.Serialization.JsonContract.NonNullableUnderlyingType' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:43.4570580Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Serialization.JsonDictionaryContract.CreateWrapper(Object): Using member 'System.Type.MakeGenericType(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime. 
2024-01-15T21:50:43.4572350Z ILC : Trim analysis warning IL2080: Microsoft.Identity.Json.Serialization.JsonDictionaryContract.CreateWrapper(Object): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicConstructors' in call to 'System.Type.GetConstructor(Type[])'. The field 'Microsoft.Identity.Json.Serialization.JsonDictionaryContract._genericWrapperType' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:43.5067820Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Serialization.JsonDictionaryContract.JsonDictionaryContract(Type): Using member 'System.Type.MakeGenericType(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime. 
2024-01-15T21:50:43.5069680Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Serialization.JsonDictionaryContract.JsonDictionaryContract(Type): Using member 'System.Type.MakeGenericType(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime. 
2024-01-15T21:50:43.5071240Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Serialization.JsonDictionaryContract.JsonDictionaryContract(Type): Using member 'System.Type.MakeGenericType(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime. 
2024-01-15T21:50:43.5072540Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Serialization.JsonDictionaryContract.JsonDictionaryContract(Type): Using member 'System.Type.MakeGenericType(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime. 
2024-01-15T21:50:43.5106240Z ILC : Trim analysis warning IL2070: Microsoft.Identity.Json.Serialization.DefaultContractResolver.GetAttributeConstructor(Type): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicConstructors', 'DynamicallyAccessedMemberTypes.NonPublicConstructors' in call to 'System.Type.GetConstructors(BindingFlags)'. The parameter '#0' of method 'Microsoft.Identity.Json.Serialization.DefaultContractResolver.GetAttributeConstructor(Type)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:43.5111370Z ILC : Trim analysis warning IL2070: Microsoft.Identity.Json.Serialization.DefaultContractResolver.GetAttributeConstructor(Type): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicConstructors' in call to 'System.Type.GetConstructor(Type[])'. The parameter '#0' of method 'Microsoft.Identity.Json.Serialization.DefaultContractResolver.GetAttributeConstructor(Type)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:43.5114740Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Serialization.JsonArrayContract.JsonArrayContract(Type): Using member 'System.Type.MakeGenericType(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime. 
2024-01-15T21:50:43.5116100Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Serialization.JsonArrayContract.JsonArrayContract(Type): Using member 'System.Type.MakeGenericType(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime. 
2024-01-15T21:50:43.5117760Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Serialization.JsonArrayContract.JsonArrayContract(Type): Using member 'System.Type.MakeGenericType(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime. 
2024-01-15T21:50:43.5119140Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Serialization.JsonArrayContract.JsonArrayContract(Type): Using member 'System.Type.MakeGenericType(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime. 
2024-01-15T21:50:43.5120930Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Serialization.JsonArrayContract.JsonArrayContract(Type): Using member 'System.Type.MakeGenericType(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime. 
2024-01-15T21:50:43.5122570Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Serialization.JsonArrayContract.JsonArrayContract(Type): Using member 'System.Type.MakeGenericType(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime. 
2024-01-15T21:50:43.5123910Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Serialization.JsonArrayContract.JsonArrayContract(Type): Using member 'System.Type.MakeGenericType(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime. 
2024-01-15T21:50:43.5140010Z ILC : Trim analysis warning IL2070: Microsoft.Identity.Json.Serialization.DefaultContractResolver.GetImmutableConstructor(Type,JsonPropertyCollection): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicConstructors' in call to 'System.Type.GetConstructors()'. The parameter '#0' of method 'Microsoft.Identity.Json.Serialization.DefaultContractResolver.GetImmutableConstructor(Type,JsonPropertyCollection)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:43.5142480Z ILC : Trim analysis warning IL2070: Microsoft.Identity.Json.Serialization.DefaultContractResolver.GetParameterizedConstructor(Type): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicConstructors' in call to 'System.Type.GetConstructors(BindingFlags)'. The parameter '#0' of method 'Microsoft.Identity.Json.Serialization.DefaultContractResolver.GetParameterizedConstructor(Type)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:43.5174660Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Serialization.DefaultContractResolver.SetExtensionDataDelegates(JsonObjectContract,MemberInfo): Using member 'System.Type.MakeGenericType(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime. 
2024-01-15T21:50:43.5176730Z ILC : Trim analysis warning IL2075: Microsoft.Identity.Json.Serialization.DefaultContractResolver.SetExtensionDataDelegates(JsonObjectContract,MemberInfo): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties' in call to 'System.Type.GetProperty(String,BindingFlags,Binder,Type,Type[],ParameterModifier[])'. The return value of method 'Microsoft.Identity.Json.Utilities.ReflectionUtils.GetMemberUnderlyingType(MemberInfo)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:43.5178910Z ILC : Trim analysis warning IL2070: Microsoft.Identity.Json.Serialization.DefaultContractResolver.SetExtensionDataDelegates(JsonObjectContract,MemberInfo): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties' in call to 'System.Type.GetProperty(String,BindingFlags,Binder,Type,Type[],ParameterModifier[])'. The parameter '' of method 'Microsoft.Identity.Json.Utilities.ReflectionUtils.ImplementsGenericDefinition(Type,Type,Type&)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:43.5181320Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Serialization.DefaultContractResolver.SetExtensionDataDelegates(JsonObjectContract,MemberInfo): Using member 'System.Type.MakeGenericType(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime. 
2024-01-15T21:50:43.5583010Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Utilities.ConvertUtils.GetTypeCode(Type,Boolean&): Using member 'System.Type.MakeGenericType(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime. 
2024-01-15T21:50:43.5616440Z ILC : Trim analysis warning IL2070: Microsoft.Identity.Json.Utilities.ReflectionUtils.IsMethodOverridden(Type,Type,String): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicMethods', 'DynamicallyAccessedMemberTypes.NonPublicMethods' in call to 'System.Type.GetMethods(BindingFlags)'. The parameter '#0' of method 'Microsoft.Identity.Json.Utilities.ReflectionUtils.IsMethodOverridden(Type,Type,String)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:43.5738380Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Utilities.CollectionUtils.ToMultidimensionalArray(IList,Type,Int32): Using member 'System.Array.CreateInstance(Type,Int32[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The code for an array of the specified type might not be available. 
2024-01-15T21:50:43.5775890Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Serialization.JsonArrayContract.CreateWrapper(Object): Using member 'System.Type.MakeGenericType(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime. 
2024-01-15T21:50:43.5777870Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Serialization.JsonArrayContract.CreateWrapper(Object): Using member 'System.Type.MakeGenericType(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime. 
2024-01-15T21:50:43.5779960Z ILC : Trim analysis warning IL2080: Microsoft.Identity.Json.Serialization.JsonArrayContract.CreateWrapper(Object): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicConstructors' in call to 'System.Type.GetConstructor(Type[])'. The field 'Microsoft.Identity.Json.Serialization.JsonArrayContract._genericWrapperType' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:46.2860440Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Serialization.JsonArrayContract.CreateTemporaryCollection(): Using member 'System.Type.MakeGenericType(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime. 
2024-01-15T21:50:46.2933350Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Serialization.JsonDictionaryContract.CreateTemporaryDictionary(): Using member 'System.Type.MakeGenericType(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime. 
2024-01-15T21:50:46.3181800Z ILC : Trim analysis warning IL2070: Microsoft.Identity.Json.Converters.KeyValuePairConverter.InitializeReflectionObject(Type): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicConstructors' in call to 'System.Type.GetConstructor(Type[])'. The parameter 't' of method 'Microsoft.Identity.Json.Converters.KeyValuePairConverter.InitializeReflectionObject(Type)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:46.3344220Z ILC : Trim analysis warning IL2070: Microsoft.Identity.Json.Utilities.ReflectionUtils.ImplementsGenericDefinition(Type,Type,Type&): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.Interfaces' in call to 'System.Type.GetInterfaces()'. The parameter '#0' of method 'Microsoft.Identity.Json.Utilities.ReflectionUtils.ImplementsGenericDefinition(Type,Type,Type&)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:46.3350760Z ILC : Trim analysis warning IL2070: Microsoft.Identity.Json.Serialization.DefaultContractResolver.<>c.<GetExtensionDataMemberForType>b__44_0(Type): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties', 'DynamicallyAccessedMemberTypes.NonPublicProperties' in call to 'System.Type.GetProperties(BindingFlags)'. The parameter 'baseType' of method 'Microsoft.Identity.Json.Serialization.DefaultContractResolver.<>c.<GetExtensionDataMemberForType>b__44_0(Type)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:46.3353080Z ILC : Trim analysis warning IL2070: Microsoft.Identity.Json.Serialization.DefaultContractResolver.<>c.<GetExtensionDataMemberForType>b__44_0(Type): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicFields', 'DynamicallyAccessedMemberTypes.NonPublicFields' in call to 'System.Type.GetFields(BindingFlags)'. The parameter 'baseType' of method 'Microsoft.Identity.Json.Serialization.DefaultContractResolver.<>c.<GetExtensionDataMemberForType>b__44_0(Type)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:46.3658290Z ILC : Trim analysis warning IL2026: Microsoft.Identity.Json.Utilities.ImmutableCollectionsUtils.TryBuildImmutableForArrayContract(Type,Type,Type&,ObjectConstructor`1<Object>&): Using member 'System.Reflection.Assembly.GetType(String)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed. 
2024-01-15T21:50:46.3661510Z ILC : Trim analysis warning IL2026: Microsoft.Identity.Json.Utilities.ImmutableCollectionsUtils.TryBuildImmutableForArrayContract(Type,Type,Type&,ObjectConstructor`1<Object>&): Using member 'System.Reflection.Assembly.GetType(String)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed. 
2024-01-15T21:50:46.3663660Z ILC : Trim analysis warning IL2075: Microsoft.Identity.Json.Utilities.ImmutableCollectionsUtils.TryBuildImmutableForArrayContract(Type,Type,Type&,ObjectConstructor`1<Object>&): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicMethods' in call to 'System.Type.GetMethods()'. The return value of method 'System.Reflection.Assembly.GetType(String)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:46.3669390Z ILC : Trim analysis warning IL2055: Microsoft.Identity.Json.Utilities.ImmutableCollectionsUtils.TryBuildImmutableForArrayContract(Type,Type,Type&,ObjectConstructor`1<Object>&): Call to 'System.Type.MakeGenericType(Type[])' can not be statically analyzed. It's not possible to guarantee the availability of requirements of the generic type. 
2024-01-15T21:50:46.3672370Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Utilities.ImmutableCollectionsUtils.TryBuildImmutableForArrayContract(Type,Type,Type&,ObjectConstructor`1<Object>&): Using member 'System.Type.MakeGenericType(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime. 
2024-01-15T21:50:46.3673800Z ILC : Trim analysis warning IL2060: Microsoft.Identity.Json.Utilities.ImmutableCollectionsUtils.TryBuildImmutableForArrayContract(Type,Type,Type&,ObjectConstructor`1<Object>&): Call to 'System.Reflection.MethodInfo.MakeGenericMethod(Type[])' can not be statically analyzed. It's not possible to guarantee the availability of requirements of the generic method. 
2024-01-15T21:50:46.3675400Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Utilities.ImmutableCollectionsUtils.TryBuildImmutableForArrayContract(Type,Type,Type&,ObjectConstructor`1<Object>&): Using member 'System.Reflection.MethodInfo.MakeGenericMethod(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime. 
2024-01-15T21:50:46.3676800Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Utilities.CollectionUtils.ResolveEnumerableCollectionConstructor(Type,Type): Using member 'System.Type.MakeGenericType(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime. 
2024-01-15T21:50:46.3678070Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Utilities.CollectionUtils.ResolveEnumerableCollectionConstructor(Type,Type,Type): Using member 'System.Type.MakeGenericType(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime. 
2024-01-15T21:50:46.3679740Z ILC : Trim analysis warning IL2070: Microsoft.Identity.Json.Utilities.CollectionUtils.ResolveEnumerableCollectionConstructor(Type,Type,Type): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicConstructors' in call to 'System.Type.GetConstructors(BindingFlags)'. The parameter '#0' of method 'Microsoft.Identity.Json.Utilities.CollectionUtils.ResolveEnumerableCollectionConstructor(Type,Type,Type)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:46.3681340Z ILC : Trim analysis warning IL2026: Microsoft.Identity.Json.Utilities.ImmutableCollectionsUtils.TryBuildImmutableForDictionaryContract(Type,Type,Type,Type&,ObjectConstructor`1<Object>&): Using member 'System.Reflection.Assembly.GetType(String)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed. 
2024-01-15T21:50:46.3683010Z ILC : Trim analysis warning IL2026: Microsoft.Identity.Json.Utilities.ImmutableCollectionsUtils.TryBuildImmutableForDictionaryContract(Type,Type,Type,Type&,ObjectConstructor`1<Object>&): Using member 'System.Reflection.Assembly.GetType(String)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed. 
2024-01-15T21:50:46.3684830Z ILC : Trim analysis warning IL2075: Microsoft.Identity.Json.Utilities.ImmutableCollectionsUtils.TryBuildImmutableForDictionaryContract(Type,Type,Type,Type&,ObjectConstructor`1<Object>&): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicMethods' in call to 'System.Type.GetMethods()'. The return value of method 'System.Reflection.Assembly.GetType(String)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:46.3686480Z ILC : Trim analysis warning IL2055: Microsoft.Identity.Json.Utilities.ImmutableCollectionsUtils.TryBuildImmutableForDictionaryContract(Type,Type,Type,Type&,ObjectConstructor`1<Object>&): Call to 'System.Type.MakeGenericType(Type[])' can not be statically analyzed. It's not possible to guarantee the availability of requirements of the generic type. 
2024-01-15T21:50:46.3687850Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Utilities.ImmutableCollectionsUtils.TryBuildImmutableForDictionaryContract(Type,Type,Type,Type&,ObjectConstructor`1<Object>&): Using member 'System.Type.MakeGenericType(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime. 
2024-01-15T21:50:46.3689330Z ILC : Trim analysis warning IL2060: Microsoft.Identity.Json.Utilities.ImmutableCollectionsUtils.TryBuildImmutableForDictionaryContract(Type,Type,Type,Type&,ObjectConstructor`1<Object>&): Call to 'System.Reflection.MethodInfo.MakeGenericMethod(Type[])' can not be statically analyzed. It's not possible to guarantee the availability of requirements of the generic method. 
2024-01-15T21:50:46.3690760Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Utilities.ImmutableCollectionsUtils.TryBuildImmutableForDictionaryContract(Type,Type,Type,Type&,ObjectConstructor`1<Object>&): Using member 'System.Reflection.MethodInfo.MakeGenericMethod(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime. 
2024-01-15T21:50:46.3717790Z ILC : Trim analysis warning IL2070: Microsoft.Identity.Json.Serialization.JsonTypeReflector.GetAttribute<T>(Type): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.Interfaces' in call to 'System.Type.GetInterfaces()'. The parameter '#0' of method 'Microsoft.Identity.Json.Serialization.JsonTypeReflector.GetAttribute<T>(Type)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:46.3723330Z ILC : Trim analysis warning IL2075: Microsoft.Identity.Json.Serialization.JsonTypeReflector.GetAttribute<T>(MemberInfo): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.Interfaces' in call to 'System.Type.GetInterfaces()'. The return value of method 'System.Reflection.MemberInfo.DeclaringType.get' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:46.3725150Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Serialization.JsonDynamicContract.CreateCallSiteGetter(String): Using member 'System.Runtime.CompilerServices.CallSite`1<Func`3<CallSite,Object,Object>>.Create(CallSiteBinder)' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. Creating arrays at runtime requires dynamic code generation. 
2024-01-15T21:50:46.3726660Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Serialization.JsonDynamicContract.CreateCallSiteSetter(String): Using member 'System.Runtime.CompilerServices.CallSite`1<Func`4<CallSite,Object,Object,Object>>.Create(CallSiteBinder)' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. Creating arrays at runtime requires dynamic code generation. 
2024-01-15T21:50:46.6421290Z ILC : Trim analysis warning IL2067: Microsoft.Identity.Json.Utilities.ExpressionReflectionDelegateFactory.CreateDefaultConstructor<T>(Type): '' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicParameterlessConstructor' in call to 'System.Linq.Expressions.Expression.New(Type)'. The parameter '#0' of method 'Microsoft.Identity.Json.Utilities.ExpressionReflectionDelegateFactory.CreateDefaultConstructor<T>(Type)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:46.7224420Z ILC : Trim analysis warning IL2067: Microsoft.Identity.Json.Utilities.ReflectionUtils.GetDefaultValue(Type): 'type' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicParameterlessConstructor' in call to 'System.Activator.CreateInstance(Type)'. The parameter '#0' of method 'Microsoft.Identity.Json.Utilities.ReflectionUtils.GetDefaultValue(Type)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:46.7255380Z ILC : Trim analysis warning IL2075: Microsoft.Identity.Json.Serialization.DefaultContractResolver.GetCallbackMethodsForType(Type,List`1<SerializationCallback>&,List`1<SerializationCallback>&,List`1<SerializationCallback>&,List`1<SerializationCallback>&,List`1<SerializationErrorCallback>&): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicMethods', 'DynamicallyAccessedMemberTypes.NonPublicMethods' in call to 'System.Type.GetMethods(BindingFlags)'. The return value of method 'System.Collections.Generic.List`1.Enumerator<Type>.Current.get' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:46.7259500Z ILC : Trim analysis warning IL2070: Microsoft.Identity.Json.Utilities.ReflectionUtils.GetDefaultConstructor(Type,Boolean): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicConstructors', 'DynamicallyAccessedMemberTypes.NonPublicConstructors' in call to 'System.Type.GetConstructors(BindingFlags)'. The parameter '#0' of method 'Microsoft.Identity.Json.Utilities.ReflectionUtils.GetDefaultConstructor(Type,Boolean)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:46.7382800Z ILC : Trim analysis warning IL2026: Microsoft.Identity.Json.Utilities.DynamicUtils.BinderWrapper.SetMember(String,Type): Using member 'Microsoft.CSharp.RuntimeBinder.Binder.SetMember(CSharpBinderFlags,String,Type,IEnumerable`1<CSharpArgumentInfo>)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Using dynamic types might cause types or members to be removed by trimmer. 
2024-01-15T21:50:46.7385070Z ILC : Trim analysis warning IL2026: Microsoft.Identity.Json.Utilities.DynamicUtils.BinderWrapper.GetMember(String,Type): Using member 'Microsoft.CSharp.RuntimeBinder.Binder.GetMember(CSharpBinderFlags,String,Type,IEnumerable`1<CSharpArgumentInfo>)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Using dynamic types might cause types or members to be removed by trimmer. 
2024-01-15T21:50:46.7423770Z ILC : Trim analysis warning IL2070: Microsoft.Identity.Json.Utilities.ReflectionUtils.GetMemberInfoFromType(Type,MemberInfo): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties', 'DynamicallyAccessedMemberTypes.NonPublicProperties' in call to 'System.Type.GetProperty(String,BindingFlags,Binder,Type,Type[],ParameterModifier[])'. The parameter '#0' of method 'Microsoft.Identity.Json.Utilities.ReflectionUtils.GetMemberInfoFromType(Type,MemberInfo)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:46.7426880Z ILC : Trim analysis warning IL2070: Microsoft.Identity.Json.Utilities.ReflectionUtils.GetMemberInfoFromType(Type,MemberInfo): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicConstructors', 'DynamicallyAccessedMemberTypes.NonPublicConstructors', 'DynamicallyAccessedMemberTypes.PublicMethods', 'DynamicallyAccessedMemberTypes.NonPublicMethods', 'DynamicallyAccessedMemberTypes.PublicFields', 'DynamicallyAccessedMemberTypes.NonPublicFields', 'DynamicallyAccessedMemberTypes.PublicNestedTypes', 'DynamicallyAccessedMemberTypes.NonPublicNestedTypes', 'DynamicallyAccessedMemberTypes.PublicProperties', 'DynamicallyAccessedMemberTypes.NonPublicProperties', 'DynamicallyAccessedMemberTypes.PublicEvents', 'DynamicallyAccessedMemberTypes.NonPublicEvents' in call to 'System.Type.GetMember(String,MemberTypes,BindingFlags)'. The parameter '#0' of method 'Microsoft.Identity.Json.Utilities.ReflectionUtils.GetMemberInfoFromType(Type,MemberInfo)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:46.7591670Z ILC : Trim analysis warning IL2075: Microsoft.Identity.Json.Serialization.DefaultContractResolver.CreateShouldSerializeTest(MemberInfo): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicMethods' in call to 'System.Type.GetMethod(String,Type[])'. The return value of method 'System.Reflection.MemberInfo.DeclaringType.get' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:46.7596630Z ILC : Trim analysis warning IL2075: Microsoft.Identity.Json.Serialization.DefaultContractResolver.SetIsSpecifiedActions(JsonProperty,MemberInfo,Boolean): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties', 'DynamicallyAccessedMemberTypes.NonPublicProperties' in call to 'System.Type.GetProperty(String,BindingFlags)'. The return value of method 'System.Reflection.MemberInfo.DeclaringType.get' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:46.7598970Z ILC : Trim analysis warning IL2075: Microsoft.Identity.Json.Serialization.DefaultContractResolver.SetIsSpecifiedActions(JsonProperty,MemberInfo,Boolean): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicFields', 'DynamicallyAccessedMemberTypes.NonPublicFields' in call to 'System.Type.GetField(String,BindingFlags)'. The return value of method 'System.Reflection.MemberInfo.DeclaringType.get' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:46.7608220Z ILC : Trim analysis warning IL2070: Microsoft.Identity.Json.Utilities.TypeExtensions.AssignableToTypeName(Type,String,Boolean,Type&): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.Interfaces' in call to 'System.Type.GetInterfaces()'. The parameter '#0' of method 'Microsoft.Identity.Json.Utilities.TypeExtensions.AssignableToTypeName(Type,String,Boolean,Type&)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:46.7749920Z ILC : Trim analysis warning IL2060: Microsoft.Identity.Json.Utilities.FSharpUtils.CreateSeq(Type): Call to 'System.Reflection.MethodInfo.MakeGenericMethod(Type[])' can not be statically analyzed. It's not possible to guarantee the availability of requirements of the generic method. 
2024-01-15T21:50:46.7751490Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Utilities.FSharpUtils.CreateSeq(Type): Using member 'System.Reflection.MethodInfo.MakeGenericMethod(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime. 
2024-01-15T21:50:46.7761490Z ILC : Trim analysis warning IL2070: Microsoft.Identity.Json.Utilities.TypeExtensions.ImplementInterface(Type,Type): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.Interfaces' in call to 'System.Type.GetInterfaces()'. The parameter '#0' of method 'Microsoft.Identity.Json.Utilities.TypeExtensions.ImplementInterface(Type,Type)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:46.7888870Z ILC : Trim analysis warning IL2070: Microsoft.Identity.Json.Utilities.ReflectionObject.Create(Type,MethodBase,String[]): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicConstructors', 'DynamicallyAccessedMemberTypes.PublicMethods', 'DynamicallyAccessedMemberTypes.PublicFields', 'DynamicallyAccessedMemberTypes.PublicNestedTypes', 'DynamicallyAccessedMemberTypes.PublicProperties', 'DynamicallyAccessedMemberTypes.PublicEvents' in call to 'System.Type.GetMember(String,BindingFlags)'. The parameter '#0' of method 'Microsoft.Identity.Json.Utilities.ReflectionObject.Create(Type,MethodBase,String[])' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:46.7891630Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Utilities.FSharpUtils.CreateMap(Type,Type): Using member 'System.Reflection.MethodInfo.MakeGenericMethod(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime. 
2024-01-15T21:50:46.7895650Z ILC : Trim analysis warning IL2026: Microsoft.Identity.Json.Utilities.FSharpUtils.FSharpUtils(Assembly): Using member 'System.Reflection.Assembly.GetType(String)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed. 
2024-01-15T21:50:46.7898230Z ILC : Trim analysis warning IL2026: Microsoft.Identity.Json.Utilities.FSharpUtils.FSharpUtils(Assembly): Using member 'System.Reflection.Assembly.GetType(String)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed. 
2024-01-15T21:50:46.7901110Z ILC : Trim analysis warning IL2026: Microsoft.Identity.Json.Utilities.FSharpUtils.FSharpUtils(Assembly): Using member 'System.Reflection.Assembly.GetType(String)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed. 
2024-01-15T21:50:46.7903930Z ILC : Trim analysis warning IL2075: Microsoft.Identity.Json.Utilities.FSharpUtils.FSharpUtils(Assembly): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties' in call to 'System.Type.GetProperty(String)'. The return value of method 'System.Reflection.Assembly.GetType(String)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:46.7905700Z ILC : Trim analysis warning IL2075: Microsoft.Identity.Json.Utilities.FSharpUtils.FSharpUtils(Assembly): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties' in call to 'System.Type.GetProperty(String)'. The return value of method 'System.Reflection.Assembly.GetType(String)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:46.7907640Z ILC : Trim analysis warning IL2075: Microsoft.Identity.Json.Utilities.FSharpUtils.FSharpUtils(Assembly): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties' in call to 'System.Type.GetProperty(String)'. The return value of method 'System.Reflection.Assembly.GetType(String)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:46.7910020Z ILC : Trim analysis warning IL2075: Microsoft.Identity.Json.Utilities.FSharpUtils.FSharpUtils(Assembly): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicMethods' in call to 'System.Type.GetMethod(String)'. The return value of method 'System.Reflection.Assembly.GetType(String)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:46.7911430Z ILC : Trim analysis warning IL2026: Microsoft.Identity.Json.Utilities.FSharpUtils.FSharpUtils(Assembly): Using member 'System.Reflection.Assembly.GetType(String)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed. 
2024-01-15T21:50:46.7912870Z ILC : Trim analysis warning IL2075: Microsoft.Identity.Json.Utilities.FSharpUtils.FSharpUtils(Assembly): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicMethods' in call to 'System.Type.GetMethod(String)'. The return value of method 'System.Reflection.Assembly.GetType(String)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:46.7914210Z ILC : Trim analysis warning IL2026: Microsoft.Identity.Json.Utilities.FSharpUtils.FSharpUtils(Assembly): Using member 'System.Reflection.Assembly.GetType(String)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed. 
2024-01-15T21:50:46.7924330Z ILC : Trim analysis warning IL2080: Microsoft.Identity.Json.Utilities.ConvertUtils.CreateCastConverter(StructMultiKey`2<Type,Type>): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicMethods' in call to 'System.Type.GetMethod(String,Type[])'. The field 'Microsoft.Identity.Json.Utilities.StructMultiKey`2<Type,Type>.Value2' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:46.7926500Z ILC : Trim analysis warning IL2080: Microsoft.Identity.Json.Utilities.ConvertUtils.CreateCastConverter(StructMultiKey`2<Type,Type>): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicMethods' in call to 'System.Type.GetMethod(String,Type[])'. The field 'Microsoft.Identity.Json.Utilities.StructMultiKey`2<Type,Type>.Value2' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:46.7942600Z ILC : Trim analysis warning IL2057: Microsoft.Identity.Json.Utilities.ConvertUtils.TryConvertInternal(Object,CultureInfo,Type,Object&): Unrecognized value passed to the parameter 'typeName' of method 'System.Type.GetType(String,Boolean)'. It's not possible to guarantee the availability of the target type. 
2024-01-15T21:50:46.8411700Z ILC : Trim analysis warning IL2080: Microsoft.Identity.Json.Utilities.EnumUtils.InitializeValuesAndNames(StructMultiKey`2<Type,NamingStrategy>): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicFields', 'DynamicallyAccessedMemberTypes.NonPublicFields' in call to 'System.Type.GetField(String,BindingFlags)'. The field 'Microsoft.Identity.Json.Utilities.StructMultiKey`2<Type,NamingStrategy>.Value1' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:49.1457530Z ILC : Trim analysis warning IL2070: Microsoft.Identity.Json.Utilities.FSharpUtils.GetMethodWithNonPublicFallback(Type,String,BindingFlags): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicMethods', 'DynamicallyAccessedMemberTypes.NonPublicMethods' in call to 'System.Type.GetMethod(String,BindingFlags)'. The parameter '#0' of method 'Microsoft.Identity.Json.Utilities.FSharpUtils.GetMethodWithNonPublicFallback(Type,String,BindingFlags)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:49.1459880Z ILC : Trim analysis warning IL2070: Microsoft.Identity.Json.Utilities.FSharpUtils.GetMethodWithNonPublicFallback(Type,String,BindingFlags): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicMethods', 'DynamicallyAccessedMemberTypes.NonPublicMethods' in call to 'System.Type.GetMethod(String,BindingFlags)'. The parameter '#0' of method 'Microsoft.Identity.Json.Utilities.FSharpUtils.GetMethodWithNonPublicFallback(Type,String,BindingFlags)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:49.1462760Z ILC : Trim analysis warning IL2075: Microsoft.Identity.Json.Utilities.FSharpUtils.CreateFSharpFuncCall(Type,String): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicMethods' in call to 'System.Type.GetMethod(String,BindingFlags)'. The return value of method 'System.Reflection.MethodInfo.ReturnType.get' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:49.1464960Z ILC : Trim analysis warning IL2055: Microsoft.Identity.Json.Utilities.FSharpUtils.BuildMapCreator<TKey,TValue>(): Call to 'System.Type.MakeGenericType(Type[])' can not be statically analyzed. It's not possible to guarantee the availability of requirements of the generic type. 
2024-01-15T21:50:49.1466340Z ILC : AOT analysis warning IL3050: Microsoft.Identity.Json.Utilities.FSharpUtils.BuildMapCreator<TKey,TValue>(): Using member 'System.Type.MakeGenericType(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime. 
2024-01-15T21:50:49.1467930Z ILC : Trim analysis warning IL2080: Microsoft.Identity.Json.Utilities.FSharpUtils.BuildMapCreator<TKey,TValue>(): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicConstructors' in call to 'System.Type.GetConstructor(Type[])'. The field 'Microsoft.Identity.Json.Utilities.FSharpUtils._mapType' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:49.1742560Z ILC : Trim analysis warning IL2070: Microsoft.Identity.Json.Utilities.ReflectionUtils.GetFields(Type,BindingFlags): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicFields', 'DynamicallyAccessedMemberTypes.NonPublicFields' in call to 'System.Type.GetFields(BindingFlags)'. The parameter '#0' of method 'Microsoft.Identity.Json.Utilities.ReflectionUtils.GetFields(Type,BindingFlags)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:49.1745400Z ILC : Trim analysis warning IL2070: Microsoft.Identity.Json.Utilities.ReflectionUtils.GetProperties(Type,BindingFlags): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties', 'DynamicallyAccessedMemberTypes.NonPublicProperties' in call to 'System.Type.GetProperties(BindingFlags)'. The parameter '#0' of method 'Microsoft.Identity.Json.Utilities.ReflectionUtils.GetProperties(Type,BindingFlags)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:49.1748120Z ILC : Trim analysis warning IL2070: Microsoft.Identity.Json.Utilities.ReflectionUtils.GetProperties(Type,BindingFlags): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.Interfaces' in call to 'System.Type.GetInterfaces()'. The parameter '#0' of method 'Microsoft.Identity.Json.Utilities.ReflectionUtils.GetProperties(Type,BindingFlags)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:49.1750220Z ILC : Trim analysis warning IL2065: Microsoft.Identity.Json.Utilities.ReflectionUtils.GetProperties(Type,BindingFlags): Value passed to implicit 'this' parameter of method 'System.Type.GetProperties(BindingFlags)' can not be statically determined and may not meet 'DynamicallyAccessedMembersAttribute' requirements. 
2024-01-15T21:50:49.1753570Z ILC : Trim analysis warning IL2075: Microsoft.Identity.Json.Utilities.ReflectionUtils.IsOverridenGenericMember(MemberInfo,BindingFlags): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicConstructors', 'DynamicallyAccessedMemberTypes.NonPublicConstructors', 'DynamicallyAccessedMemberTypes.PublicMethods', 'DynamicallyAccessedMemberTypes.NonPublicMethods', 'DynamicallyAccessedMemberTypes.PublicFields', 'DynamicallyAccessedMemberTypes.NonPublicFields', 'DynamicallyAccessedMemberTypes.PublicNestedTypes', 'DynamicallyAccessedMemberTypes.NonPublicNestedTypes', 'DynamicallyAccessedMemberTypes.PublicProperties', 'DynamicallyAccessedMemberTypes.NonPublicProperties', 'DynamicallyAccessedMemberTypes.PublicEvents', 'DynamicallyAccessedMemberTypes.NonPublicEvents' in call to 'System.Type.GetMember(String,BindingFlags)'. The return value of method 'System.Type.GetGenericTypeDefinition()' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:49.7225080Z ILC : Trim analysis warning IL2070: Microsoft.Identity.Json.Utilities.ReflectionUtils.GetChildPrivateProperties(IList`1<PropertyInfo>,Type,BindingFlags): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties', 'DynamicallyAccessedMemberTypes.NonPublicProperties' in call to 'System.Type.GetProperties(BindingFlags)'. The parameter '#1' of method 'Microsoft.Identity.Json.Utilities.ReflectionUtils.GetChildPrivateProperties(IList`1<PropertyInfo>,Type,BindingFlags)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:49.7265180Z ILC : Trim analysis warning IL2070: Microsoft.Identity.Json.Utilities.ReflectionUtils.GetChildPrivateFields(IList`1<MemberInfo>,Type,BindingFlags): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicFields', 'DynamicallyAccessedMemberTypes.NonPublicFields' in call to 'System.Type.GetFields(BindingFlags)'. The parameter '#1' of method 'Microsoft.Identity.Json.Utilities.ReflectionUtils.GetChildPrivateFields(IList`1<MemberInfo>,Type,BindingFlags)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
2024-01-15T21:50:49.7754900Z ILC : Trim analysis warning IL2070: Microsoft.Identity.Json.Serialization.JsonTypeReflector.<>c__DisplayClass21_0.<GetCreator>b__0(Object[]): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicConstructors' in call to 'System.Type.GetConstructor(Type[])'. The parameter 'type' of method 'Microsoft.Identity.Json.Serialization.JsonTypeReflector.GetCreator(Type)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. 
pmaytak commented 10 months ago

@charlesroddie Do you target .NET 8, net8.0-ios?

charlesroddie commented 10 months ago

Yes sorry net8.0-ios in this build.

bgavrilMS commented 10 months ago

Please open a new bug on the library @charlesroddie . We've done the work to move from Newtonsoft to System.Text.Json only for our net6 and net6-windows target, we did not do it for net6-ios / net6-android targets.