Skip to content
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

lock file not updating when packagereference removed #7930

Closed
zivkan opened this issue Mar 29, 2019 · 5 comments · Fixed by NuGet/NuGet.Client#2808
Closed

lock file not updating when packagereference removed #7930

zivkan opened this issue Mar 29, 2019 · 5 comments · Fixed by NuGet/NuGet.Client#2808
Assignees
Milestone

Comments

@zivkan
Copy link
Member

zivkan commented Mar 29, 2019

Details about Problem

NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe): dotnet.exe

NuGet version (x.x.x.xxx): 5.0.0.4

dotnet.exe --version (if appropriate): 3.0.100-preview3-010410

VS version (if appropriate): n/a

OS version (i.e. win10 v1607 (14393.321)): 17763.379

Worked before? If so, with which NuGet version:

Detailed repro steps so we can see the same problem

dotnet new console -n MyApp
dotnet restore --use-lock-file MyApp\MyApp.csproj
dotnet new classlib -n MyLib
dotnet add MyLib\MyLib.csproj package Newtonsoft.Json --version 12.0.1
dotnet add MyApp\MyApp.csproj reference MyLib\MyLib.csproj
dotnet restore MyApp\MyApp.csproj
# confirm MyApp\packages.lock.json contains Newtonsoft.Json as a transitive dependency

dotnet add MyApp\MyApp.csproj package Newtonsoft.Json --version 12.0.1
# confirm MyApp\packages.lock.json contains Newtonsoft.Json as a direct dependency

dotnet remove MyApp\MyApp.csproj package Newtonsoft.Json
dotnet restore MyApp\MyApp.csproj --force
# MyApp\packages.lock.json should have Newtonsoft.Json as a transitive dependency, but it's still listed as direct

dotnet remove MyLib\MyLib.csproj package Newtonsoft.Json
dotnet restore MyApp\MyApp.csproj --force
# MyApp\packages.lock.json should no longer have Newtonsoft.Json as a dependency, but it's still listed.
@nkolev92
Copy link
Member

nkolev92 commented Apr 2, 2019

Pinpointed the issue in dev-nkolev92-lockFileRemovePackage .
Started some basic work, but will finish in week 3.

The issue is that we don't account for packages in the lock file, but not in the package graph when doing the dirty check.

//cc @anangaur

@nkolev92
Copy link
Member

Same thing would happen if the dependency removed was coming from MyApp.

@nkolev92
Copy link
Member

nkolev92 commented May 3, 2019

Customer report #8091.

@anangaur
Copy link
Member

anangaur commented May 3, 2019

This seems like a 4.9.x candidate as discussed.

@nkolev92
Copy link
Member

nkolev92 commented May 3, 2019

@anangaur Created #8094 with a list of servicing considerations, currently assigned to you, Rob + the authors of the fixes/features in the original milestone.

@rrelyea rrelyea changed the title lock file not updating when package references removed lock file not updating when packagereference removed May 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants