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

[Bug Bash] The second project doesn't generate “packages.lock.json” file after restoring project with command under solution path with enabling ‘RestorePackagesWithLockFile’ #13970

Open
CiciLi1 opened this issue Nov 29, 2024 · 0 comments

Comments

@CiciLi1
Copy link

CiciLi1 commented Nov 29, 2024

NuGet Product Used

Visual Studio Package Management UI

Product Version

NuGet Client Dev\6.13.0.79

Worked before?

It is not a regression since it also reproes on D16.11\34601.136 with implicit NuGet Client 5.11.6.4 and D17.12\33527.113 with implicit NuGet Client 6.12.2.1.

Impact

It bothers me. A fix would be nice

Repro Steps & Context

Repro Steps:   

  1. Create two “C# Class Library (.NET Framework 4.8.1)” projects.   

  2. Right-click the solution in Solution Explorer window and select "Manage NuGet Packages for Solutions…" menu item to open solution-level PM UI.   

  3. Click “Browse” tab and select “nuget.org” from “Package source” drop-down list.

  4. Install a package (e.g.Newtonsoft.Json) with “PackageReference” format into both projects.

  5. Right-click the project in Solution Explorer and select “Unload project”, click the “Save” button in prompt dialog box. (Both projects operate in the same way.)

  6. Set MSBuild property “RestorePackagesWithLockFile” to true in csproj file for every project.

<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>

  1. Reload projects and click “Tools -> Command Line -> Developer Command Prompt”

  2. Run restore command “msbuild /t:restore /v:d”.

Expected:   

It should have generated ‘packages.lock.json’ file alongside *.csproj file in every project.

Actual:   

The second project doesn’t generate “packages.lock.json” file as below screenshot: 
1129

Verbose Logs

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant