i can't download nuget package for universal windows platform

Anonymous
2022-10-13T13:26:42.283+00:00

I am working with uwp I am learning to store a data in local database . I have downloaded extensions "sqlite for uinversal windows application" . but I can't download nuget pakages like (sqlite-net-pcl , Microsoft.Data.SQLite.Core) for my uwp solution packages . ![250110-net-pcl.png][1] these type of error is occurring for me . even i can't download Microsoft.Data.SQLite.Core https://learn.microsoft.com/en-us/windows/uwp/data-access/sqlite-databases in the above link they said we can download but I can't download it . the below error is occurring when it Try to download (Microsoft.Data.SQLite.Core ) ![250123-data.png][2] . if anyone know about this please let me know [1]: /api/attachments/250110-net-pcl.png?platform=QnA [2]: /api/attachments/250123-data.png?platform=QnA

Developer technologies | Universal Windows Platform (UWP)
Developer technologies | .NET | Other
0 comments No comments
{count} votes

Accepted answer
  1. Junjie Zhu - MSFT 21,646 Reputation points
    2022-10-14T02:33:42.987+00:00

    Hello anonymous user ,
    Welcome to Microsoft Q&A!

    According to the documentation Use a SQLite database in a UWP app, you just need to install Microsoft.Data.Sqlite.

    The prompt in the error message said Package Microsoft.Data.Sqlite supports netstandard 2.0 ...
    Your UWP version is 10.0.10586 which does not meet the environment requirements of these two packages.
    You can correct it by following the steps below

    1. Right-click your project, click Properties.
    2. Modify the Min version in Targeting to Windows 10 Fall Creators Update(10.0; Build 16299).
    3. Rebuild Solution.
    4. Open NuGet Package Manager and Install Microsoft.Data.Sqlite.

    Thank you.
    Junjie


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


2 additional answers

Sort by: Most helpful
  1. Michael Taylor 60,346 Reputation points
    2022-10-13T15:04:01.24+00:00

    The packages you're trying to download are not compatible with the version of the framework your code is compiling against. For packages that have been around a while you can sometimes use an older version of the package. In your specific case, for example, Microsoft.Data.Sqlite.Core supports the frameworks identified in the link. In other cases the package may not support your framework at all.

    The exact error you're getting is saying that the 7.0.0 pre-release package is not compatible with UAP. Perhaps you should try using Microsoft.Data.Sqlite instead.


  2. Anonymous
    2022-10-14T06:24:34.233+00:00

    After downloaded the both nuget package still my ( ISQLiteStatement cnStatement = dbConnection.Prepare(sSQL);) occurs an error
    public SQLiteConnection dbConnection = new SQLiteConnection("Folders.db");

        private void btnCreateDB_Click(object sender, RoutedEventArgs e)  
                {  
                    //------------< btnCreateDB_Click() >------------  
          
                    SQLiteConnection dbConnection = new SQLiteConnection("Folders.db");  
                    string sSQL = @"CREATE TABLE IF NOT EXISTS Folders(IDFolder Integer Primary Key Autoincrement NOT NULL,Foldername VARCHAR(200),Path VARCHAR(255));";  
                     ISQLiteStatement cnStatement = dbConnection.Prepare(sSQL);  
                    cnStatement.Step();  
                     
          
                    //------------</ btnCreateDB_Click() >------------  
                }  
    
      
      
    

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.