-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Use packages.lock.json
instead of project.assets.json
, if available
#35556
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
It's a NuGet suggestion. The lock file does not contain enough information to setup the build.
I don't see us adding these to the lock file at this point. The lock file is pretty large as is, and readability is a key aspect of it. |
To be pedantic, if this suggestion was feasible, it'd probably require a code change in the SDK repo, not NuGet. However, as discussed the lock file doesn't contain all the information that the It could be interesting to capture a PerfView trace to see what's taking "so long", and therefore get ideas for what perf improvements might be possible. |
Leaving it in the SDK for now but assigning to nkolev92 and zivkan if they want to engage. Moved it to the discussion milestone. I can't mark it for nuget as we have a bot that will close the issue and route people to the nuget repo. |
I'm closing this issue, as previous comments explain information that the SDK needs from the assets file that is missing from the lock file. Unfortunately, it's just not feasible to avoid restore to generate the additional intermediate files.
|
Thanks for the reference. Static graph evaluation did not improve our restore times, but our restore times are not that bad to begin with. |
Is your feature request related to a problem? Please describe.
NuGet restore is required to generate
project.assets.json
even when a project-level lock file (e.g.packages.lock.json
) already exists. When using the Cache task in Azure Pipelines, the recommendation is to add a condition to your NuGet restore task to prevent it from running. However, I've found this doesn't actually work in practice because the build process always expectsproject.assets.json
to exist (the aforementioned link even mentions this like it might not happen).Running a NuGet restore adds at least 30 seconds to our build time even when disabling all remote NuGet sources. I would expect the lock file to contain all the necessary information to build.
Describe the solution you'd like
The build process should detect and use
packages.lock.json
, if available, in place ofproject.assets.json
instead of triggering NETSDK1004.Additional context
See also: NuGet/Home#11770, NuGet/Home#12409 (comment)
The text was updated successfully, but these errors were encountered: