Implement #:package
manipulation for file-based apps
#49635
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Part of #49200. This PR implements
dotnet package add
anddotnet package remove
.When more logic is shared with NuGet, more
package
-related commands can be implemented and some of the logic here simplified. See NuGet/Home#14390.I've modeled the commands around their project-based counterparts.
package remove
is relatively simple - corresponding#:package
directives are removed from the C# file,Directory.Packages.props
is not considered at all.package add
needs to updateDirectory.Packages.props
if Central Package Management is enabled. It also needs to perform restore. If no version is specified by the user on the command-line, it needs to determine the latest version and put that into the package reference directive.