devlooped / nugetizer

A simple to understand packing model for authoring NuGet packages
https://clarius.org/nugetizer/
MIT License
258 stars 7 forks source link

A very weird interaction of VS, NuGetizer and NuGet with `packages.lock.json` file. #504

Open voroninp opened 3 months ago

voroninp commented 3 months ago

Describe the Bug

https://developercommunity.visualstudio.com/t/Packages-Restore-done-by-VS-and-dotnet/10709497

When I reference NuGetizer project Rebuild action in VS causes NuGet to generate bad packages.lock.json file. See the description above. I am not 100% sure it is NuGetizer's bug, TBH.

Steps to Reproduce

See this repository: https://github.com/voroninp/BadRestore for reoridcution. Run rebuild, then check packages.lock.json.file of BadRestore project. Comment out the reference to NuGetizer in ReferencedProject. Run rebuid several times, check packages.lock.json.file of BadRestore project again and see that referencedproject changed to A.Prefix.Referenced.Project.

Expected Behavior

I'd expect that Rebuild and dotnet restore --force-evaluate produce the same result.

Version Info

1.2.2

Back this issue Back this issue

kzu commented 2 months ago

Consider sponsoring to help prioritize: https://github.com/sponsors/devlooped

It can be helpful when diagnosing an issue to collect binlogs and compare the deltas. I don't personally ever use RestorePackagesWithLockFile so this is very low priority for me.