无法在 VS2015 中通过 Nuget 下载 System.Data.Sqlite

Cannot download System.Data.Sqlite via Nuget in VS2015

我正在尝试通过 Visual Studio 2015 社区中的库存 NuGet 下载支持 EF6 的包 System.Data.Sqlite。按 "Install" 后,系统要求我提供依赖项。然后,在确认之后,有一段时间没有任何反应,然后在输出 window 中,我得到 "Object reference not set to instance of object" 错误。我将NuGet升级到3.2.x,但问题依旧。我该怎么做才能解决它?


编辑: 来自输出控制台的日志:

Attempting to gather dependencies information for package 'System.Data.SQLite.1.0.98.1' with respect to project 'WPTManager', targeting '.NETFramework,Version=v4.5.2'
Attempting to resolve dependencies for package 'System.Data.SQLite.1.0.98.1' with DependencyBehavior 'Lowest'
Resolving actions to install package 'System.Data.SQLite.1.0.98.1'
Resolved actions to install package 'System.Data.SQLite.1.0.98.1'
Install failed. Rolling back...
Package 'EntityFramework 6.0.0' does not exist in project 'WPTManager'
Package 'EntityFramework 6.0.0' does not exist in folder 'D:\Dokumenty\Dev\VS\Projekty\WPTManager\packages'
System.NullReferenceException: Object reference not set to an instance of an object.
   at NuGet.Protocol.Core.v3.GlobalPackagesFolderUtility.<AddPackageAsync>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at NuGet.Protocol.Core.v3.DownloadResourceV3.<GetDownloadResourceResultAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.PackageManagement.PackageDownloader.<GetDownloadResourceResultAsync>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at NuGet.PackageManagement.NuGetPackageManager.<ExecuteNuGetProjectActionsAsync>d__42.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at NuGet.PackageManagement.NuGetPackageManager.<ExecuteNuGetProjectActionsAsync>d__42.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.PackageManagement.UI.UIActionEngine.<ExecuteActionsAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.PackageManagement.UI.UIActionEngine.<PerformActionAsync>d__3.MoveNext()
========== Finished ==========

找到解决方法。

  1. 通过 NuGet 安装Entity Framework;
  2. 现在安装 System.Data.SQLite - 它将正确安装。

虽然没有直接的解决方案 - 很可能是 NuGet 中的错误。

我有同样的问题。所以我从 NuGet 站点手动下载了包,然后我设置了自己的包源并从那里正确安装了它。它也只是像您一样的解决方法。