Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
843 views
in Technique[技术] by (71.8m points)

nuget package reference blue icon in visual studio 2017

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?

enter image description here

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

nuget package reference blue icon in visual studio 2017

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

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

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

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

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:

enter image description here

Hope this helps.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...