From e5cf97476004cd72bed6d8f78e96844ff2a0bf81 Mon Sep 17 00:00:00 2001 From: Arthur Vickers Date: Sun, 28 Jan 2024 09:22:37 +0000 Subject: [PATCH] Also catch type initialization errors when attempting to load types that might not exist (#32938) 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 bd368b2370a..02e75c9aa25 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;