Visual Studio 2017 中的 nuget 包参考蓝色图标 [英] nuget package reference blue icon in visual studio 2017

查看:94
本文介绍了Visual Studio 2017 中的 nuget 包参考蓝色图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

出于某种原因,在我的控制台应用程序中,我通过 nuget 安装的几个参考显示了蓝色的 nuget 图标.我可以在本地构建我的项目,但不能在将我的项目部署到云之后.错误 msg 抱怨无法找到这 2 个引用.似乎我无法通过右键单击删除它们(没有删除选项可用).有什么想法吗?

For some reason in my console app, couple of the reference that I installed thru nuget shows the blue nuget icon. I can build my project locally, but not after I deploy my project to cloud. The error msg is complaining about not able to find these 2 references. Seems like I can't delete them either by right click(no delete option avaialble). Any idea?

推荐答案

Visual Studio 2017 中的 nuget 包引用蓝色图标

nuget package reference blue icon in visual studio 2017

那是因为您在非 .NET Core 的项目类型上使用了 packagereference.

That because you are using the packagereference on the project types that are not .NET Core.

您可以编辑 .csproj 文件并检查它是否包含以下 ItemGroup:

You can edit the .csproj file and check if it contains following ItemGroup:

  <ItemGroup>
    <PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
  </ItemGroup>

要解决此问题,您可以从项目文件中删除此 PackageReference,然后使用 nuget 包添加这些包.

To resolve this issue, you can delete this PackageReference from your project file, then add those package with nuget package.

此外,您应该检查是否将默认包管理格式设置为PackageReference.如果是,将其更改为packages.config,然后使用nuget添加这两个包:

Besides, you should check if you have set the Default package management format to PackageReference. If yes, change it to packages.config, then add those two packages with nuget:

希望这会有所帮助.

这篇关于Visual Studio 2017 中的 nuget 包参考蓝色图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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