3

I was recently learning about nuget, in the document Version ranges and wildcards, I tried this function:

<PackageReference Include="AutoMapper" Version="6.*" />

But I noticed that there is a yuellow triangle symbol on Dependencies without error (I could not post the image directly here, since I have no enough reputation.)

enter image description here

Nuget restore, clean up, restart VS, None of them resolve this issue.

Reproduce steps:

  1. Create a .net core class library project.

  2. Add the nuget package AutoMapper 6.2.2

  3. Edit the project file, change the version from 6.2.2 to 6.*, save it.

Appreciate your help!

Leo Liu
  • 71,098
  • 10
  • 114
  • 135
David.L
  • 101
  • 3
  • 6

1 Answers1

9

Yellow triangle symbol on Dependencies without error when use wildcards in the PackageReference

I could reproduced this issue by your steps. This issue should be related to the way how you add the nuget package.

When you added the nuget package AutoMapper 6.2.2 to the .NET core 2.0, it will install tons of dependencies:

enter image description here

Those dependencies info are stored in the file project.assets.json in the obj folder. When you change the version from 6.2.2 to 6.*, nuget could not know if those dependencies are still compatible with the version 6.*. So it gives the yellow triangle but without any error.

To resolve this issue, you could delete the file project.assets.json in the obj folder, then restore the nuget package.

Hope this helps.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135