-
Notifications
You must be signed in to change notification settings - Fork 265
Description
Floating/Open ended version requested - Scenario breaking change
Since the No-Op evaluation needs to be minimal, we avoiding checking the sources, so the case where a new version of the requested package is uploaded, or a version of the package is unlisted it might change the package resolution behavior.
Example:
<ItemGroup>
<!-- ... -->
<PackageReference Include="My.Awesome.Package" Version="3.6.*" />
<!-- ... -->
</ItemGroup>
At the moment of the first restore, version="3.6.0" was the latest version on the package source.
Sometime between that restore and the new restore, version="3.6.1" was uploaded to the source.
Running a full restore would resolve 3.6.1 and downloaded that version of the package. However since the restore inputs have not changed, restore will think no action needs to be taken.
This might cause issues for scenarios like the following:
A project(ProjX) that depends on a local feed that contains the latest bits of the desired projects (ProjA, ProjB etc).
ProjA is built and the nupkgs from that dropped into the local feed for the ProjX.
ProjX is restored and packed.
The expectation is that the nupkg generated by projX has the latest ProjA nupkg that was built.
However since the restore parameters have not changed, the restore of ProjX might no-op.
The workaround is to simply use the force option for scenarios like this.
Potential improvements
- Make the cache expire, based on a timestamp. The timestamp can be either in the cache or just use the timestamp of when the file was written. This doesn't fix the above scenario though, it makes it less likely.
- Print a warning whenever we no-op on a project that has open ended/ floating dependencies. Caveat is this could become really noisy and users might hate it.
Workarounds
Use -force selectively when you need to update the floating version. (dotnet.exe/nuget.exe)
In Visual Studio, do a rebuild with restore on build enabled. That restore on build is equivalent to force.
//cc
@rohit21agrawal , @emgarten