diff --git a/src/coreclr/tools/Common/Compiler/Logger.cs b/src/coreclr/tools/Common/Compiler/Logger.cs index eb77c7cd681e1..26f763b815595 100644 --- a/src/coreclr/tools/Common/Compiler/Logger.cs +++ b/src/coreclr/tools/Common/Compiler/Logger.cs @@ -10,6 +10,7 @@ using Internal.TypeSystem.Ecma; using ILCompiler.Logging; +using ILLink.Shared; using ILSequencePoint = Internal.IL.ILSequencePoint; using MethodIL = Internal.IL.MethodIL; @@ -198,11 +199,4 @@ private static string GetModuleFileName(ModuleDesc module) return assemblyName; } } - - public static class MessageSubCategory - { - public const string None = ""; - public const string TrimAnalysis = "Trim analysis"; - public const string AotAnalysis = "AOT analysis"; - } } diff --git a/src/coreclr/tools/Common/Compiler/Logging/MessageContainer.cs b/src/coreclr/tools/Common/Compiler/Logging/MessageContainer.cs index 95ed5bf04fa0c..ebe08a14870ed 100644 --- a/src/coreclr/tools/Common/Compiler/Logging/MessageContainer.cs +++ b/src/coreclr/tools/Common/Compiler/Logging/MessageContainer.cs @@ -6,6 +6,8 @@ using Internal.TypeSystem; using Internal.TypeSystem.Ecma; +using ILLink.Shared; + using Debug = System.Diagnostics.Debug; namespace ILCompiler.Logging diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/Dataflow/FlowAnnotations.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/Dataflow/FlowAnnotations.cs index f3585e0e098f0..64ce9a5ba1218 100644 --- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/Dataflow/FlowAnnotations.cs +++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/Dataflow/FlowAnnotations.cs @@ -10,6 +10,8 @@ using Internal.TypeSystem; using Internal.TypeSystem.Ecma; +using ILLink.Shared; + using Debug = System.Diagnostics.Debug; namespace ILCompiler.Dataflow diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/Dataflow/ReflectionMethodBodyScanner.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/Dataflow/ReflectionMethodBodyScanner.cs index 06d371cd17aea..1f198fbc155e7 100644 --- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/Dataflow/ReflectionMethodBodyScanner.cs +++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/Dataflow/ReflectionMethodBodyScanner.cs @@ -1029,8 +1029,8 @@ public override bool HandleCall(MethodIL callingMethodBody, MethodDesc calledMet // We don't know what method the `MakeGenericMethod` was called on, so we have to assume // that the method may have requirements which we can't fullfil -> warn. reflectionContext.RecordUnrecognizedPattern( - (int)DiagnosticId.MakeGenericMethodCannotBeStaticallyAnalyzed, - new DiagnosticString(DiagnosticId.MakeGenericMethodCannotBeStaticallyAnalyzed).GetMessage(DiagnosticUtilities.GetMethodSignatureDisplayName(calledMethod))); + (int)DiagnosticId.MakeGenericMethod, + new DiagnosticString(DiagnosticId.MakeGenericMethod).GetMessage(DiagnosticUtilities.GetMethodSignatureDisplayName(calledMethod))); } RequireDynamicallyAccessedMembers( @@ -1048,8 +1048,8 @@ public override bool HandleCall(MethodIL callingMethodBody, MethodDesc calledMet // We don't know what method the `MakeGenericMethod` was called on, so we have to assume // that the method may have requirements which we can't fullfil -> warn. reflectionContext.RecordUnrecognizedPattern( - (int)DiagnosticId.MakeGenericMethodCannotBeStaticallyAnalyzed, - new DiagnosticString(DiagnosticId.MakeGenericMethodCannotBeStaticallyAnalyzed).GetMessage(DiagnosticUtilities.GetMethodSignatureDisplayName(calledMethod))); + (int)DiagnosticId.MakeGenericMethod, + new DiagnosticString(DiagnosticId.MakeGenericMethod).GetMessage(DiagnosticUtilities.GetMethodSignatureDisplayName(calledMethod))); } RequireDynamicallyAccessedMembers( @@ -2162,8 +2162,8 @@ public override bool HandleCall(MethodIL callingMethodBody, MethodDesc calledMet // We don't know what method the `MakeGenericMethod` was called on, so we have to assume // that the method may have requirements which we can't fullfil -> warn. reflectionContext.RecordUnrecognizedPattern( - (int)DiagnosticId.MakeGenericMethodCannotBeStaticallyAnalyzed, - new DiagnosticString(DiagnosticId.MakeGenericMethodCannotBeStaticallyAnalyzed).GetMessage( + (int)DiagnosticId.MakeGenericMethod, + new DiagnosticString(DiagnosticId.MakeGenericMethod).GetMessage( DiagnosticUtilities.GetMethodSignatureDisplayName(calledMethod))); } } @@ -3066,8 +3066,8 @@ void ValidateGenericMethodInstantiation( if (!AnalyzeGenericInstantiationTypeArray(genericParametersArray, ref reflectionContext, reflectionMethod, genericMethod.GetMethodDefinition().Instantiation)) { reflectionContext.RecordUnrecognizedPattern( - (int)DiagnosticId.MakeGenericMethodCannotBeStaticallyAnalyzed, - new DiagnosticString(DiagnosticId.MakeGenericMethodCannotBeStaticallyAnalyzed).GetMessage(DiagnosticUtilities.GetMethodSignatureDisplayName(reflectionMethod))); + (int)DiagnosticId.MakeGenericMethod, + new DiagnosticString(DiagnosticId.MakeGenericMethod).GetMessage(DiagnosticUtilities.GetMethodSignatureDisplayName(reflectionMethod))); } else { diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/Dataflow/ReflectionPatternContext.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/Dataflow/ReflectionPatternContext.cs index 99d97784e7811..61a48fe965a0c 100644 --- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/Dataflow/ReflectionPatternContext.cs +++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/Dataflow/ReflectionPatternContext.cs @@ -7,6 +7,8 @@ using Internal.IL; using Internal.TypeSystem; +using ILLink.Shared; + namespace ILCompiler.Dataflow { /// diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/LazyGenerics/ModuleCycleInfo.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/LazyGenerics/ModuleCycleInfo.cs index 378af488af020..07e2768797cab 100644 --- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/LazyGenerics/ModuleCycleInfo.cs +++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/LazyGenerics/ModuleCycleInfo.cs @@ -8,6 +8,8 @@ using Internal.TypeSystem; using Internal.TypeSystem.Ecma; +using ILLink.Shared; + using Debug = System.Diagnostics.Debug; namespace ILCompiler diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/UsageBasedMetadataManager.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/UsageBasedMetadataManager.cs index 439d4e014e6db..971d932be8c10 100644 --- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/UsageBasedMetadataManager.cs +++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/UsageBasedMetadataManager.cs @@ -15,6 +15,7 @@ using ILCompiler.Metadata; using ILCompiler.DependencyAnalysis; using ILCompiler.DependencyAnalysisFramework; +using ILLink.Shared; using FlowAnnotations = ILCompiler.Dataflow.FlowAnnotations; using DependencyList = ILCompiler.DependencyAnalysisFramework.DependencyNodeCore.DependencyList; diff --git a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/ILCompiler.ReadyToRun.csproj b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/ILCompiler.ReadyToRun.csproj index 5154db358a8b8..6c7d67517a9ee 100644 --- a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/ILCompiler.ReadyToRun.csproj +++ b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/ILCompiler.ReadyToRun.csproj @@ -283,4 +283,5 @@ + diff --git a/src/coreclr/tools/aot/ILCompiler.RyuJit/Compiler/RyuJitCompilation.cs b/src/coreclr/tools/aot/ILCompiler.RyuJit/Compiler/RyuJitCompilation.cs index 0d8b11c51f82e..b27f7db8ec7d8 100644 --- a/src/coreclr/tools/aot/ILCompiler.RyuJit/Compiler/RyuJitCompilation.cs +++ b/src/coreclr/tools/aot/ILCompiler.RyuJit/Compiler/RyuJitCompilation.cs @@ -9,6 +9,7 @@ using ILCompiler.DependencyAnalysis; using ILCompiler.DependencyAnalysisFramework; +using ILLink.Shared; using Internal.IL; using Internal.IL.Stubs; diff --git a/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj b/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj index 6c559924f405c..6c5a4a6d377d8 100644 --- a/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj +++ b/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj @@ -1,4 +1,4 @@ - + ilc true @@ -121,10 +121,6 @@ On Linux renaming the library makes it difficult to debug it. --> - + diff --git a/src/coreclr/tools/aot/ILLink.Shared/DiagnosticId.cs b/src/coreclr/tools/aot/ILLink.Shared/DiagnosticId.cs index 8bffef3ab0e5b..e25b16f8ef844 100644 --- a/src/coreclr/tools/aot/ILLink.Shared/DiagnosticId.cs +++ b/src/coreclr/tools/aot/ILLink.Shared/DiagnosticId.cs @@ -5,17 +5,123 @@ namespace ILLink.Shared { public enum DiagnosticId { + // Linker error ids. + XmlFeatureDoesNotSpecifyFeatureValue = 1001, + XmlUnsupportedNonBooleanValueForFeature = 1002, + XmlException = 1003, + _unused_FailedToProcessDescriptorFile = 1004, + CouldNotFindMethodInAssembly = 1005, + CannotStubConstructorWhenBaseTypeDoesNotHaveConstructor = 1006, + CouldNotFindType = 1007, + CouldNotFindConstructor = 1008, + CouldNotFindAssemblyReference = 1009, + CouldNotLoadAssembly = 1010, + FailedToWriteOutput = 1011, + LinkerUnexpectedError = 1012, + ErrorProcessingXmlLocation = 1013, + XmlDocumentLocationHasInvalidFeatureDefault = 1014, + UnrecognizedCommandLineOption = 1015, + InvalidWarningVersion = 1016, + InvalidGenerateWarningSuppressionsValue = 1017, + MissingArgumentForCommanLineOptionName = 1018, + CustomDataFormatIsInvalid = 1019, + NoFilesToLinkSpecified = 1020, + NewMvidAndDeterministicCannotBeUsedAtSameTime = 1021, + AssemblyInCustomStepOptionCouldNotBeFound = 1022, + AssemblyPathInCustomStepMustBeFullyQualified = 1023, + InvalidArgForCustomStep = 1024, + ExpectedSignToControlNewStepInsertion = 1025, + PipelineStepCouldNotBeFound = 1026, + CustomStepTypeCouldNotBeFound = 1027, + CustomStepTypeIsIncompatibleWithLinkerVersion = 1028, + InvalidOptimizationValue = 1029, + InvalidArgumentForTokenOption = 1030, + InvalidAssemblyAction = 1031, + RootAssemblyCouldNotBeFound = 1032, + XmlDescriptorCouldNotBeFound = 1033, + RootAssemblyDoesNotHaveEntryPoint = 1034, + RootAssemblyCannotUseAction = 1035, + InvalidAssemblyName = 1036, + InvalidAssemblyRootMode = 1037, + ExportedTypeCannotBeResolved = 1038, + ReferenceAssemblyCouldNotBeLoaded = 1039, + FailedToResolveMetadataElement = 1040, + TypeUsedWithAttributeValueCouldNotBeFound = 1041, + CannotConverValueToType = 1042, + CustomAttributeArgumentForTypeRequiresNestedNode = 1043, + CouldNotResolveCustomAttributeTypeValue = 1044, + UnexpectedAttributeArgumentType = 1045, + InvalidMetadataOption = 1046, + // Linker diagnostic ids. + TypeHasNoFieldsToPreserve = 2001, + TypeHasNoMethodsToPreserve = 2002, + CouldNotResolveDependencyAssembly = 2003, + CouldNotResolveDependencyType = 2004, + CouldNotResolveDependencyMember = 2005, + _unused_UnrecognizedReflectionPattern = 2006, + XmlCouldNotResolveAssembly = 2007, + XmlCouldNotResolveType = 2008, + XmlCouldNotFindMethodOnType = 2009, + XmlInvalidValueForStub = 2010, + XmlUnkownBodyModification = 2011, + XmlCouldNotFindFieldOnType = 2012, + XmlSubstitutedFieldNeedsToBeStatic = 2013, + XmlMissingSubstitutionValueForField = 2014, + XmlInvalidSubstitutionValueForField = 2015, + XmlCouldNotFindEventOnType = 2016, + XmlCouldNotFindPropertyOnType = 2017, + XmlCouldNotFindGetAccesorOfPropertyOnType = 2018, + XmlCouldNotFindSetAccesorOfPropertyOnType = 2019, + _unused_RearrangedXmlWarning1 = 2020, + _unused_RearrangedXmlWarning2 = 2021, + XmlCouldNotFindMatchingConstructorForCustomAttribute = 2022, + XmlMoreThanOneReturnElementForMethod = 2023, + XmlMoreThanOneValyForParameterOfMethod = 2024, + XmlDuplicatePreserveMember = 2025, RequiresUnreferencedCode = 2026, + AttributeShouldOnlyBeUsedOnceOnMember = 2027, + AttributeDoesntHaveTheRequiredNumberOfParameters = 2028, + XmlElementDoesNotContainRequiredAttributeFullname = 2029, + XmlCouldNotResolveAssemblyForAttribute = 2030, + XmlAttributeTypeCouldNotBeFound = 2031, + UnrecognizedParameterInMethodCreateInstance = 2032, + DeprecatedPreserveDependencyAttribute = 2033, + DynamicDependencyAttributeCouldNotBeAnalyzed = 2034, + UnresolvedAssemblyInDynamicDependencyAttribute = 2035, + UnresolvedTypeInDynamicDependencyAttribute = 2036, + NoMembersResolvedForMemberSignatureOrType = 2037, + XmlMissingNameAttributeInResource = 2038, + XmlInvalidValueForAttributeActionForResource = 2039, + XmlCouldNotFindResourceToRemoveInAssembly = 2040, + DynamicallyAccessedMembersIsNotAllowedOnMethods = 2041, + DynamicallyAccessedMembersCouldNotFindBackingField = 2042, + DynamicallyAccessedMembersConflictsBetweenPropertyAndAccessor = 2043, + XmlCouldNotFindAnyTypeInNamespace = 2044, + AttributeIsReferencedButTrimmerRemoveAllInstances = 2045, RequiresUnreferencedCodeAttributeMismatch = 2046, + _unused_DynamicallyAccessedMembersMismatchBetweenOverrides = 2047, + XmlRemoveAttributeInstancesCanOnlyBeUsedOnType = 2048, + _unused_UnrecognizedInternalAttribute = 2049, CorrectnessOfCOMCannotBeGuaranteed = 2050, + XmlPropertyDoesNotContainAttributeName = 2051, + XmlCouldNotFindProperty = 2052, + _unused_XmlInvalidPropertyValueForProperty = 2053, + _unused_XmlInvalidArgumentForParameterOfType = 2054, MakeGenericType = 2055, + DynamicallyAccessedMembersOnPropertyConflictsWithBackingField = 2056, + UnrecognizedTypeNameInTypeGetType = 2057, + ParametersOfAssemblyCreateInstanceCannotBeAnalyzed = 2058, + UnrecognizedTypeInRuntimeHelpersRunClassConstructor = 2059, MakeGenericMethod = 2060, - RequiresOnBaseClass = 2109, - RequiresUnreferencedCodeOnStaticConstructor = 2116, + UnresolvedAssemblyInCreateInstance = 2061, + MethodParameterCannotBeStaticallyDetermined = 2062, + MethodReturnValueCannotBeStaticallyDetermined = 2063, + FieldValueCannotBeStaticallyDetermined = 2064, + ImplicitThisCannotBeStaticallyDetermined = 2065, + TypePassedToGenericParameterCannotBeStaticallyDetermined = 2066, // Dynamically Accessed Members attribute mismatch. - MakeGenericMethodCannotBeStaticallyAnalyzed = 2060, DynamicallyAccessedMembersMismatchParameterTargetsParameter = 2067, DynamicallyAccessedMembersMismatchParameterTargetsMethodReturnType = 2068, DynamicallyAccessedMembersMismatchParameterTargetsField = 2069, @@ -41,7 +147,32 @@ public enum DiagnosticId DynamicallyAccessedMembersMismatchTypeArgumentTargetsField = 2089, DynamicallyAccessedMembersMismatchTypeArgumentTargetsThisParameter = 2090, DynamicallyAccessedMembersMismatchTypeArgumentTargetsGenericParameter = 2091, + DynamicallyAccessedMembersMismatchOnMethodParameterBetweenOverrides = 2092, + DynamicallyAccessedMembersMismatchOnMethodReturnValueBetweenOverrides = 2093, + DynamicallyAccessedMembersMismatchOnImplicitThisBetweenOverrides = 2094, + DynamicallyAccessedMembersMismatchOnGenericParameterBetweenOverrides = 2095, + + CaseInsensitiveTypeGetTypeCallIsNotSupported = 2096, + DynamicallyAccessedMembersOnFieldCanOnlyApplyToTypesOrStrings = 2097, + DynamicallyAccessedMembersOnMethodParameterCanOnlyApplyToTypesOrStrings = 2098, + DynamicallyAccessedMembersOnPropertyCanOnlyApplyToTypesOrStrings = 2099, + XmlUnsuportedWildcard = 2100, + AssemblyWithEmbeddedXmlApplyToAnotherAssembly = 2101, + InvalidIsTrimmableValue = 2102, PropertyAccessorParameterInLinqExpressionsCannotBeStaticallyDetermined = 2103, + AssemblyProducedTrimWarnings = 2104, + TypeWasNotFoundInAssemblyNorBaseLibrary = 2105, + DynamicallyAccessedMembersOnMethodReturnValueCanOnlyApplyToTypesOrStrings = 2106, + MethodsAreAssociatedWithStateMachine = 2107, + InvalidScopeInUnconditionalSuppressMessage = 2108, + RequiresUnreferencedCodeOnBaseClass = 2109, + DynamicallyAccessedMembersFieldAccessedViaReflection = 2110, + DynamicallyAccessedMembersMethodAccessedViaReflection = 2111, + DynamicallyAccessedMembersOnTypeReferencesMemberWithRequiresUnreferencedCode = 2112, + DynamicallyAccessedMembersOnTypeReferencesMemberOnBaseWithRequiresUnreferencedCode = 2113, + DynamicallyAccessedMembersOnTypeReferencesMemberWithDynamicallyAccessedMembers = 2114, + DynamicallyAccessedMembersOnTypeReferencesMemberOnBaseWithDynamicallyAccessedMembers = 2115, + RequiresUnreferencedCodeOnStaticConstructor = 2116, // Single-file diagnostic ids. AvoidAssemblyLocationInSingleFile = 3000, @@ -62,5 +193,24 @@ public enum DiagnosticId public static class DiagnosticIdExtensions { public static string AsString(this DiagnosticId diagnosticId) => $"IL{(int)diagnosticId}"; + + public static string GetDiagnosticSubcategory(this DiagnosticId diagnosticId) => + (int)diagnosticId switch + { + 2026 => MessageSubCategory.TrimAnalysis, + 2032 => MessageSubCategory.TrimAnalysis, + 2041 => MessageSubCategory.TrimAnalysis, + 2042 => MessageSubCategory.TrimAnalysis, + 2043 => MessageSubCategory.TrimAnalysis, + 2045 => MessageSubCategory.TrimAnalysis, + 2046 => MessageSubCategory.TrimAnalysis, + 2050 => MessageSubCategory.TrimAnalysis, + var x when x >= 2055 && x <= 2099 => MessageSubCategory.TrimAnalysis, + 2103 => MessageSubCategory.TrimAnalysis, + 2106 => MessageSubCategory.TrimAnalysis, + 2107 => MessageSubCategory.TrimAnalysis, + var x when x >= 2109 && x <= 2116 => MessageSubCategory.TrimAnalysis, + _ => MessageSubCategory.None, + }; } } diff --git a/src/coreclr/tools/aot/ILLink.Shared/DiagnosticString.cs b/src/coreclr/tools/aot/ILLink.Shared/DiagnosticString.cs index 103b93ed28bb0..f14b58b060083 100644 --- a/src/coreclr/tools/aot/ILLink.Shared/DiagnosticString.cs +++ b/src/coreclr/tools/aot/ILLink.Shared/DiagnosticString.cs @@ -1,6 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; + namespace ILLink.Shared { public readonly struct DiagnosticString @@ -11,15 +13,15 @@ public readonly struct DiagnosticString public DiagnosticString(DiagnosticId diagnosticId) { var resourceManager = SharedStrings.ResourceManager; - _titleFormat = resourceManager.GetString($"{diagnosticId}Title") ?? string.Empty; - _messageFormat = resourceManager.GetString($"{diagnosticId}Message") ?? string.Empty; + _titleFormat = resourceManager.GetString($"{diagnosticId}Title") ?? throw new InvalidOperationException($"{diagnosticId} does not have a matching resource called {diagnosticId}Title"); + _messageFormat = resourceManager.GetString($"{diagnosticId}Message") ?? throw new InvalidOperationException($"{diagnosticId} does not have a matching resource called {diagnosticId}Message"); } public DiagnosticString(string diagnosticResourceStringName) { var resourceManager = SharedStrings.ResourceManager; - _titleFormat = resourceManager.GetString($"{diagnosticResourceStringName}Title") ?? string.Empty; - _messageFormat = resourceManager.GetString($"{diagnosticResourceStringName}Message") ?? string.Empty; + _titleFormat = resourceManager.GetString($"{diagnosticResourceStringName}Title") ?? throw new InvalidOperationException($"{diagnosticResourceStringName} does not have a matching resource called {diagnosticResourceStringName}Title"); + _messageFormat = resourceManager.GetString($"{diagnosticResourceStringName}Message") ?? throw new InvalidOperationException($"{diagnosticResourceStringName} does not have a matching resource called {diagnosticResourceStringName}Message"); } public string GetMessage(params string[] args) => diff --git a/src/coreclr/tools/aot/ILLink.Shared/ILLink.LinkAttributes.xsd b/src/coreclr/tools/aot/ILLink.Shared/ILLink.LinkAttributes.xsd new file mode 100644 index 0000000000000..f1156b0a4d690 --- /dev/null +++ b/src/coreclr/tools/aot/ILLink.Shared/ILLink.LinkAttributes.xsd @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/coreclr/tools/aot/ILLink.Shared/ILLink.Shared.projitems b/src/coreclr/tools/aot/ILLink.Shared/ILLink.Shared.projitems index 0a61390d8d025..ffbfab3b98417 100644 --- a/src/coreclr/tools/aot/ILLink.Shared/ILLink.Shared.projitems +++ b/src/coreclr/tools/aot/ILLink.Shared/ILLink.Shared.projitems @@ -13,6 +13,7 @@ + @@ -21,4 +22,9 @@ Designer - \ No newline at end of file + + + Designer + + + diff --git a/src/coreclr/tools/aot/ILLink.Shared/MessageSubCategory.cs b/src/coreclr/tools/aot/ILLink.Shared/MessageSubCategory.cs new file mode 100644 index 0000000000000..92c1077b14baf --- /dev/null +++ b/src/coreclr/tools/aot/ILLink.Shared/MessageSubCategory.cs @@ -0,0 +1,13 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace ILLink.Shared +{ + public static class MessageSubCategory + { + public const string None = ""; + public const string TrimAnalysis = "Trim analysis"; + public const string UnresolvedAssembly = "Unresolved assembly"; + public const string AotAnalysis = "AOT analysis"; + } +} diff --git a/src/coreclr/tools/aot/ILLink.Shared/README.md b/src/coreclr/tools/aot/ILLink.Shared/README.md new file mode 100644 index 0000000000000..229b67e492bf0 --- /dev/null +++ b/src/coreclr/tools/aot/ILLink.Shared/README.md @@ -0,0 +1 @@ +Sources taken from https://github.com/dotnet/linker/tree/890591b13da936d2c38a52afdaeac0db69858d4f/src/ILLink.Shared. diff --git a/src/coreclr/tools/aot/ILLink.Shared/SharedStrings.resx b/src/coreclr/tools/aot/ILLink.Shared/SharedStrings.resx index 0d53dff7e254e..e2db35e707331 100644 --- a/src/coreclr/tools/aot/ILLink.Shared/SharedStrings.resx +++ b/src/coreclr/tools/aot/ILLink.Shared/SharedStrings.resx @@ -53,7 +53,6 @@ value : The object must be serialized with : System.Runtime.Serialization.Formatters.Soap.SoapFormatter : and then encoded with base64 encoding. - mimetype: application/x-microsoft.net.object.bytearray.base64 value : The object must be serialized into a byte array : using a System.ComponentModel.TypeConverter @@ -117,12 +116,954 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + An Xml Feature does not specify a 'featurevalue' attribute. + + + Failed to process '{0}'. Feature '{1}' does not specify a 'featurevalue' attribute. + + + Feature definition has to be a boolean. + + + Failed to process '{0}'. Unsupported non-boolean feature definition '{1}'. + + + An exception was thrown while processing the xml file. + + + Error processing '{0}': {1}. + + + An error ocurred while processing a method in assembly. + + + Error processing method '{0}' in assembly '{1}'. + + + Cannot stub constructor of a type when base type does not have default constructor. Constructors of derived types marked for substitution require to have a default constructor in its base type. + + + Cannot stub constructor on '{0}' when base type does not have default constructor. + + + Could not find predefined type". + + + Missing predefined '{0}' type". + + + Could not find constructor. + + + Could not find constructor on '{0}'. + + + Assembly reference could not be resolved. + + + Assembly reference '{0}' could not be resolved. + + + Assembly cannot be loaded due to failure in processing the reference assembly. + + + Assembly '{0}' cannot be loaded due to failure in processing '{1}' reference + + + There was an error writing the linked assembly 'output'. + + + Failed to write '{0}'. + + + There was an unexpected error while trimming. An exception with more details is printed to the MSBuild log. Please share this stack trace with the IL Linker team to further investigate the cause and possible solution. + + + IL Trimmer has encountered an unexpected error. Please report the issue at https://github.com/dotnet/linker/issues + + + There was an error processing 'XML document location' xml file. The most likely reason for this is that the XML file has syntactical errors. + + + Error processing '{0}'. + + + Element in XML document contains a 'featuredefault' attribute with an invalid value. + + + Failed to process '{0}'. Unsupported value for featuredefault attribute. + + + The string passed to the command-line does not correspond to a valid command-line option. + + + Unrecognized command-line option: '{0}'. + + + The value given for the --warn argument was not a valid warning version. + + + Invalid warning version '{0}'. + + + Invalid value 'value' was used for command-line option '--generate-warning-suppressions'; must be 'cs' or 'xml'. + + + Invalid value '{0}' for '--generate-warning-suppressions' option. + + + The command-line option 'optionName' was specified but no argument was given. + + + Missing argument for '{0}' option. + + + The command-line option --custom-data receives a key-value pair using the format KEY=VALUE. + + + Value used with '--custom-data' has to be in the KEY=VALUE format. + + + No input files were specified. Use one of the resolver options. + + + No input files were specified. Use one of '{0}' options. + + + Options '--new-mvid' and '--deterministic' cannot be used at the same time. + + + Options '--new-mvid' and '--deterministic' cannot be used at the same time. + + + The assembly argument specified for '--custom-step' option could not be found. + + + The assembly '{0}' specified for '--custom-step' option could not be found. + + + The path to the assembly specified for '--custom-step' must be fully qualified. + + + The path to the assembly '{0}' specified for '--custom-step' must be fully qualified. + + + An invalid value was specified for '--custom-step' option. + + + Invalid value '{0}' specified for '--custom-step' option. + + + A custom step that is inserted relative to an existing step in the pipeline must specify whether to be added before (-) or after (+) the step it's relative to. + + + Expected '+' or '-' to control new step insertion. + + + A custom step was specified for insertion relative to a non existent step. + + + Pipeline step '{0}' could not be found. + + + The custom step could not be found in the given assembly. + + + Custom step '{0}' could not be found. + + + Custom step is incompatible with this trimmer version. + + + Custom step '{0}' is incompatible with this trimmer version. + + + The optimization 'text' is invalid. Optimization values can either be 'beforefieldinit', 'overrideremoval', 'unreachablebodies', 'unusedinterfaces', 'ipconstprop', or 'sealer'. + + + Invalid optimization value '{0}'. + + + Invalid argument for 'token' option. + + + Invalid argument for '{0}' option. + + + Invalid assembly action. + + + Invalid assembly action '{0}'. + + + Root assembly could not be found. + + + Root assembly '{0}' could not be found. + + + XML descriptor file could not be found'. + + + XML descriptor file '{0}' could not be found'. + + + Root assembly does not have entry point. + + + Root assembly '{0}' does not have entry point. + + + Referenced root assembly cannot use the specified action. + + + Root assembly '{0}' cannot use action '{1}'. + + + Invalid assembly name. + + + Invalid assembly name '{0}'. + + + Invalid assembly root mode. + + + Invalid assembly root mode '{0}'. + + + Exported type cannot be resolved. + + + Exported type '{0}' cannot be resolved. + + + A reference assembly input passed via -reference could not be loaded. + + + Reference assembly '{0}' could not be loaded. + + + Metadata element cannot be resolved. This usually means there is a version mismatch between dependencies. + + + {0}. + + + Field element cannot be resolved. This usually means there is a version mismatch between dependencies. + + + Field '{0}' reference could not be resolved. + + + Method element cannot be resolved. This usually means there is a version mismatch between dependencies. + + + Method '{0}' reference could not be resolved. + + + Type element cannot be resolved. This usually means there is a version mismatch between dependencies. + + + Type '{0}' reference could not be resolved. + + + The type name used to define custom attribute value could not be resolved. + + + The type '{0}' used with attribute value '{1}' could not be found. + + + The 'value' specified for the custom attribute value cannot be converted to specified argument type 'typeName'. + + + Cannot convert value '{0}' to type '{1}'. + + + The syntax for custom attribute value for 'type' requires to also specify the underlying attribute type. + + + Custom attribute argument for '{0}' requires nested '{1}' node. + + + The value specified for the custom attribute of System.Type type could not be resolved. + + + Could not resolve custom attribute type value '{0}'. + + + The type name used with attribute type is not one of the supported types. + + + Unexpected attribute argument type '{0}'. + + + Invalid metadata value. + + + Invalid metadata value '{0}'. + + + The XML descriptor preserves fields on type, but this type has no fields. + + + Type '{0}' has no fields to preserve. + + + The XML descriptor preserves methods on type, but this type has no methods. + + + Type '{0}' has no methods to preserve. + + + The assembly in PreserveDependency attribute could not be resolved. + + + Could not resolve dependency assembly '{0}' specified in a 'PreserveDependency' attribute. + + + The type in PreserveDependency attribute could not be resolved. + + + Could not resolve dependency type '{0}' specified in a 'PreserveDependency' attribute. + + + The member in PreserveDependency attribute could not be resolved. + + + Could not resolve dependency member '{0}' declared in type '{1}' specified in a 'PreserveDependency' attribute. + + + The assembly in the XML could not be resolved. + + + Could not resolve assembly '{0}'. + + + The type in the XML could not be resolved. + + + Could not resolve type '{0}'. + + + The XML defined a method on a type, but the method was not found. + + + Could not find method '{0}' on type '{1}'. + + + Invalid value for 'signature' stub in the substitution XML. + + + Invalid value for '{0}' stub. + + + The value of the body attribute used in the substitution XML is invalid (the only supported options are remove and stub). + + + Unknown body modification '{0}' for '{1}'. + + + The XML defined a field on a type, but the field was not found. + + + Could not find field '{0}' on type '{1}'. + + + The substituted field 'field' was non-static or constant. Only static non-constant fields are supported. + + + Substituted field '{0}' needs to be static field. + + + A field was specified for substitution but no value to be substituted was given. + + + Missing 'value' attribute for field '{0}'. + + + The value used in the substitution XML for field is not a built-in type, or does not match the type of the field. + + + Invalid value '{0}' for '{1}'. + + + The XML defined a event on a type, but the event was not found. + + + Could not find event '{0}' on type '{1}'. + + + The XML defined a property on a type, but the property was not found. + + + Could not find property '{0}' on type '{1}'. + + + The XML defined the get accessor of property on a type, but the accessor was not found. + + + Could not find the get accessor of property '{0}' on type '{1}'. + + + The XML defined the set accessor of property on a type, but the accessor was not found. + + + Could not find the set accessor of property '{0}' in type '{1}'. + + + The XML attribute arguments use values or types which don't match to any constructor + + + Could not find matching constructor for custom attribute '{0}' arguments. + + + Method 'method' has more than one return element specified. There can only be one return element. + + + There is more than one 'return' child element specified for method '{0}'. + + + Method has more than one parameter for the XML element 'parameter'. There can only be one value specified for each parameter. + + + More than one value specified for parameter '{0}' of method '{1}'. + + + The XML descriptor marks for preservation the member more than once. + + + Duplicate preserve of '{0}'. + Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code Using member '{0}' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code.{1}{2} + + Using dynamic types might cause types or members to be removed by trimmer. + + + Invoking members on dynamic types is not trimming-compatible. Types or members might have been removed by the trimmer. + + + The linker found multiple instances of attribute on a member. This attribute is only allowed to have one instance. + + + Attribute '{0}' should only be used once on '{1} + + + Attribute doesn't have the required number of parameters specified. + + + Attribute '{0}' doesn't have the required number of parameters specified. + + + 'attribute' element does not contain attribute 'fullname' or it's empty. + + + 'attribute' element does not contain attribute 'fullname' or it's empty. + + + The assembly name specified for attribute could not be resolved. + + + Could not resolve assembly '{0}' for attribute '{1}'. + + + The described attribute type could not be found in the assemblies. + + + Attribute type '{0}' could not be found. + + + The value passed as the assembly name or type name to the CreateInstance method can't be statically analyzed. + + + Unrecognized value passed to the parameter '{0}' of method '{1}'. It's not possible to guarantee the availability of the target type. + + + 'PreserveDependencyAttribute' is deprecated. Use 'DynamicDependencyAttribute' instead. + + + 'PreserveDependencyAttribute' is deprecated. Use 'DynamicDependencyAttribute' instead. + + + The input contains an invalid use of DynamicDependencyAttribute. + + + The 'DynamicDependencyAttribute' could not be analyzed. + + + The assembly string given in a DynamicDependencyAttribute constructor could not be resolved. + + + Unresolved assembly '{0}' in 'DynamicDependencyAttribute'. + + + The type in a DynamicDependencyAttribute constructor could not be resolved. + + + Unresolved type '{0}' in 'DynamicDependencyAttribute'. + + + The member signature or DynamicallyAccessedMemberTypes in a DynamicDependencyAttribute constructor did not resolve to any members on the type. + + + No members were resolved for '{0}'. + + + The resource element in a substitution file did not have a 'name' attribute. + + + Missing 'name' attribute for resource. + + + The resource element in a substitution file did not have a valid 'action' attribute. + + + Invalid value '{0}' for attribute 'action' for resource '{1}'. + + + The resource name in a substitution file could not be found in the specified assembly. + + + Could not find embedded resource '{0}' to remove in assembly '{1}'. + + + The 'DynamicallyAccessedMembersAttribute' is not allowed on methods. It is allowed on method return value or method parameters. + + + The 'DynamicallyAccessedMembersAttribute' is not allowed on methods. It is allowed on method return value or method parameters though. + + + Could not find a unique backing field for property to propagate 'DynamicallyAccessedMembersAttribute'. + + + Could not find a unique backing field for property '{0}' to propagate 'DynamicallyAccessedMembersAttribute'. + + + 'DynamicallyAccessedMembersAttribute' on property conflicts with the same attribute on its accessor. + + + 'DynamicallyAccessedMembersAttribute' on property '{0}' conflicts with the same attribute on its accessor '{1}'. + + + The XML descriptor specifies a namespace but there are no types found in such namespace. + + + Could not find any type in namespace '{0}'. + + + An attribute is being referenced in the code but the attribute instances have been removed using the 'RemoveAttributeInstances' internal attribute. + + + Attribute '{0}' is being referenced in code but the trimmer was instructed to remove all instances of this attribute. If the attribute instances are necessary make sure to either remove the trimmer attribute XML portion which removes the attribute instances, or override the removal by using the trimmer XML descriptor to keep the attribute type (which in turn keeps all of its instances). + + + 'RequiresUnreferencedCodeAttribute' annotations must match across all interface implementations or overrides. + + + {0}. 'RequiresUnreferencedCodeAttribute' annotations must match across all interface implementations or overrides. + + + Internal attribute 'RemoveAttributeInstances' can only be used on attribute types. + + + Internal attribute '{0}' can only be used on attribute types. + + + Correctness of COM interop cannot be guaranteed after trimming. Interfaces and interface members might be removed. + + + P/invoke method '{0}' declares a parameter with COM marshalling. Correctness of COM interop cannot be guaranteed after trimming. Interfaces and interface members might be removed. + + + An attribute element has property but this could not be found. + + + Property element does not contain attribute 'name'. + + + An attribute element has property but this could not be found. + + + Property '{0}' could not be found. + + + Either the type on which the MakeGenericType is called can't be statically determined, or the type parameters to be used for generic arguments can't be statically determined. + + + Call to '{0}' can not be statically analyzed. It's not possible to guarantee the availability of requirements of the generic type. + + + 'DynamicallyAccessedMemberAttribute' on property conflicts with the same attribute on its backing field. + + + 'DynamicallyAccessedMemberAttribute' on property '{0}' conflicts with the same attribute on its backing field '{1}'. + + + Unrecognized value passed to the parameter of method. It's not possible to guarantee the availability of the target type. + + + Unrecognized value passed to the parameter 'typeName' of method '{0}'. It's not possible to guarantee the availability of the target type. + + + Parameters passed to method cannot be analyzed. Consider using methods 'System.Type.GetType' and `System.Activator.CreateInstance` instead. + + + Parameters passed to method '{0}' cannot be analyzed. Consider using methods 'System.Type.GetType' and `System.Activator.CreateInstance` instead. + + + The type passed to the RunClassConstructor is not statically known, Trimmer can't make sure that its static constructor is available. + + + Unrecognized value passed to the parameter 'type' of method '{0}'. It's not possible to guarantee the availability of the target static constructor. + + + Call to 'System.Reflection.MethodInfo.MakeGenericMethod' can not be statically analyzed. It's not possible to guarantee the availability of requirements of the generic method. + + + Call to '{0}' can not be statically analyzed. It's not possible to guarantee the availability of requirements of the generic method. + + + Calling CreateInstance with assembly name which can't be resolved. + + + The assembly name '{0}' passed to method '{1}' references assembly which is not available. + + + The parameter of method has a DynamicallyAccessedMembersAttribute, but the value passed to it can not be statically analyzed. + + + Value passed to parameter '{0}' of method '{1}' can not be statically determined and may not meet 'DynamicallyAccessedMembersAttribute' requirements. + + + The return value of method has a DynamicallyAccessedMembersAttribute, but the value returned from the method can not be statically analyzed. + + + Value returned from method '{0}' can not be statically determined and may not meet 'DynamicallyAccessedMembersAttribute' requirements. + + + The field has a DynamicallyAccessedMembersAttribute, but the value assigned to it can not be statically analyzed. + + + Value assigned to {0} can not be statically determined and may not meet 'DynamicallyAccessedMembersAttribute' requirements. + + + The method has a DynamicallyAccessedMembersAttribute (which applies to the implicit 'this' parameter), but the value used for the 'this' parameter can not be statically analyzed. + + + Value passed to implicit 'this' parameter of method '{0}' can not be statically determined and may not meet 'DynamicallyAccessedMembersAttribute' requirements. + + + The generic parameter of type or method has a DynamicallyAccessedMembersAttribute, but the value used for it can not be statically analyzed. + + + Type passed to generic parameter '{0}' of '{1}' can not be statically determined and may not meet 'DynamicallyAccessedMembersAttribute' requirements. + + + Target parameter argument does not satisfy 'DynamicallyAccessedMembersAttribute' in call to target method. The parameter of method does not have matching annotations. + + + '{0}' argument does not satisfy {4} in call to '{1}'. The parameter '{2}' of method '{3}' 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. + + + Target method return value does not satisfy 'DynamicallyAccessedMembersAttribute' requirements. The parameter of method does not have matching annotations. + + + '{0}' method return value does not satisfy {3} requirements. The parameter '{1}' of method '{2}' 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. + + + Value stored in field does not satisfy 'DynamicallyAccessedMembersAttribute' requirements. The parameter of method does not have matching annotations. + + + value stored in field '{0}' does not satisfy {3} requirements. The parameter '{1}' of method '{2}' 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. + + + 'this' argument does not satisfy 'DynamicallyAccessedMembersAttribute' in call to target method. The parameter of method does not have matching annotations. + + + 'this' argument does not satisfy {3} in call to '{0}'. The parameter '{1}' of method '{2}' 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. + + + Generic argument does not satisfy 'DynamicallyAccessedMembersAttribute' in target method or type. The parameter of method does not have matching annotations. + + + '{0}' generic argument does not satisfy {4} in '{1}'. The parameter '{2}' of method '{3}' 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. + + + Target parameter argument does not satisfy 'DynamicallyAccessedMembersAttribute' in call to target method. The return value of the source method does not have matching annotations. + + + '{0}' argument does not satisfy {3} in call to '{1}'. The return value of method '{2}' 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. + + + Target method return value does not satisfy 'DynamicallyAccessedMembersAttribute' requirements. The return value of the source method does not have matching annotations. + + + '{0}' method return value does not satisfy {2} requirements. The return value of method '{1}' 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. + + + Value stored in field does not satisfy 'DynamicallyAccessedMembersAttribute' requirements. The return value of the source method does not have matching annotations. + + + value stored in field '{0}' does not satisfy {2} requirements. The return value of method '{1}' 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. + + + 'this' argument does not satisfy 'DynamicallyAccessedMembersAttribute' in call to target method. The return value of the source method does not have matching annotations. + + + 'this' argument does not satisfy {2} in call to '{0}'. The return value of method '{1}' 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. + + + Target generic argument does not satisfy 'DynamicallyAccessedMembersAttribute' in target method or type. The return value of the source method 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. + + + '{0}' generic argument does not satisfy {3} in '{1}'. The return value of method '{2}' 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. + + + Target parameter argument does not satisfy 'DynamicallyAccessedMembersAttribute' in call to target method. The source field does not have matching annotations. + + + '{0}' argument does not satisfy {3} in call to '{1}'. The field '{2}' 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. + + + Target method return value does not satisfy 'DynamicallyAccessedMembersAttribute' requirements. The source field does not have matching annotations. + + + '{0}' method return value does not satisfy {2} requirements. The field '{1}' 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. + + + Value stored in target field does not satisfy 'DynamicallyAccessedMembersAttribute' requirements. The source field does not have matching annotations. + + + value stored in field '{0}' does not satisfy {2} requirements. The field '{1}' 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. + + + 'this' argument does not satisfy 'DynamicallyAccessedMembersAttribute' in call to target method. The source field does not have matching annotations. + + + 'this' argument does not satisfy {2} in call to '{0}'. The field '{1}' 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. + + + Target generic argument does not satisfy 'DynamicallyAccessedMembersAttribute' in target method or type. The source field does not have matching annotations. + + + '{0}' generic argument does not satisfy {3} in '{1}'. The field '{2}' 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. + + + Target parameter argument does not satisfy 'DynamicallyAccessedMembersAttribute' in call to target method. The implicit 'this' argument of source method does not have matching annotations. + + + '{0}' argument does not satisfy {3} in call to '{1}'. The implicit 'this' argument of method '{2}' 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. + + + Target method return value does not satisfy 'DynamicallyAccessedMembersAttribute' requirements. The implicit 'this' argument of source method does not have matching annotations. + + + '{0}' method return value does not satisfy {2} requirements. The implicit 'this' argument of method '{1}' 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. + + + Value stored in target field does not satisfy 'DynamicallyAccessedMembersAttribute' requirements. The implicit 'this' argument of source method does not have matching annotations. + + + value stored in field '{0}' does not satisfy {2} requirements. The implicit 'this' argument of method '{1}' 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. + + + 'this' argument does not satisfy 'DynamicallyAccessedMembersAttribute' in call to target method. The implicit 'this' argument of source method does not have matching annotations. + + + 'this' argument does not satisfy {2} in call to '{0}'. The implicit 'this' argument of method '{1}' 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. + + + Target generic argument does not satisfy 'DynamicallyAccessedMembersAttribute' in target method or type. The implicit 'this' argument of source method does not have matching annotations. + + + '{0}' generic argument does not satisfy {3} in '{1}'. The implicit 'this' argument of method '{2}' 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. + + + Target parameter argument does not satisfy 'DynamicallyAccessedMembersAttribute' in call to target method. The generic parameter of the source method or type does not have matching annotations. + + + '{0}' argument does not satisfy {4} in call to '{1}'. The generic parameter '{2}' of '{3}' 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. + + + Target method return value does not satisfy 'DynamicallyAccessedMembersAttribute' requirements. The generic parameter of the source method or type does not have matching annotations. + + + '{0}' method return value does not satisfy {3} requirements. The generic parameter '{1}' of '{2}' 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. + + + Value stored in target field does not satisfy 'DynamicallyAccessedMembersAttribute' requirements. The generic parameter of the source method or type does not have matching annotations. + + + value stored in field '{0}' does not satisfy {3} requirements. The generic parameter '{1}' of '{2}' 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. + + + 'this' argument does not satisfy 'DynamicallyAccessedMembersAttribute' in call to target method. The generic parameter of the source method or type does not have matching annotations. + + + 'this' argument does not satisfy {3} in call to '{0}'. The generic parameter '{1}' of '{2}' 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. + + + Target generic argument does not satisfy 'DynamicallyAccessedMembersAttribute' in target method or type. The generic parameter of the source method or type does not have matching annotations. + + + '{0}' generic argument does not satisfy {4} in '{1}'. The generic parameter '{2}' of '{3}' 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. + + + 'DynamicallyAccessedMemberTypes' on the parameter of method don't match overridden parameter of method. All overridden members must have the same 'DynamicallyAccessedMembersAttribute' usage. + + + 'DynamicallyAccessedMemberTypes' in 'DynamicallyAccessedMembersAttribute' on the parameter '{0}' of method '{1}' don't match overridden parameter '{2}' of method '{3}'. All overridden members must have the same 'DynamicallyAccessedMembersAttribute' usage. + + + 'DynamicallyAccessedMemberTypes' on the return value of method don't match overridden return value of method. All overridden members must have the same 'DynamicallyAccessedMembersAttribute' usage. + + + 'DynamicallyAccessedMemberTypes' in 'DynamicallyAccessedMembersAttribute' on the return value of method '{0}' don't match overridden return value of method '{1}'. All overridden members must have the same 'DynamicallyAccessedMembersAttribute' usage. + + + 'DynamicallyAccessedMemberTypes' on the implicit 'this' parameter of method don't match overridden implicit 'this' parameter of method. All overridden members must have the same 'DynamicallyAccessedMembersAttribute' usage. + + + 'DynamicallyAccessedMemberTypes' in 'DynamicallyAccessedMembersAttribute' on the implicit 'this' parameter of method '{0}' don't match overridden implicit 'this' parameter of method '{1}'. All overridden members must have the same 'DynamicallyAccessedMembersAttribute' usage. + + + 'DynamicallyAccessedMemberTypes' on the generic parameter of method or type don't match overridden generic parameter method or type. All overridden members must have the same 'DynamicallyAccessedMembersAttribute' usage. + + + 'DynamicallyAccessedMemberTypes' in 'DynamicallyAccessedMembersAttribute' on the generic parameter '{0}' of '{1}' don't match overridden generic parameter '{2}' of '{3}'. All overridden members must have the same 'DynamicallyAccessedMembersAttribute' usage. + + + Call to 'Type.GetType' method can perform case insensitive lookup of the type, currently ILLink can not guarantee presence of all the matching types. + + + Call to '{0}' can perform case insensitive lookup of the type, currently ILLink can not guarantee presence of all the matching types. + + + Field has 'DynamicallyAccessedMembersAttribute', but that attribute can only be applied to fields of type 'System.Type' or 'System.String'. + + + Field '{0}' has 'DynamicallyAccessedMembersAttribute', but that attribute can only be applied to fields of type 'System.Type' or 'System.String'. + + + Parameter of method has 'DynamicallyAccessedMembersAttribute', but that attribute can only be applied to parameters of type 'System.Type' or 'System.String'. + + + Parameter '{0}' of method '{1}' has 'DynamicallyAccessedMembersAttribute', but that attribute can only be applied to parameters of type 'System.Type' or 'System.String'. + + + Property has 'DynamicallyAccessedMembersAttribute', but that attribute can only be applied to properties of type 'System.Type' or 'System.String'. + + + Property '{0}' has 'DynamicallyAccessedMembersAttribute', but that attribute can only be applied to properties of type 'System.Type' or 'System.String'. + + + XML contains unsupported wildcard for assembly 'fullname' attribute. + + + XML contains unsupported wildcard for assembly 'fullname' attribute. + + + Embedded XML in assembly contains assembly "fullname" attribute for another assembly + + + Embedded XML in assembly '{0}' contains assembly "fullname" attribute for another assembly '{1}' + + + Invalid AssemblyMetadata 'IsTrimmable' attribute in assembly. Value must be "True". + + + Invalid AssemblyMetadata("IsTrimmable", "{0}") attribute in assembly '{1}'. Value must be "True". + + + Value passed to the parameter of method cannot be statically determined as a property accessor. + + + Value passed to the '{0}' parameter of method '{1}' cannot be statically determined as a property accessor. + + + Assembly produced trim warnings. + + + Assembly '{0}' produced trim warnings. For more information see https://aka.ms/dotnet-illink/libraries + + + Type was not found in the caller assembly nor in the base library. Type name strings used for dynamically accessing a type should be assembly qualified. + + + Type '{0}' was not found in the caller assembly nor in the base library. Type name strings used for dynamically accessing a type should be assembly qualified. + + + Return type of method has 'DynamicallyAccessedMembersAttribute', but that attribute can only be applied to properties of type 'System.Type' or 'System.String'. + + + Return type of method '{0}' has 'DynamicallyAccessedMembersAttribute', but that attribute can only be applied to properties of type 'System.Type' or 'System.String'. + + + Trimmer currently can't correctly handle if the same compiler generated state machine type is associated (via the state machine attributes) with two different methods. + + + Methods '{0}' and '{1}' are both associated with state machine type '{2}'. This is currently unsupported and may lead to incorrectly reported warnings. + + + Invalid scope used in 'UnconditionalSuppressMessageAttribute'. The only scopes supported on global unconditional suppressions are 'module', 'type' and 'member'. + + + Invalid scope '{0}' used in 'UnconditionalSuppressMessageAttribute' on module '{1}' with target '{2}'. + + + Types that derive from a base class with 'RequiresUnreferencedCodeAttribute' need to explicitly use the 'RequiresUnreferencedCodeAttribute' or suppress this warning + + + Type '{0}' derives from '{1}' which has 'RequiresUnreferencedCodeAttribute'. {2}{3} + + + Field with 'DynamicallyAccessedMembersAttribute' is accessed via reflection. Trimmer can't guarantee availability of the requirements of the field. + + + Field '{0}' with 'DynamicallyAccessedMembersAttribute' is accessed via reflection. Trimmer can't guarantee availability of the requirements of the field. + + + Method with parameters or return value with `DynamicallyAccessedMembersAttribute` is accessed via reflection. Trimmer can't guarantee availability of the requirements of the method. + + + Method '{0}' with parameters or return value with `DynamicallyAccessedMembersAttribute` is accessed via reflection. Trimmer can't guarantee availability of the requirements of the method. + + + 'DynamicallyAccessedMembersAttribute' on a type or one of its base types references a member which requires unreferenced code. + + + 'DynamicallyAccessedMembersAttribute' on '{0}' or one of its base types references '{1}' which requires unreferenced code.{2}{3} + + + 'DynamicallyAccessedMembersAttribute' on a type or one of its base types references a member which requires unreferenced code. + + + 'DynamicallyAccessedMembersAttribute' on '{0}' or one of its base types references '{1}' which requires unreferenced code.{2}{3} + + + 'DynamicallyAccessedMembersAttribute' on a type or one of its base types references a member which has 'DynamicallyAccessedMembersAttribute' requirements. + + + 'DynamicallyAccessedMembersAttribute' on '{0}' or one of its base types references '{1}' which has 'DynamicallyAccessedMembersAttribute' requirements. + + + 'DynamicallyAccessedMembersAttribute' on a type or one of its base types references a member which has 'DynamicallyAccessedMembersAttribute' requirements. + + + 'DynamicallyAccessedMembersAttribute' on '{0}' or one of its base types references '{1}' which has 'DynamicallyAccessedMembersAttribute' requirements. + + + The use of 'RequiresUnreferencedCodeAttribute' on static constructors is disallowed since is a method not callable by the user, is only called by the runtime. Placing the attribute directly on the static constructor will have no effect, instead use 'RequiresUnreferencedCodeAttribute' on the type which will handle warning and silencing from the static constructor. + + + 'RequiresUnreferencedCodeAttribute' cannot be placed directly on static constructor '{0}', consider placing 'RequiresUnreferencedCodeAttribute' on the type declaration instead. + Avoid accessing Assembly file path when publishing as a single file @@ -141,29 +1082,23 @@ Using member '{0}' which has 'RequiresAssemblyFilesAttribute' can break functionality when embedded in a single-file app.{1}{2} + + 'RequiresAssemblyFilesAttribute' annotations must match across all interface implementations or overrides. + + + {0}. 'RequiresAssemblyFilesAttribute' annotations must match across all interface implementations or overrides. + Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling. Using member '{0}' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling.{1}{2} - - {0}. 'RequiresUnreferencedCodeAttribute' annotations must match across all interface implementations or overrides. - - - 'RequiresUnreferencedCodeAttribute' annotations must match across all interface implementations or overrides. - - - {0}. 'RequiresDynamicCodeAttribute' annotations must match across all interface implementations or overrides. - 'RequiresDynamicCodeAttribute' annotations must match across all interface implementations or overrides. - - {0}. 'RequiresAssemblyFilesAttribute' annotations must match across all interface implementations or overrides. - - - 'RequiresAssemblyFilesAttribute' annotations must match across all interface implementations or overrides. + + {0}. 'RequiresDynamicCodeAttribute' annotations must match across all interface implementations or overrides. Base member '{2}' with '{0}' has a derived member '{1}' without '{0}' @@ -177,38 +1112,8 @@ Interface member '{2}' with '{0}' has an implementation member '{1}' without '{0}' - - Type '{0}' derives from '{1}' which has 'RequiresUnreferencedCodeAttribute'. {2}{3} - - - Types that derive from a base class with 'RequiresUnreferencedCodeAttribute' need to explicitly use the 'RequiresUnreferencedCodeAttribute' or suppress this warning - - - Invoking members on dynamic types is not trimming-compatible. Types or members might have been removed by the trimmer. - - - Using dynamic types might cause types or members to be removed by trimmer. - - - Call to '{0}' can not be statically analyzed. It's not possible to guarantee the availability of requirements of the generic method. - - - Call to '{0}' can not be statically analyzed. It's not possible to guarantee the availability of requirements of the generic type. - - - 'RequiresUnreferencedCodeAttribute' cannot be placed directly on static constructor '{0}', consider placing 'RequiresUnreferencedCodeAttribute' on the type declaration instead. - - - The use of 'RequiresUnreferencedCodeAttribute' on static constructors is disallowed since is a method not callable by the user, is only called by the runtime. Placing the attribute directly on the static constructor will have no effect, instead use 'RequiresUnreferencedCodeAttribute' on the type which will handle warning and silencing from the static constructor. - - - Call to '{0}' can not be statically analyzed. It's not possible to guarantee the availability of requirements of the generic method. - - - Value passed to the '{0}' parameter of method '{1}' cannot be statically determined as a property accessor. - - - P/invoke method '{0}' declares a parameter with COM marshalling. Correctness of COM interop cannot be guaranteed after trimming. Interfaces and interface members might be removed. + + P/invoke method declares a parameter with an abstract delegate. Correctness of interop for abstract delegates cannot be guaranteed after native compilation. P/invoke method '{0}' declares a parameter with an abstract delegate. Correctness of interop for abstract delegates cannot be guaranteed after native compilation: the marshalling code for the delegate might not be available. Use a non-abstract delegate type or ensure any delegate instance passed as parameter is marked with `UnmanagedFunctionPointerAttribute`.