У меня есть проект Maui, который дает несколько ошибок, связанных с моими пользовательскими классами \ models \ term.cs и \ models \ cource.cs . Visual Studio 2022 дает одинаковую рекомендацию для обоих:
type 'system.collections.generic.list ' реализует общие интерфейсы Winrt, которые требуют сгенерированного кода, используя небезопасные для обрезки и совместимости с AOT, если его передают через Winrt ABI. Проект должен быть обновлен с помощью < /p>
true
Я предполагаю, что я добавляю флаг AllowunSafeblocks в termplanner.csproj или какой -либо другой файл. куда мне это настроить?///
/// Returns an IEnumerable of course objects from the "courses" SQLite table. The courses
/// are sorted and all occur during the selected term.
///
/// (int) The ID of the term to which all desired courses belong.
///
public static async Task CourseFullList(int TermID)
{
// Ensures the database is open and the necessary tables exist.
await Open();
// Creates a list of course objects.
List lst_course;
// Stores courses from the selected term, sorted by start date, in a list.
lst_course = await conn.Table().Where(x => x.ID == TermID).OrderBy(x => x.StartDate).ToListAsync();
// Returns the list of courses to the caller.
return lst_course;
}
Подробнее здесь: https://stackoverflow.com/questions/797 ... unsafebloc