goenning / dotnet-outdated

Command line tool to check for outdated DotNet Core dependencies.
MIT License
46 stars 6 forks source link

SemVer 2.0.0 packages are not found #12

Open joelverhagen opened 6 years ago

joelverhagen commented 6 years ago

This is because the registration3 hive is being used, not registration3-gz-semver2.

For example, consider this project:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.0</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="NuGet.Frameworks" Version="4.6.2" />
    <DotNetCliToolReference Include="DotNetOutdated" Version="2.0.0" />
  </ItemGroup>
</Project>

There are newer stable versions of NuGet.Frameworks (4.7.0) but they do not appear.

Expected

 | Package          | Current | Wanted | Stable | Latest              |
 |--------------------------------------------------------------------|
 | NuGet.Frameworks | 4.6.2   | 4.6.2  | 4.6.2  | 4.7.0-preview1-4986 |
 | DotNetOutdated   | 2.0.0   | 2.0.0  | 2.0.0  | 2.0.0               |

Actual

 | Package          | Current | Wanted | Stable | Latest              |
 |--------------------------------------------------------------------|
 | NuGet.Frameworks | 4.6.2   | 4.6.2  | 4.7.0  | 4.8.0-preview1.5156 |
 | DotNetOutdated   | 2.0.0   | 2.0.0  | 2.0.0  | 2.0.0               |

The registration base URL should be looked up in the service index using @type value RegistrationsBaseUrl/3.6.0. API docs for service index: https://docs.microsoft.com/en-us/nuget/api/service-index

I wrote the docs so let me know if you have questions.

joelverhagen commented 6 years ago

Oh, and I ❤️ the project. Nice work.

I would recommend considering the NuGet.Protocol package for NuGet API interaction. This will give an object model as well as an abstraction of V2, V3, and file sources.

flagbug commented 6 years ago

I would recommend considering the NuGet.Protocol package for NuGet API interaction. This will give an object model as well as an abstraction of V2, V3, and file sources.

That's definitely a great idea, we really shouldn't be doing all of this protocol stuff ourselves!

flagbug commented 6 years ago

Hey @joelverhagen, I've just submitted at PR (#13) for this exact thing, would you be able to do a sanity check over my changes to see if I'm using the Nuget libraries correctly? Cheers!