[6.0] Microsoft.Data.Sqlite: Also try the .NET 5+ ApplicationData API #26114
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We have code for UWP that sets the SQLite data and temp directories so that databases can be created when running inside an app container sandbox. .NET 5 added new bindings for WinRT APIs, and our code no longer ran on .NET 5/6 apps requiring users to manually set the SQLite directories.
Fixes #24213
/cc @Pilchie
Customer impact
Without this, the experience of using SQLite in MSIX-packaged windows apps would continue requiring additional, non-obvious steps.
Regression
Not in .NET 6, but the experience was regressed going from UWP to MSIX-packaged .NET 5 apps.
Testing
We don't have any automated tests that run inside of a sandboxed app container. Manually verified that databases are now created correctly. (using winsqlite3.dll)
Risk
Low. We're just probing for one additional assembly; if it fails, execution continues the same as when we didn't find the UWP API.