简体   繁体   English

在 VS2015 中从包管理器控制台安装 Entityframework 7 时出现 Nuget 错误“对象引用未设置为对象的实例”

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

I am trying to build a sample application using EF7 and mvc 6 in visual studio 2015 pre release.我正在尝试在 Visual Studio 2015 预发行版中使用 EF7 和 mvc 6 构建示例应用程序。

While installing both EF7 and MVC6 using package manager console getting this error.使用包管理器控制台安装 EF7 和 MVC6 时出现此错误。

 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?任何人都可以帮助我如何解决这个问题,或者我做得对吗?

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我已经解决了这个问题,通过从包源中禁用“ https://api.nuget.org/v3/ ”,为了做到这一点,选择工具 > Nuget 包管理器 > 包源

And other thing I did is added myget package source " https://www.myget.org/F/aspnetvnext/api/v2/ "我做的另一件事是添加了 myget 包源“ 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.按照步骤选择工具 > Nuget 包管理器 > 包源 > 单击窗口顶部的添加并添加 myget 包源。

I had a similar issue in Visual Studio 2015 Community Edition.我在 Visual Studio 2015 社区版中遇到了类似的问题。

Created a simple ASP.NET MVC 5 default project that I hosted on Azure.创建了一个简单的 ASP.NET MVC 5 默认项目,我在 Azure 上托管。 I was working through the project and when I tried to load up the NuGet GUI but kept getting the "Object Reference..." error.我正在完成项目,当我尝试加载 NuGet GUI 但一直收到“对象引用...”错误。

I restarted Visual Studio in Administrator mode (right-clicked Visual Studio and started in Administrator mode) which resolved the problem.我以管理员模式重新启动 Visual Studio(右键单击 Visual Studio 并以管理员模式启动)解决了问题。

I solved my problem by adding:我通过添加解决了我的问题:

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

as a Package Sources feed, as shown on the picture below:作为 Package Sources 提要,如下图所示:

在此处输入图片说明

My problem solved by activation Microsoft and .NET source , and use it to get package.我的问题通过激活 Microsoft 和 .NET 源解决,并使用它来获取包。

在此处输入图片说明

在此处输入图片说明

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.不确定这是否涵盖所有内容,但我不得不说 nuget 和包管理器控制台是令人头疼的重要来源。

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.从包管理器,我解决了它关闭所有并再次打开的问题。

我认为您的 IP 地址未连接到 nugetpackage 使用代理更改您的 IP 地址 我认为这是真的。

Perfect and ultimate Solution Guys this is the perfect solution for that.完美和终极解决方案伙计们,这是完美的解决方案。 First install the latest version of nuget from your visual studio.首先从您的 Visual Studio 安装最新版本的 nuget。 Then install the sqlite through the last version of nuget you installed already.然后通过您已经安装的最新版本的 nuget 安装 sqlite。 for more details just look the picture bellow.有关更多详细信息,请查看下面的图片。 Thanks] 1 ] 1谢谢] 1 ] 1

我重新启动计算机后,问题就消失了。

对我来说,在解决方案的不同项目中整合 nuget 之后(通过“ Consolidate选项卡),它开始工作。

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.首先从您的 Visual Studio 安装最新版本的 nuget (Nuget.VisualStudio)。 Then install the sqlite through the last version of nuget you installed already.然后通过您已经安装的最新版本的 nuget 安装 sqlite。 for more details just look the picture bellow.有关更多详细信息,请查看下面的图片。 Thanks谢谢

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM