Nuget error “Object reference not set to an instance of an object” while installing Entityframework 7 from Package Manager Console in VS2015

血红的双手。 提交于 2019-12-03 10:58:35

问题


I am trying to build a sample application using EF7 and mvc 6 in visual studio 2015 pre release.

While installing both EF7 and MVC6 using package manager console getting this error.

 PM> Install-Package EntityFramework.Commands -Version 7.0.0-beta3 -Pre
 Attempting to gather dependencies information for package    
 'EntityFramework.Commands.7.0.0-beta3' with respect to project
 targeting '.NETFramework, Version=v4.5.3' Install-Package : Object
 reference not set to an instance of an object. At line:1 char:1
 + Install-Package EntityFramework.Commands -Version 7.0.0-beta3 -Pre
 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
     + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Can any one help me how to resolve this issue, or I am doing right?


回答1:


I had a similar issue in Visual Studio 2015 Community Edition.

Created a simple ASP.NET MVC 5 default project that I hosted on Azure. I was working through the project and when I tried to load up the NuGet GUI but kept getting the "Object Reference..." error.

I restarted Visual Studio in Administrator mode (right-clicked Visual Studio and started in Administrator mode) which resolved the problem.




回答2:


I have solved this problem, by disabling the "https://api.nuget.org/v3/" from the package source, in order to do this, Choose Tools > Nuget Package Manager > Package Source

And other thing I did is added myget package source "https://www.myget.org/F/aspnetvnext/api/v2/"

Following the steps Choose Tools > Nuget Package Manager > Package Source > Click add on top of the window and add the myget package source.




回答3:


What I had is that I was disconnected from the internet while trying to install any package.

Not sure if this covers everyting, but I have to say nuget and the package manager console is a great source for headaches.




回答4:


I solved my problem by adding:

https://api.nuget.org/v3/index.json

as a Package Sources feed, as shon on the picture below:




回答5:


My problem solved by activation Microsoft and .NET source , and use it to get package.




回答6:


In my case, i was having:

Object reference not set to an instance of an object

From package manager and i solved it closing all and opening again.




回答7:


I think your IPaddress doesn't connect to nugetpackage Use proxy to change your IPaddress I think that's true.




回答8:


Perfect and ultimate Solution Guys this is the perfect solution for that. First install the latest version of nuget from your visual studio. Then install the sqlite through the last version of nuget you installed already. for more details just look the picture bellow. Thanks]1]1




回答9:


After I restarted the computer, the problem is gone.




回答10:


Perfect and ultimate Solution Guys this is the perfect solution for that. First install the latest version of nuget (Nuget.VisualStudio) from your visual studio. Then install the sqlite through the last version of nuget you installed already. for more details just look the picture bellow. Thanks



来源:https://stackoverflow.com/questions/29763583/nuget-error-object-reference-not-set-to-an-instance-of-an-object-while-install

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!