Skip to content

Commit 1783520

Browse files
authored
Also catch type initialization errors when attempting to load types that might not exist (#32938) (#32941)
Since it appears that they can exist but be the wrong version for us to use. Fixes #32614
1 parent 927def6 commit 1783520

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Microsoft.Data.Sqlite.Core/SqliteConnection.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ static SqliteConnection()
6666
storageFolderType = Type.GetType("Windows.Storage.StorageFolder, Windows, ContentType=WindowsRuntime")
6767
?? Type.GetType("Windows.Storage.StorageFolder, Microsoft.Windows.SDK.NET");
6868
}
69-
catch (FileLoadException)
69+
catch (Exception)
7070
{
71-
// Ignore "Could not load assembly."
71+
// Ignore "Could not load assembly." or any type initialization error.
7272
}
7373

7474
object? currentAppData = null;

0 commit comments

Comments
 (0)