Paket: Unable to find package spontaneous error

Created on 28 Nov 2017  路  5Comments  路  Source: fsprojects/Paket

Description

.Net Core 2

We're using the Nexus OSS repository to provider our internal packages using paket. When we're publishing a new package version and after that execute paket update the packet updates the package to the correct version (it properly see the newest version).
When we open the project in Visual Studio the package (library) is marked with an yellow triangle and the following error occurs in the console:

Error NU1102: Unable to find package X with version (>= 3.1.0.5989790)

  • Found 224 version(s) in Y1 [ Nearest version: 3.1.0.5935616 ]
  • Found 0 version(s) in Y2
  • Found 0 version(s) in Y3

I was trying the "paket clear-cache" and/or delete obj folder and it sometimes helps, but sometimes not :/

Repro steps

  1. Create a package with a version 1.0

  2. Install it in the project with paket.exe install

  3. Create a package with a version 1.1

  4. Update a package

The problem doesn't arise always :/

Expected behavior

Package can bee seen in the Visual Studio project

Actual behavior

Sometimes a package cannot bee seen by the Visual Studio

Known workarounds

nuget locals http-cache -clear
dotnet restore ...

Best Regards,
MiloszeS

bug extern dotnesdk

Most helpful comment

VS: 14.4.5

I've found a workaround:

nuget locals http-cache -clear

So it looks like http-cache in the nuget is out of sync for a while. We've noticed the problem mostly (I had the problem only with young packages, but my collegues don't remember which packages was problematic for them) for packages quite yound (deployed a few minutes before).

All 5 comments

which VS version? latest paket is automatically deleting project.assets.json which should trigger MSBuild background restore. /cc @davkean

VS: 14.4.5

I've found a workaround:

nuget locals http-cache -clear

So it looks like http-cache in the nuget is out of sync for a while. We've noticed the problem mostly (I had the problem only with young packages, but my collegues don't remember which packages was problematic for them) for packages quite yound (deployed a few minutes before).

I've been hit by this multiple times. Thanks for the workaround @miloszes

To save some time for some. I had to do dotnet nuget locals http-cache --clear.

I have a build process that builds/packages/pushes a package that is used by the next solution. The restore on the second solution would fail because the new package was not found, and so the build would fail. Adding another task after the push that cleared the cache fixed it right up.
@miloszes Thank you very much!

Was this page helpful?
0 / 5 - 0 ratings