-
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
Add a dotnet-ref command to enable adding references to the project file #7041
Comments
It would be awesome to also have a sub-verb to update NuGet references / show if an update is available. |
Honestly, I don't see a need for a specialized command just to add a |
@wjk It is a very useful feature of NodeJS to be able to install/uninstall a package from the command line for certain build systems. I would imagine it would be equally useful in dotnet. |
I think if it did support TFM-specific references, this would be highly useful since adding a PackageReference is easy, but getting the condition right from memory not so much (srsly, "do i need to wrap things with apostrophes? do i need brackets for the For adding references, a switch could be added for the target framework:
Use cases:
Logic could be (design needed):
If VS "15", NuGet 4.* VSIX already has logic for that, it could be "borrowed". (Same applies to projects / ProjectReference) |
Tracking issue is dotnet/cli#4746 |
It's possible to add also an option to set also So something like
|
@enricosada I like the proposal. Can you wait on dotnet/cli#4758? We decided to change the calling convention for this class of commands to get back to @rrelyea I believe this ask, having a verb to add a nuget package reference and marking it All<... might be interesting to you. |
@dasMulli Can you open an issue in nuget/home to track the PackageRef update verb you propose? |
@blackdwarf can you update the docs at the top to match the current POR for impl? |
the command is for cli, but is also useful because you can automate things (from ide/tools or script).
|
@piotrpMSFT, can we close this? We already have https://github.com/dotnet/cli/issues/4746 |
Yea, dotnet add p2p is done. @enricosada make sure the add ref features you're asking for get logged in nuget/home. |
The CLI needs to provide a way for users to add project and package references to the project file.
Below is a mini-spec of the command.
Usage
dotnet <operation> <project_or_solution> <command> <project_or_package>
<args>Operations
add
list
remove
update
Commands
project
package
Arguments
Defaults
Arguments
Arguments are here mostly for the
package
command. Arguments are the following:--version | -v
- provides a version for the package to be added. If none is specified,latest
is assumed.--pre-release | -p
- specify whether to check for pre-release packages as well.--frameworks | -f
- place the package reference under the specified framework.--no-restore | -n
- do not restore after the operation completes.Notes
<ProjectReference>
to the project in question.Examples
dotnet add project "../path/to/project.csproj"
dotnet add package package.id --version 1.0.0
dotnet list path/to/project.csproj package
The text was updated successfully, but these errors were encountered: