From a725aac78ce5dab9894db45f264883440ce0ad90 Mon Sep 17 00:00:00 2001 From: Arthur Vickers Date: Sat, 27 Jan 2024 10:58:27 +0000 Subject: [PATCH] Also catch type initialization errors when attempting to load types that might not exist Since it appears that they can exist but be the wrong version for us to use. Fixes #32614 --- src/Microsoft.Data.Sqlite.Core/SqliteConnection.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.Data.Sqlite.Core/SqliteConnection.cs b/src/Microsoft.Data.Sqlite.Core/SqliteConnection.cs index 027a9cfe5d8..a59d762fce6 100644 --- a/src/Microsoft.Data.Sqlite.Core/SqliteConnection.cs +++ b/src/Microsoft.Data.Sqlite.Core/SqliteConnection.cs @@ -66,9 +66,9 @@ static SqliteConnection() storageFolderType = Type.GetType("Windows.Storage.StorageFolder, Windows, ContentType=WindowsRuntime") ?? Type.GetType("Windows.Storage.StorageFolder, Microsoft.Windows.SDK.NET"); } - catch (FileLoadException) + catch (Exception) { - // Ignore "Could not load assembly." + // Ignore "Could not load assembly." or any type initialization error. } object? currentAppData = null;