У меня есть приложение winui3/winappsdk, созданное с .net 9. Я хочу включить нативные AOT и обрезку для него, но я получаю несколько предупреждений для одного пакета Nuget, который я использую, DataGrid.
< P> у меня есть это в моем файле csproj. Полная версия и исходный код, доступный здесь < /p>
true
partial
false
false
< /code>
и я определил имена сборки в этом файле XML, такие как этот < /p>
< /code>
Но это не рутирует сборы, чтобы они не были обрезаны. Я использовал синтаксис, определенный здесь. Я пробовал много комбинаций, но ни один из них не работает. Что я здесь делаю не так? Как мы должны использовать корневые дескрипторы? < /P>
Вот некоторые предупреждения < /p>
1>/_/CommunityToolkit.WinUI.UI.Controls.DataGrid/Utilities/TypeHelper.cs(37): Trim analysis error IL2070: CommunityToolkit.WinUI.Utilities.TypeHelper.FindGenericType(Type,Type): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.Interfaces' in call to 'System.Reflection.TypeInfo.ImplementedInterfaces.get'. The parameter 'type' of method 'CommunityToolkit.WinUI.Utilities.TypeHelper.FindGenericType(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.
1>/_/CommunityToolkit.WinUI.UI.Controls.DataGrid/Utilities/TypeHelper.cs(268): Trim analysis error IL2070: CommunityToolkit.WinUI.Utilities.TypeHelper.GetPropertyOrIndexer(Type,String,Object[]&): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties' in call to 'System.Type.GetProperty(String)'. The parameter 'type' of method 'CommunityToolkit.WinUI.Utilities.TypeHelper.GetPropertyOrIndexer(Type,String,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.
1>/_/CommunityToolkit.WinUI.UI.Controls.DataGrid/Utilities/TypeHelper.cs(278): Trim analysis error IL2070: CommunityToolkit.WinUI.Utilities.TypeHelper.GetPropertyOrIndexer(Type,String,Object[]&): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicConstructors', 'DynamicallyAccessedMemberTypes.PublicMethods', 'DynamicallyAccessedMemberTypes.PublicFields', 'DynamicallyAccessedMemberTypes.PublicNestedTypes', 'DynamicallyAccessedMemberTypes.PublicProperties', 'DynamicallyAccessedMemberTypes.PublicEvents' in call to 'System.Type.GetDefaultMembers()'. The parameter 'type' of method 'CommunityToolkit.WinUI.Utilities.TypeHelper.GetPropertyOrIndexer(Type,String,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.
1>/_/CommunityToolkit.WinUI.UI.Controls.DataGrid/Utilities/TypeHelper.cs(378): Trim analysis error IL2075: CommunityToolkit.WinUI.Utilities.TypeHelper.SetNestedPropertyValue(Object&,Object,String): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties' in call to 'System.Type.GetProperty(String)'. 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.
1>/_/CommunityToolkit.WinUI.UI.Controls.DataGrid/Utilities/TypeHelper.cs(389): Trim analysis error IL2075: CommunityToolkit.WinUI.Utilities.TypeHelper.SetNestedPropertyValue(Object&,Object,String): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties' in call to 'System.Type.GetProperty(String)'. 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.
1>/_/CommunityToolkit.WinUI.UI.Controls.DataGrid/DataGrid/DataGrid.cs(8960): Trim analysis error IL2026: CommunityToolkit.WinUI.UI.Controls.DataGrid.ValidateEditingRow(Boolean,Boolean): Using member 'System.ComponentModel.DataAnnotations.ValidationContext.ValidationContext(Object,IServiceProvider,IDictionary`2)' 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.
1>/_/CommunityToolkit.WinUI.UI.Controls.DataGrid/DataGrid/DataGrid.cs(8961): Trim analysis error IL2026: CommunityToolkit.WinUI.UI.Controls.DataGrid.ValidateEditingRow(Boolean,Boolean): Using member 'System.ComponentModel.DataAnnotations.Validator.TryValidateObject(Object,ValidationContext,ICollection`1,Boolean)' 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.
1>/_/CommunityToolkit.WinUI.UI.Controls.DataGrid/DataGrid/DataGridComboBoxColumn.cs(617): Trim analysis error IL2075: CommunityToolkit.WinUI.UI.Controls.DataGridComboBoxColumn.GetDisplayValue(Object): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties' in call to 'System.Type.GetProperty(String)'. 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.
1>/_/CommunityToolkit.WinUI.UI.Controls.DataGrid/DataGrid/DataGridComboBoxColumn.cs(665): Trim analysis error IL2075: CommunityToolkit.WinUI.UI.Controls.DataGridComboBoxColumn.EnsureDisplayMemberPathExists(): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties' in call to 'System.Type.GetProperties()'. The return value of method 'CommunityToolkit.WinUI.UI.Utilities.Extensions.GetItemType(IEnumerable)' 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.
1>/_/CommunityToolkit.WinUI.UI.Controls.DataGrid/DataGrid/DataGridComboBoxColumn.cs(678): Trim analysis error IL2075: CommunityToolkit.WinUI.UI.Controls.DataGridComboBoxColumn.EnsureItemsSourceBinding(): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties' in call to 'System.Type.GetProperties()'. 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.
1>/_/CommunityToolkit.WinUI.UI.Controls.DataGrid/obj/Release/net5.0-windows10.0.18362.0/XamlTypeInfo.g.cs(2289): Trim analysis error IL2059: CommunityToolkit.WinUI.UI.Controls.CommunityToolkit_WinUI_UI_Controls_DataGrid_XamlTypeInfo.XamlUserType.RunInitializer(): Unrecognized value passed to the parameter 'type' of method 'System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(RuntimeTypeHandle)'. It's not possible to guarantee the availability of the target static constructor.
1>/_/CommunityToolkit.WinUI.UI.Controls.DataGrid/DataGrid/DataGridDataConnection.cs(1023): Trim analysis error IL2075: CommunityToolkit.WinUI.UI.Controls.DataGridInternals.DataGridDataConnection.UpdateDataProperties(): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties' in call to 'System.Type.GetProperties(BindingFlags)'. The return value of method 'CommunityToolkit.WinUI.UI.Controls.DataGridInternals.DataGridDataConnection.DataType.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.
1>/_/CommunityToolkit.WinUI.UI.Controls.DataGrid/CollectionViews/CollectionView.cs(890): Trim analysis error IL2075: CommunityToolkit.WinUI.UI.Data.Utilities.CollectionView.GetItemType(Boolean): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.Interfaces' in call to 'System.Type.GetInterfaces()'. 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.
1>/_/CommunityToolkit.WinUI.UI.Controls.DataGrid/Utilities/ValidationUtil.cs(225): Trim analysis error IL2075: CommunityToolkit.WinUI.UI.Data.Utilities.ValidationUtil.GetDependencyProperties(FrameworkElement,Boolean): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicFields' in call to 'System.Type.GetFields(BindingFlags)'. 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.
1>/_/CommunityToolkit.WinUI.UI.Controls.DataGrid/DataGrid/DataGridComboBoxColumn.cs(276): Trim analysis error IL2075: CommunityToolkit.WinUI.UI.Controls.DataGridComboBoxColumn.c__DisplayClass41_0.b__0(Object,SelectionChangedEventArgs): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties' in call to 'System.Type.GetProperty(String)'. 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.
Подробнее здесь: https://stackoverflow.com/questions/792 ... ion-in-net
Как использовать опцию обрезки корневых дескрипторов в .net? ⇐ C#
Место общения программистов C#
-
Anonymous
1739528800
Anonymous
У меня есть приложение winui3/winappsdk, созданное с .net 9. Я хочу включить нативные AOT и обрезку для него, но я получаю несколько предупреждений для одного пакета Nuget, который я использую, DataGrid.
< P> у меня есть это в моем файле csproj. Полная версия и исходный код, доступный здесь < /p>
true
partial
false
false
< /code>
и я определил имена сборки в этом файле XML, такие как этот < /p>
< /code>
Но это не рутирует сборы, чтобы они не были обрезаны. Я использовал синтаксис, определенный здесь. Я пробовал много комбинаций, но ни один из них не работает. Что я здесь делаю не так? Как мы должны использовать корневые дескрипторы? < /P>
Вот некоторые предупреждения < /p>
1>/_/CommunityToolkit.WinUI.UI.Controls.DataGrid/Utilities/TypeHelper.cs(37): Trim analysis error IL2070: CommunityToolkit.WinUI.Utilities.TypeHelper.FindGenericType(Type,Type): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.Interfaces' in call to 'System.Reflection.TypeInfo.ImplementedInterfaces.get'. The parameter 'type' of method 'CommunityToolkit.WinUI.Utilities.TypeHelper.FindGenericType(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.
1>/_/CommunityToolkit.WinUI.UI.Controls.DataGrid/Utilities/TypeHelper.cs(268): Trim analysis error IL2070: CommunityToolkit.WinUI.Utilities.TypeHelper.GetPropertyOrIndexer(Type,String,Object[]&): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties' in call to 'System.Type.GetProperty(String)'. The parameter 'type' of method 'CommunityToolkit.WinUI.Utilities.TypeHelper.GetPropertyOrIndexer(Type,String,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.
1>/_/CommunityToolkit.WinUI.UI.Controls.DataGrid/Utilities/TypeHelper.cs(278): Trim analysis error IL2070: CommunityToolkit.WinUI.Utilities.TypeHelper.GetPropertyOrIndexer(Type,String,Object[]&): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicConstructors', 'DynamicallyAccessedMemberTypes.PublicMethods', 'DynamicallyAccessedMemberTypes.PublicFields', 'DynamicallyAccessedMemberTypes.PublicNestedTypes', 'DynamicallyAccessedMemberTypes.PublicProperties', 'DynamicallyAccessedMemberTypes.PublicEvents' in call to 'System.Type.GetDefaultMembers()'. The parameter 'type' of method 'CommunityToolkit.WinUI.Utilities.TypeHelper.GetPropertyOrIndexer(Type,String,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.
1>/_/CommunityToolkit.WinUI.UI.Controls.DataGrid/Utilities/TypeHelper.cs(378): Trim analysis error IL2075: CommunityToolkit.WinUI.Utilities.TypeHelper.SetNestedPropertyValue(Object&,Object,String): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties' in call to 'System.Type.GetProperty(String)'. 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.
1>/_/CommunityToolkit.WinUI.UI.Controls.DataGrid/Utilities/TypeHelper.cs(389): Trim analysis error IL2075: CommunityToolkit.WinUI.Utilities.TypeHelper.SetNestedPropertyValue(Object&,Object,String): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties' in call to 'System.Type.GetProperty(String)'. 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.
1>/_/CommunityToolkit.WinUI.UI.Controls.DataGrid/DataGrid/DataGrid.cs(8960): Trim analysis error IL2026: CommunityToolkit.WinUI.UI.Controls.DataGrid.ValidateEditingRow(Boolean,Boolean): Using member 'System.ComponentModel.DataAnnotations.ValidationContext.ValidationContext(Object,IServiceProvider,IDictionary`2)' 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.
1>/_/CommunityToolkit.WinUI.UI.Controls.DataGrid/DataGrid/DataGrid.cs(8961): Trim analysis error IL2026: CommunityToolkit.WinUI.UI.Controls.DataGrid.ValidateEditingRow(Boolean,Boolean): Using member 'System.ComponentModel.DataAnnotations.Validator.TryValidateObject(Object,ValidationContext,ICollection`1,Boolean)' 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.
1>/_/CommunityToolkit.WinUI.UI.Controls.DataGrid/DataGrid/DataGridComboBoxColumn.cs(617): Trim analysis error IL2075: CommunityToolkit.WinUI.UI.Controls.DataGridComboBoxColumn.GetDisplayValue(Object): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties' in call to 'System.Type.GetProperty(String)'. 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.
1>/_/CommunityToolkit.WinUI.UI.Controls.DataGrid/DataGrid/DataGridComboBoxColumn.cs(665): Trim analysis error IL2075: CommunityToolkit.WinUI.UI.Controls.DataGridComboBoxColumn.EnsureDisplayMemberPathExists(): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties' in call to 'System.Type.GetProperties()'. The return value of method 'CommunityToolkit.WinUI.UI.Utilities.Extensions.GetItemType(IEnumerable)' 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.
1>/_/CommunityToolkit.WinUI.UI.Controls.DataGrid/DataGrid/DataGridComboBoxColumn.cs(678): Trim analysis error IL2075: CommunityToolkit.WinUI.UI.Controls.DataGridComboBoxColumn.EnsureItemsSourceBinding(): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties' in call to 'System.Type.GetProperties()'. 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.
1>/_/CommunityToolkit.WinUI.UI.Controls.DataGrid/obj/Release/net5.0-windows10.0.18362.0/XamlTypeInfo.g.cs(2289): Trim analysis error IL2059: CommunityToolkit.WinUI.UI.Controls.CommunityToolkit_WinUI_UI_Controls_DataGrid_XamlTypeInfo.XamlUserType.RunInitializer(): Unrecognized value passed to the parameter 'type' of method 'System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(RuntimeTypeHandle)'. It's not possible to guarantee the availability of the target static constructor.
1>/_/CommunityToolkit.WinUI.UI.Controls.DataGrid/DataGrid/DataGridDataConnection.cs(1023): Trim analysis error IL2075: CommunityToolkit.WinUI.UI.Controls.DataGridInternals.DataGridDataConnection.UpdateDataProperties(): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties' in call to 'System.Type.GetProperties(BindingFlags)'. The return value of method 'CommunityToolkit.WinUI.UI.Controls.DataGridInternals.DataGridDataConnection.DataType.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.
1>/_/CommunityToolkit.WinUI.UI.Controls.DataGrid/CollectionViews/CollectionView.cs(890): Trim analysis error IL2075: CommunityToolkit.WinUI.UI.Data.Utilities.CollectionView.GetItemType(Boolean): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.Interfaces' in call to 'System.Type.GetInterfaces()'. 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.
1>/_/CommunityToolkit.WinUI.UI.Controls.DataGrid/Utilities/ValidationUtil.cs(225): Trim analysis error IL2075: CommunityToolkit.WinUI.UI.Data.Utilities.ValidationUtil.GetDependencyProperties(FrameworkElement,Boolean): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicFields' in call to 'System.Type.GetFields(BindingFlags)'. 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.
1>/_/CommunityToolkit.WinUI.UI.Controls.DataGrid/DataGrid/DataGridComboBoxColumn.cs(276): Trim analysis error IL2075: CommunityToolkit.WinUI.UI.Controls.DataGridComboBoxColumn.c__DisplayClass41_0.b__0(Object,SelectionChangedEventArgs): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties' in call to 'System.Type.GetProperty(String)'. 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.
Подробнее здесь: [url]https://stackoverflow.com/questions/79215500/how-to-use-root-descriptors-trimming-option-in-net[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия