-
Notifications
You must be signed in to change notification settings - Fork 520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CollectPackageReferences in .NET Core 2.0.2 results in Paket failing to restore the dotnet-fable tool in fable-suave-scaffold #2784
Comments
good news: I can repro. I consider this a bug in paket. Thanks for reporting! |
this is fixed in paket 5.98 I still think the NuGet team should try to improve the error message. |
related: NuGet/Home#5913 |
Do you have a suggestion on what the error message should be here? In this scenario NuGet restore finds a corrupted install, zero sources, and has no idea that another tool has modified all of these things are not the user. The current NU1100 message is shown when a package cannot be found and no sources exist, otherwise the sources would be listed along with the versions that were found. |
@emgarten Why is it trying to hide that it found a corrupt install? |
I wouldn't say it is trying to hide the state. For NuGet restore the package is downloaded to the http cache, validated there, and retries occur as needed. If there are issues warnings or errors are displayed and the global packages folder remains untouched. Once the package is completely downloaded and validated it is then extracted to the global packages folder and files are moved into place while the package is locked to avoid conflicts. If there is a corrupt install it will be fixed at this point by replacing it. A warning about finding a previous corrupted install could be useful, however under normal circumstances this isn't something that the user needs to act on. Restore fixes the problem. In this case the primary problem is that the package cannot be found to install, and the user is shown that message. |
ok scratch that. I didn't follow my own advice:
|
I've recently ran into this issue out of nowhere. I am using paket 5.184.0 and somehow things got broken with the What worked for me was the following:
|
Description
From @rrelyea in our internal investigation thread:
CollectPackageReferences
was implemented by VS/ProjectSystem in 15.0.They asked NuGet commandline to start respecting it, as a hook for customer scenarios (including paket).
For the 15.4 timeframe, we’ve added that support.
In .NET Core 2.0.0 – Paket downloaded many nupkgs and put them in the user package folder. However, they just put the .nupkg there, they didn’t extract it. It still worked because NuGet redownloaded all the packages and cleaned up their non-extracted install.
In .NET Core 2.0.2 – NuGet now is respecting CollectPackageReferences, which enables Paket to clear NuGet sources via the nuget.config that they pass us. This means we cannot go download things the 2nd time to make it all work.
This looks like the correct behavior from NuGet.
Paket is trying to prevent NuGet from downloading twice, despite the fact that they downloaded them improperly the first time.
Repro steps
On Windows (I haven't tested this on macOS or Linux)
Install .NET Core 2.0.2
Clone fable-suave-scaffold
Instal Node LTS and Yarn latest
Run
build.cmd
Expected behavior
Success.
Actual behavior
Failure (paths are from a test VM, but this will repro on a local machine).
Impact
This will impact fable-suave-scaffold on .NET Core moving forward. The first time people could encounter this en-masse will be when VS 2017 15.4 releases.
Known workarounds
Use 2.0.0 first, then switch back to 2.0.2.
Relevant info
NuGet/Home#4967
dotnet/project-system#653
cc @emgarten and @davkean as well.
The text was updated successfully, but these errors were encountered: