-
Notifications
You must be signed in to change notification settings - Fork 126
Support PackageReference without version #311
Comments
That's... odd :-) this is still a package listed normally on NuGet https://www.nuget.org/packages/Microsoft.AspNetCore.App/ and I definitely missed that "no version" option when upgrading my projects. |
Simple repro: call stack:
|
Ack! yes, we should just skip this one ref and not crash. |
Played a bit with other packages without a version - NuGet will just install the lowest version published. Ack. But it's valid, just not very useful. Agreed - best behaviour here is to skip. |
I am not surprised that nuget picks the minimum version; within other constraints like platform support and other packages that could depend on it, with version ranges. I am seeing similar at work where we get an old version of a transitive dependency. Which is sometimes not ideal. |
Oh, no, for normal packages, it ignores the target platform constraints completely in this case. Just the oldest version published, end of story :-D |
Grabbing ideas from the Big League: |
Ah, we do skip those packages and continue with the rest of analysis. See https://github.com/NuKeeperDotNet/NuKeeper/blob/master/NuKeeper.Inspection/RepositoryInspection/ProjectFileReader.cs#L63 (and the implementations for other 2 formats). @AnthonySteele perhaps the solution here is to not log this as |
Yup, it does not cause the process to crash, but this being reported as an Error is weird. It might be better to detect the empty version before passing it to the NuGet version, so that it can be skipped correctly (and other Exceptions would still cause an Error). |
The PR above should stop this being reported as an error. In another codebase, I now have imported versions with a range, e.g. It would be good to detect and work with these. Looking at |
|
The |
Those references might be actually going away; issue to track is dotnet/aspnetcore#3307 |
With #443 in place this issue is most likely ready to be closed? |
With ASP.NET Core 2.1, the main package reference for the core projects is changed from
to
I think the actual version is determined by the SDK. Running NuKeeper on a csproj that contains this PackageReference displays an
ArgumentNullException
. This package could be skipped, so that the error is not shown.Probably caused by the
NuGetVersion
constructor atNuKeeper/NuKeeper.Inspection/RepositoryInspection/PackageInProject.cs
Line 15 in ec27e14
The text was updated successfully, but these errors were encountered: