You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[severity:It bothers me. A fix would be nice]
All steps are done in VS2022 17.12.3, with the available built-in tools for project edition and git operations, in 1 active session.
Create a new project in an existing solution
Set <RestorePackagesWithLockFile>true</RestorePackagesWithLockFile> in the csproj
Add some nuget dependencies to the project
Commit / Push the new project to a new branch in the git repository
Switch back to a git branch where the created project does not exist.
Switching from a branch where a project exists to a branch where the project doesn't exist reproduces the issue.
Actual result: After a build the packages.lock.json will appear despite the projet not being here. Deleting the project folder doesn't seem to fix this behavior.
Expected result: The packages.lock.json shouldn't reappear when the project disappeared in the git and solution contexts.
Workaround: Restarting Visual Studio fixes the issue.
Original Comments
Feedback Bot on 12/12/2024, 09:39 PM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
Nigusu Yenework [MSFT] on 12/13/2024, 00:37 PM:
Thank you for reaching out. Shouldn’t the lock file be created within the folder of the new project you added? When you switch back to the other branch, wouldn’t the entire project folder (including the lock file) be expected to disappear? Could you clarify if the folder persists even after switching branches?
Why do we ask for more info?
We try to reproduce all issues reported with the information provided in the description and comments. When we can’t reproduce the issue, we ask you for more information so we can resolve the issue as quickly and efficiently as possible.
In our guidelines, you can get tips on how to provide clear and simple reproducible steps.
The project used to reproduce the issue is a MSTest project. Switching from test-branch to master reproduces the issue on my machine.
The commits also show the changes made for empty projects and solution.
In this situation, switching from a branch where the project exists, to the branch where it does not, does not delete the project folder entirely. A folder persists with a bin / obj folder.
The bin folder is empty, the obj folder is not.
Rebuilding logs a restore on the disapeared project and creates the lock file :
Rebuild started at 15:29…
Restored C:\Users\x\Source\Repos\TestPackageLock\TestPackageLock\TestPackageLock.csproj (in 7 ms).
1>------ Rebuild All started: Project: TestPackageLock, Configuration: Debug Any CPU ------
Restored C:\Users\x\Source\Repos\TestPackageLock\testPackageLock.Tests\testPackageLock.Tests.csproj (in 70 ms).
1>TestPackageLock -> C:\Users\thieu\Source\Repos\TestPackageLock\TestPackageLock\bin\Debug\net8.0\TestPackageLock.dll
This issue has been moved from a ticket on Developer Community.
[severity:It bothers me. A fix would be nice]
All steps are done in VS2022 17.12.3, with the available built-in tools for project edition and git operations, in 1 active session.
Switching from a branch where a project exists to a branch where the project doesn't exist reproduces the issue.
Actual result: After a build the packages.lock.json will appear despite the projet not being here. Deleting the project folder doesn't seem to fix this behavior.
Expected result: The packages.lock.json shouldn't reappear when the project disappeared in the git and solution contexts.
Workaround: Restarting Visual Studio fixes the issue.
Original Comments
Feedback Bot on 12/12/2024, 09:39 PM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
Nigusu Yenework [MSFT] on 12/13/2024, 00:37 PM:
Thank you for reaching out. Shouldn’t the lock file be created within the folder of the new project you added? When you switch back to the other branch, wouldn’t the entire project folder (including the lock file) be expected to disappear? Could you clarify if the folder persists even after switching branches?
Why do we ask for more info?
We try to reproduce all issues reported with the information provided in the description and comments. When we can’t reproduce the issue, we ask you for more information so we can resolve the issue as quickly and efficiently as possible.
In our guidelines, you can get tips on how to provide clear and simple reproducible steps.
Matthieu Penant on 12/16/2024, 05:42 AM:
I created a repro project on github that exhibits the issue: https://github.com/Thieum/TestPackageLock
The project used to reproduce the issue is a MSTest project. Switching from test-branch to master reproduces the issue on my machine.
The commits also show the changes made for empty projects and solution.
In this situation, switching from a branch where the project exists, to the branch where it does not, does not delete the project folder entirely. A folder persists with a bin / obj folder.
The bin folder is empty, the obj folder is not.
Rebuilding logs a restore on the disapeared project and creates the lock file :
Rebuild started at 15:29…
Restored C:\Users\x\Source\Repos\TestPackageLock\TestPackageLock\TestPackageLock.csproj (in 7 ms).
1>------ Rebuild All started: Project: TestPackageLock, Configuration: Debug Any CPU ------
Restored C:\Users\x\Source\Repos\TestPackageLock\testPackageLock.Tests\testPackageLock.Tests.csproj (in 70 ms).
1>TestPackageLock -> C:\Users\thieu\Source\Repos\TestPackageLock\TestPackageLock\bin\Debug\net8.0\TestPackageLock.dll
Nikolche Kolev [MSFT] on 12/20/2024, 02:12 PM:
Matthieu Penant
thanks for the details.
I can repro this.
Likely related to how unloaded projects are supposed to work.
https://learn.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu1105#visual-studio
The text was updated successfully, but these errors were encountered: