Closed
Description
While trying to use the Http resilisnce library auth PublishAot I got warnings:
EnableReloads
ILC : Trim analysis warning IL2091: Microsoft.Extensions.Http.Resilience.ResilienceHandlerContext.EnableReloads<TOptions>(String): 'TOptions' generic argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicParameterlessConstructor' in 'Polly.DependencyInjection
.AddResiliencePipelineContext`1.EnableReloads<TOptions>(String)'. The generic parameter 'TOptions' of 'Microsoft.Extensions.Http.Resilience.ResilienceHandlerContext.EnableReloads<TOptions>(String)' does not have matching annotations. The source value must declare at le
ast the same requirements as those declared on the target location it is assigned to. [C:\dev\git\eShop\src\Ordering.BackgroundTasks\Ordering.BackgroundTasks.csproj]
ILC : Trim analysis warning IL2026: Polly.Timeout.TimeoutStrategyOptions.Timeout: Using member 'System.ComponentModel.DataAnnotations.RangeAttribute.RangeAttribute(Type,String,String)' 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. [C:\dev\git\eShop\src\Ordering.BackgroundTasks\Ordering.BackgroundTasks.csproj]
ILC : Trim analysis warning IL2026: Polly.Timeout.TimeoutStrategyOptions.Timeout: Using member 'System.ComponentModel.DataAnnotations.RangeAttribute.RangeAttribute(Type,String,String)' 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. [C:\dev\git\eShop\src\Ordering.BackgroundTasks\Ordering.BackgroundTasks.csproj]
ILC : Trim analysis warning IL2026: Microsoft.Extensions.Http.Resilience.Internal.Validators.HttpStandardResilienceOptionsValidator.Validate(String,HttpStandardResilienceOptions): Using member 'System.ComponentModel.DataAnnotations.ValidationContext.ValidationContext(O
bject)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. The Type of instance cannot be statically discovered and the Type's properties can be trimmed. [C:\dev\git\eShop\src\Ordering.BackgroundTasks\Ordering.Backgrou
ndTasks.csproj]
Options Validation cc @tarekgh ?
ILC : Trim analysis warning IL2026: __OptionValidationStaticInstances.<Validators_g>F8B1F3D42962A35D8FF1B1489612AEF6C36F3713335EFF79DB68A25973333C495____Attributes..cctor(): Using member 'System.ComponentModel.DataAnnotations.LengthAttribute.LengthAttribute(Int32,Int32
)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Uses reflection to get the 'Count' property on types that don't implement ICollection. This 'Count' property may be trimmed. Ensure it is preserved. [C:\dev\git\eSh
op\src\Ordering.BackgroundTasks\Ordering.BackgroundTasks.csproj]
ILC : Trim analysis warning IL2026: __OptionValidationStaticInstances.<Validators_g>F8B1F3D42962A35D8FF1B1489612AEF6C36F3713335EFF79DB68A25973333C495____Attributes..cctor(): Using member 'System.ComponentModel.DataAnnotations.RangeAttribute.RangeAttribute(Type,String,S
tring)' 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 DynamicallyAccessedMemb
ers All. [C:\dev\git\eShop\src\Ordering.BackgroundTasks\Ordering.BackgroundTasks.csproj]
ILC : Trim analysis warning IL2026: __OptionValidationStaticInstances.<Validators_g>F8B1F3D42962A35D8FF1B1489612AEF6C36F3713335EFF79DB68A25973333C495____Attributes..cctor(): Using member 'System.ComponentModel.DataAnnotations.RangeAttribute.RangeAttribute(Type,String,S
tring)' 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 DynamicallyAccessedMemb
ers All. [C:\dev\git\eShop\src\Ordering.BackgroundTasks\Ordering.BackgroundTasks.csproj]
ILC : Trim analysis warning IL2026: __OptionValidationStaticInstances.<Validators_g>F8B1F3D42962A35D8FF1B1489612AEF6C36F3713335EFF79DB68A25973333C495____Attributes..cctor(): Using member 'System.ComponentModel.DataAnnotations.RangeAttribute.RangeAttribute(Type,String,S
tring)' 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 DynamicallyAccessedMemb
ers All. [C:\dev\git\eShop\src\Ordering.BackgroundTasks\Ordering.BackgroundTasks.csproj]
ILC : Trim analysis warning IL2026: Microsoft.Extensions.Http.Resilience.__HttpRateLimiterStrategyOptionsValidator__.Validate(String,HttpRateLimiterStrategyOptions): Using member 'System.ComponentModel.DataAnnotations.ValidationContext.ValidationContext(Object)' which
has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. The Type of instance cannot be statically discovered and the Type's properties can be trimmed. [C:\dev\git\eShop\src\Ordering.BackgroundTasks\Ordering.BackgroundTasks.csproj
]
ILC : Trim analysis warning IL2026: Microsoft.Extensions.Http.Resilience.__HttpTimeoutStrategyOptionsValidator__.Validate(String,HttpTimeoutStrategyOptions): Using member 'System.ComponentModel.DataAnnotations.ValidationContext.ValidationContext(Object)' which has 'Req
uiresUnreferencedCodeAttribute' can break functionality when trimming application code. The Type of instance cannot be statically discovered and the Type's properties can be trimmed. [C:\dev\git\eShop\src\Ordering.BackgroundTasks\Ordering.BackgroundTasks.csproj]
ILC : Trim analysis warning IL2026: Microsoft.Extensions.Http.Resilience.__HttpRetryStrategyOptionsValidator__.Validate(String,HttpRetryStrategyOptions): Using member 'System.ComponentModel.DataAnnotations.ValidationContext.ValidationContext(Object)' which has 'Require
sUnreferencedCodeAttribute' can break functionality when trimming application code. The Type of instance cannot be statically discovered and the Type's properties can be trimmed. [C:\dev\git\eShop\src\Ordering.BackgroundTasks\Ordering.BackgroundTasks.csproj]
ILC : Trim analysis warning IL2026: Microsoft.Extensions.Http.Resilience.__HttpCircuitBreakerStrategyOptionsValidator__.Validate(String,HttpCircuitBreakerStrategyOptions): Using member 'System.ComponentModel.DataAnnotations.ValidationContext.ValidationContext(Object)'
which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. The Type of instance cannot be statically discovered and the Type's properties can be trimmed. [C:\dev\git\eShop\src\Ordering.BackgroundTasks\Ordering.BackgroundTasks.
csproj]
We should do a pass and make sure that we avoid warnings to make sure its possible to use these libraries with NativeAOT.