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

时间:2015-10-03 06:12:59

标签: sqlite entity-framework-6 nuget visual-studio-2015 nullreferenceexception

我尝试在Visual Studio 2015社区中通过库存NuGet下载支持EF6的软件包System.Data.Sqlite。按下"安装"后,我被问到是否存在依赖关系。然后,确认后,暂时没有任何反应,然后,在输出窗口中,我得到"对象引用未设置为对象的实例"错误。我将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 ==========

2 个答案:

答案 0 :(得分:0)

找到了解决方法。

  1. 通过NuGet安装实体框架;
  2. 现在安装System.Data.SQLite - 它将正确安装。
  3. 虽然没有直接的解决方案 - 很可能是NuGet中的一个错误。

答案 1 :(得分:0)

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