NugGet包管理器提供错误消息在Visual Studio 2017中找不到项目“默认” [英] NugGet Package manager gives error message Project 'Default' is not found in Visual Studio 2017

查看:952
本文介绍了NugGet包管理器提供错误消息在Visual Studio 2017中找不到项目“默认”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了新的Typescript Nodejs控制台项目。

I created new Typescript Nodejs console project.

在包管理器控制台窗口中,我看到默认项目为空。

In package manager console window, I see that Default project is empty.

当我运行Get-Package -ListAvailable时,它会给出错误

When I run Get-Package -ListAvailable, it gives error

Get-Package:找不到项目'Default'。

行:1字符:1

+ Get-Package -ListAvailable

+ ~~~~~~~~~~~~~~~~ ~~~~~~~~~~

    + CategoryInfo          :ObjectNotFound :(默认值:String)[Get-Package],ItemNotFoundException

    + FullyQualifiedErrorId:NuGetProjectNotFound,NuGet.PackageManagement.PowerShellCmdlets.GetPackageCommand

 

Get-Package : Project 'Default' is not found.
At line:1 char:1
+ Get-Package -ListAvailable
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Default:String) [Get-Package], ItemNotFoundException
    + FullyQualifiedErrorId : NuGetProjectNotFound,NuGet.PackageManagement.PowerShellCmdlets.GetPackageCommand
 

我发现很多关于此错误的帖子但没有解决方案。

I found many postings on this error but no resolution.

如何解决此错误。

推荐答案

您好Umit(Netman)Tiric,

Hi Umit (Netman) Tiric,

感谢您在此发帖。

这是由nuget团队设计的。来自
宣布NuGet 3.1

This is designed by the nuget team. From the Announcing NuGet 3.1:

不再支持解决方案包,因为这些包不会修改任何特定项目的功能,通常用于提供跨项目重用的共享资源。使用新的共享包文件夹,这些资源
可能已经存在于另一个项目的磁盘上。

Solution packages are no longer supported, as these packages are not modifying any specific project’s capabilities and were typically used to deliver shared resources that were re-used across projects. With the new shared packages folder, these resources may already be on disk from another project.

Typescript Nodejs控制台项目的模板是"Blank Node.js Console Application"。 ,因此Package Manager控制台窗口上的Default项目为空,使用命令"Get-Package -ListAvailable"后会出现该错误。如果您创建
a常用项目,则不会出现此错误。

The template of Typescript Nodejs console project is "Blank Node.js Console Application", so the Default project on Package Manager Console window is empty and you would got that error after using command "Get-Package -ListAvailable". If you create a common project, you will not get this error.

要解决此错误,您可以采用yishaigalatzer的建议:将包应用于项目和实现它的简单方法是创建一个项目,其中包含您用于解决方案级别的内容。

有关更多详细信息,请参阅
同样的问题

To resolve this error, you can adopt the yishaigalatzer`s suggestion: Apply a package to a project and a simple way to achieve it is to create a project that will include what you used to apply to the solution level.
For more detail information, you can refer the same issue on GitHub.


这篇关于NugGet包管理器提供错误消息在Visual Studio 2017中找不到项目“默认”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆