diff --git a/.openpublishing.redirection.core.json b/.openpublishing.redirection.core.json index 684af380e51d1..cbfa44ee7cecb 100644 --- a/.openpublishing.redirection.core.json +++ b/.openpublishing.redirection.core.json @@ -878,12 +878,12 @@ }, { "source_path_from_root": "/docs/core/preview3/tools/dotnet-add-package.md", - "redirect_url": "/dotnet/core/tools/dotnet-add-package", + "redirect_url": "/dotnet/core/tools/dotnet-package-add", "redirect_document_id": true }, { "source_path_from_root": "/docs/core/preview3/tools/dotnet-add-reference.md", - "redirect_url": "/dotnet/core/tools/dotnet-add-reference", + "redirect_url": "/dotnet/core/tools/dotnet-reference-add", "redirect_document_id": true }, { @@ -901,7 +901,7 @@ }, { "source_path_from_root": "/docs/core/preview3/tools/dotnet-list-reference.md", - "redirect_url": "/dotnet/core/tools/dotnet-list-reference", + "redirect_url": "/dotnet/core/tools/dotnet-reference-list", "redirect_document_id": true }, { @@ -943,12 +943,12 @@ }, { "source_path_from_root": "/docs/core/preview3/tools/dotnet-remove-package.md", - "redirect_url": "/dotnet/core/tools/dotnet-remove-package", + "redirect_url": "/dotnet/core/tools/dotnet-package-remove", "redirect_document_id": true }, { "source_path_from_root": "/docs/core/preview3/tools/dotnet-remove-reference.md", - "redirect_url": "/dotnet/core/tools/dotnet-remove-reference", + "redirect_url": "/dotnet/core/tools/dotnet-reference-remove", "redirect_document_id": true }, { @@ -1056,7 +1056,7 @@ }, { "source_path_from_root": "/docs/core/testing/using-mstest-on-windows.md", - "redirect_url": "/dotnet/core/testing/unit-testing-with-mstest", + "redirect_url": "/dotnet/core/testing/unit-testing-csharp-with-mstest", "redirect_document_id": true }, { @@ -1111,17 +1111,17 @@ }, { "source_path_from_root": "/docs/core/testing/unit-testing-mstest-runner-exit-codes.md", - "redirect_url": "/dotnet/core/testing/unit-testing-platform-exit-codes", + "redirect_url": "/dotnet/core/testing/microsoft-testing-platform-exit-codes", "redirect_document_id": true }, { "source_path_from_root": "/docs/core/testing/unit-testing-mstest-runner-extensions.md", - "redirect_url": "/dotnet/core/testing/unit-testing-platform-extensions", + "redirect_url": "/dotnet/core/testing/microsoft-testing-platform-extensions", "redirect_document_id": true }, { "source_path_from_root": "/docs/core/testing/unit-testing-mstest-runner-integrations.md", - "redirect_url": "/dotnet/core/testing/unit-testing-platform-integration-dotnet-test", + "redirect_url": "/dotnet/core/testing/microsoft-testing-platform-integration-dotnet-test", "redirect_document_id": true }, { @@ -1130,12 +1130,12 @@ }, { "source_path_from_root": "/docs/core/testing/unit-testing-mstest-runner-telemetry.md", - "redirect_url": "/dotnet/core/testing/unit-testing-platform-telemetry", + "redirect_url": "/dotnet/core/testing/microsoft-testing-platform-telemetry", "redirect_document_id": true }, { "source_path_from_root": "/docs/core/testing/unit-testing-mstest-runner-vs-vstest.md", - "redirect_url": "/dotnet/core/testing/unit-testing-platform-vs-vstest", + "redirect_url": "/dotnet/core/testing/microsoft-testing-platform-vs-vstest", "redirect_document_id": true }, { @@ -1151,6 +1151,30 @@ "source_path_from_root": "/docs/core/tools/csproj.md", "redirect_url": "/dotnet/core/project-sdk/msbuild-props" }, + { + "source_path_from_root": "/docs/core/tools/dotnet-add-package.md", + "redirect_url": "/dotnet/core/tools/dotnet-package-add" + }, + { + "source_path_from_root": "/docs/core/tools/dotnet-list-package.md", + "redirect_url": "/dotnet/core/tools/dotnet-package-list" + }, + { + "source_path_from_root": "/docs/core/tools/dotnet-remove-package.md", + "redirect_url": "/dotnet/core/tools/dotnet-package-remove" + }, + { + "source_path_from_root": "/docs/core/tools/dotnet-add-reference.md", + "redirect_url": "/dotnet/core/tools/dotnet-reference-add" + }, + { + "source_path_from_root": "/docs/core/tools/dotnet-list-reference.md", + "redirect_url": "/dotnet/core/tools/dotnet-reference-list" + }, + { + "source_path_from_root": "/docs/core/tools/dotnet-remove-reference.md", + "redirect_url": "/dotnet/core/tools/dotnet-reference-remove" + }, { "source_path_from_root": "/docs/core/tools/extensibility.md", "redirect_url": "/dotnet/core/project-sdk/overview" diff --git a/docs/ai/how-to/app-service-aoai-auth.md b/docs/ai/how-to/app-service-aoai-auth.md index 1774c71503432..d0101ca1b592f 100644 --- a/docs/ai/how-to/app-service-aoai-auth.md +++ b/docs/ai/how-to/app-service-aoai-auth.md @@ -153,11 +153,11 @@ az role assignment create --assignee "" \ 1. Add the following NuGet packages to your app: ```dotnetcli - dotnet add package Azure.Identity - dotnet add package Azure.AI.OpenAI - dotnet add package Microsoft.Extensions.Azure - dotnet add package Microsoft.Extensions.AI - dotnet add package Microsoft.Extensions.AI.OpenAI + dotnet package add Azure.Identity + dotnet package add Azure.AI.OpenAI + dotnet package add Microsoft.Extensions.Azure + dotnet package add Microsoft.Extensions.AI + dotnet package add Microsoft.Extensions.AI.OpenAI ``` The preceding packages each handle the following concerns for this scenario: diff --git a/docs/ai/how-to/content-filtering.md b/docs/ai/how-to/content-filtering.md index 7578093e2b261..99a3c6cd5081b 100644 --- a/docs/ai/how-to/content-filtering.md +++ b/docs/ai/how-to/content-filtering.md @@ -32,7 +32,7 @@ To use the sample code in this article, you need to create and assign a content 1. Add the [`Azure.AI.OpenAI`](https://www.nuget.org/packages/Azure.AI.OpenAI) NuGet package to your project. ```dotnetcli - dotnet add package Azure.AI.OpenAI + dotnet package add Azure.AI.OpenAI ``` 1. Create a simple chat completion flow in your .NET app using the `AzureOpenAiClient`. Replace the `YOUR_MODEL_ENDPOINT` and `YOUR_MODEL_DEPLOYMENT_NAME` values with your own. @@ -49,4 +49,4 @@ The response was filtered due to the prompt triggering Azure OpenAI's content ma * [Create and assign a content filter](/azure/ai-services/openai/how-to/content-filters) * [Content Filtering concepts](/azure/ai-services/openai/concepts/content-filter) -* [Create a chat app](/dotnet/ai/quickstarts/prompt-model) +* [Create a chat app](../quickstarts/prompt-model.md) diff --git a/docs/ai/quickstarts/build-chat-app.md b/docs/ai/quickstarts/build-chat-app.md index ed45ee1acee43..fed425a6f704c 100644 --- a/docs/ai/quickstarts/build-chat-app.md +++ b/docs/ai/quickstarts/build-chat-app.md @@ -54,11 +54,11 @@ Complete the following steps to create a .NET console app to connect to an AI mo :::zone target="docs" pivot="azure-openai" ```bash - dotnet add package Azure.Identity - dotnet add package Azure.AI.OpenAI - dotnet add package Microsoft.Extensions.AI.OpenAI - dotnet add package Microsoft.Extensions.Configuration - dotnet add package Microsoft.Extensions.Configuration.UserSecrets + dotnet package add Azure.Identity + dotnet package add Azure.AI.OpenAI + dotnet package add Microsoft.Extensions.AI.OpenAI + dotnet package add Microsoft.Extensions.Configuration + dotnet package add Microsoft.Extensions.Configuration.UserSecrets ``` :::zone-end @@ -66,10 +66,10 @@ Complete the following steps to create a .NET console app to connect to an AI mo :::zone target="docs" pivot="openai" ```bash - dotnet add package OpenAI - dotnet add package Microsoft.Extensions.AI.OpenAI - dotnet add package Microsoft.Extensions.Configuration - dotnet add package Microsoft.Extensions.Configuration.UserSecrets + dotnet package add OpenAI + dotnet package add Microsoft.Extensions.AI.OpenAI + dotnet package add Microsoft.Extensions.Configuration + dotnet package add Microsoft.Extensions.Configuration.UserSecrets ``` :::zone-end @@ -153,5 +153,5 @@ azd down ## Next steps -- [Quickstart - Chat with a local AI model](/dotnet/ai/quickstarts/chat-local-model) -- [Generate images using AI with .NET](/dotnet/ai/quickstarts/generate-images) +- [Quickstart - Chat with a local AI model](chat-local-model.md) +- [Generate images using AI with .NET](generate-images.md) diff --git a/docs/ai/quickstarts/build-vector-search-app.md b/docs/ai/quickstarts/build-vector-search-app.md index 0f848e2f70083..247205f364e34 100644 --- a/docs/ai/quickstarts/build-vector-search-app.md +++ b/docs/ai/quickstarts/build-vector-search-app.md @@ -70,13 +70,13 @@ Complete the following steps to create a .NET console app that can: :::zone target="docs" pivot="azure-openai" ```bash - dotnet add package Azure.Identity - dotnet add package Azure.AI.OpenAI - dotnet add package Microsoft.Extensions.AI.OpenAI --prerelease - dotnet add package Microsoft.Extensions.VectorData.Abstractions --prerelease - dotnet add package Microsoft.SemanticKernel.Connectors.InMemory --prerelease - dotnet add package Microsoft.Extensions.Configuration - dotnet add package Microsoft.Extensions.Configuration.UserSecrets + dotnet package add Azure.Identity + dotnet package add Azure.AI.OpenAI + dotnet package add Microsoft.Extensions.AI.OpenAI --prerelease + dotnet package add Microsoft.Extensions.VectorData.Abstractions --prerelease + dotnet package add Microsoft.SemanticKernel.Connectors.InMemory --prerelease + dotnet package add Microsoft.Extensions.Configuration + dotnet package add Microsoft.Extensions.Configuration.UserSecrets ``` The following list describes what each package is used for in the `VectorDataAI` app: @@ -93,11 +93,11 @@ Complete the following steps to create a .NET console app that can: :::zone target="docs" pivot="openai" ```bash - dotnet add package Microsoft.Extensions.AI.OpenAI --prerelease - dotnet add package Microsoft.Extensions.VectorData.Abstractions --prerelease - dotnet add package Microsoft.SemanticKernel.Connectors.InMemory --prerelease - dotnet add package Microsoft.Extensions.Configuration - dotnet add package Microsoft.Extensions.Configuration.UserSecrets + dotnet package add Microsoft.Extensions.AI.OpenAI --prerelease + dotnet package add Microsoft.Extensions.VectorData.Abstractions --prerelease + dotnet package add Microsoft.SemanticKernel.Connectors.InMemory --prerelease + dotnet package add Microsoft.Extensions.Configuration + dotnet package add Microsoft.Extensions.Configuration.UserSecrets ``` The following list describes what each package is used for in the `VectorDataAI` app: @@ -205,5 +205,5 @@ azd down ## Next steps -- [Quickstart - Chat with a local AI model](/dotnet/ai/quickstarts/chat-local-model) -- [Generate images using AI with .NET](/dotnet/ai/quickstarts/generate-images) +- [Quickstart - Chat with a local AI model](chat-local-model.md) +- [Generate images using AI with .NET](generate-images.md) diff --git a/docs/ai/quickstarts/chat-local-model.md b/docs/ai/quickstarts/chat-local-model.md index bc7ca0c11e373..779a37107bdc4 100644 --- a/docs/ai/quickstarts/chat-local-model.md +++ b/docs/ai/quickstarts/chat-local-model.md @@ -65,7 +65,7 @@ Complete the following steps to create a .NET console app that connects to your 1. Add the [Microsoft.Extensions.AI.Ollama](https://aka.ms/meai-ollama-nuget) packages to your app: ```dotnetcli - dotnet add package Microsoft.Extensions.AI.Ollama --prerelease + dotnet package add Microsoft.Extensions.AI.Ollama --prerelease ``` 1. Open the new app in your editor of choice, such as Visual Studio Code. diff --git a/docs/ai/quickstarts/create-assistant.md b/docs/ai/quickstarts/create-assistant.md index a91f448eaad4f..8d2df0d207905 100644 --- a/docs/ai/quickstarts/create-assistant.md +++ b/docs/ai/quickstarts/create-assistant.md @@ -72,7 +72,7 @@ Complete the following steps to create a .NET console app and add the package ne 1. Add the [OpenAI](https://www.nuget.org/packages/OpenAI) package to your app: ```dotnetcli - dotnet add package OpenAI --prerelease + dotnet package add OpenAI --prerelease ``` 1. Open the new app in your editor of choice, such as Visual Studio Code. @@ -94,7 +94,7 @@ Complete the following steps to create a .NET console app and add the package ne 1. Add the [Azure.AI.OpenAI](https://www.nuget.org/packages/Azure.AI.OpenAI) package to your app: ```dotnetcli - dotnet add package Azure.AI.OpenAI --prerelease + dotnet package add Azure.AI.OpenAI --prerelease ``` 1. Open the new app in your editor of choice, such as Visual Studio Code. diff --git a/docs/ai/quickstarts/evaluate-ai-response.md b/docs/ai/quickstarts/evaluate-ai-response.md index 387f80454714b..fc473b0a3e5cd 100644 --- a/docs/ai/quickstarts/evaluate-ai-response.md +++ b/docs/ai/quickstarts/evaluate-ai-response.md @@ -35,14 +35,14 @@ Complete the following steps to create an MSTest project that connects to your l 1. Navigate to the `TestAI` directory, and add the necessary packages to your app: ```dotnetcli - dotnet add package Azure.AI.OpenAI - dotnet add package Azure.Identity - dotnet add package Microsoft.Extensions.AI.Abstractions --prerelease - dotnet add package Microsoft.Extensions.AI.Evaluation --prerelease - dotnet add package Microsoft.Extensions.AI.Evaluation.Quality --prerelease - dotnet add package Microsoft.Extensions.AI.OpenAI --prerelease - dotnet add package Microsoft.Extensions.Configuration - dotnet add package Microsoft.Extensions.Configuration.UserSecrets + dotnet package add Azure.AI.OpenAI + dotnet package add Azure.Identity + dotnet package add Microsoft.Extensions.AI.Abstractions --prerelease + dotnet package add Microsoft.Extensions.AI.Evaluation --prerelease + dotnet package add Microsoft.Extensions.AI.Evaluation.Quality --prerelease + dotnet package add Microsoft.Extensions.AI.OpenAI --prerelease + dotnet package add Microsoft.Extensions.Configuration + dotnet package add Microsoft.Extensions.Configuration.UserSecrets ``` 1. Run the following commands to add [app secrets](/aspnet/core/security/app-secrets) for your Azure OpenAI endpoint, model name, and tenant ID: diff --git a/docs/ai/quickstarts/generate-images.md b/docs/ai/quickstarts/generate-images.md index 14616350f68c9..256d41c2f9d7b 100644 --- a/docs/ai/quickstarts/generate-images.md +++ b/docs/ai/quickstarts/generate-images.md @@ -51,9 +51,9 @@ Complete the following steps to create a .NET console app to connect to an AI mo :::zone target="docs" pivot="azure-openai" ```bash - dotnet add package Azure.AI.OpenAI - dotnet add package Microsoft.Extensions.Configuration - dotnet add package Microsoft.Extensions.Configuration.UserSecrets + dotnet package add Azure.AI.OpenAI + dotnet package add Microsoft.Extensions.Configuration + dotnet package add Microsoft.Extensions.Configuration.UserSecrets ``` :::zone-end @@ -61,9 +61,9 @@ Complete the following steps to create a .NET console app to connect to an AI mo :::zone target="docs" pivot="openai" ```bash - dotnet add package OpenAI - dotnet add package Microsoft.Extensions.Configuration - dotnet add package Microsoft.Extensions.Configuration.UserSecrets + dotnet package add OpenAI + dotnet package add Microsoft.Extensions.Configuration + dotnet package add Microsoft.Extensions.Configuration.UserSecrets ``` :::zone-end @@ -105,7 +105,7 @@ Complete the following steps to create a .NET console app to connect to an AI mo :::code language="csharp" source="snippets/image-generation/azure-openai/program.cs" ::: > [!NOTE] - > searches for authentication credentials from your local tooling. If you aren't using the `azd` template to provision the Azure OpenAI resource, you'll need to assign the `Azure AI Developer` role to the account you used to sign-in to Visual Studio or the Azure CLI. For more information, see [Authenticate to Azure AI services with .NET](/dotnet/ai/azure-ai-services-authentication). + > searches for authentication credentials from your local tooling. If you aren't using the `azd` template to provision the Azure OpenAI resource, you'll need to assign the `Azure AI Developer` role to the account you used to sign-in to Visual Studio or the Azure CLI. For more information, see [Authenticate to Azure AI services with .NET](../azure-ai-services-authentication.md). :::zone-end @@ -144,5 +144,5 @@ azd down ## Next steps -- [Quickstart - Build an AI chat app with .NET](/dotnet/ai/quickstarts/build-chat-app) +- [Quickstart - Build an AI chat app with .NET](build-chat-app.md) - [Generate text and conversations with .NET and Azure OpenAI Completions](/training/modules/open-ai-dotnet-text-completions/) diff --git a/docs/ai/quickstarts/prompt-model.md b/docs/ai/quickstarts/prompt-model.md index 76982282aefe2..8000fb327eb92 100644 --- a/docs/ai/quickstarts/prompt-model.md +++ b/docs/ai/quickstarts/prompt-model.md @@ -54,11 +54,11 @@ Complete the following steps to create a .NET console app to connect to an AI mo :::zone target="docs" pivot="azure-openai" ```bash - dotnet add package Azure.Identity - dotnet add package Azure.AI.OpenAI - dotnet add package Microsoft.Extensions.AI.OpenAI - dotnet add package Microsoft.Extensions.Configuration - dotnet add package Microsoft.Extensions.Configuration.UserSecrets + dotnet package add Azure.Identity + dotnet package add Azure.AI.OpenAI + dotnet package add Microsoft.Extensions.AI.OpenAI + dotnet package add Microsoft.Extensions.Configuration + dotnet package add Microsoft.Extensions.Configuration.UserSecrets ``` :::zone-end @@ -66,10 +66,10 @@ Complete the following steps to create a .NET console app to connect to an AI mo :::zone target="docs" pivot="openai" ```bash - dotnet add package OpenAI - dotnet add package Microsoft.Extensions.AI.OpenAI - dotnet add package Microsoft.Extensions.Configuration - dotnet add package Microsoft.Extensions.Configuration.UserSecrets + dotnet package add OpenAI + dotnet package add Microsoft.Extensions.AI.OpenAI + dotnet package add Microsoft.Extensions.Configuration + dotnet package add Microsoft.Extensions.Configuration.UserSecrets ``` :::zone-end @@ -113,7 +113,7 @@ The app uses the [`Microsoft.Extensions.AI`](https://www.nuget.org/packages/Micr :::code language="csharp" source="snippets/prompt-completion/azure-openai/program.cs" range="1-12"::: > [!NOTE] - > searches for authentication credentials from your local tooling. If you aren't using the `azd` template to provision the Azure OpenAI resource, you'll need to assign the `Azure AI Developer` role to the account you used to sign-in to Visual Studio or the Azure CLI. For more information, see [Authenticate to Azure AI services with .NET](/dotnet/ai/azure-ai-services-authentication). + > searches for authentication credentials from your local tooling. If you aren't using the `azd` template to provision the Azure OpenAI resource, you'll need to assign the `Azure AI Developer` role to the account you used to sign-in to Visual Studio or the Azure CLI. For more information, see [Authenticate to Azure AI services with .NET](../azure-ai-services-authentication.md). :::zone-end @@ -153,5 +153,5 @@ azd down ## Next steps -- [Quickstart - Build an AI chat app with .NET](/dotnet/ai/quickstarts/build-chat-app) +- [Quickstart - Build an AI chat app with .NET](build-chat-app.md) - [Generate text and conversations with .NET and Azure OpenAI Completions](/training/modules/open-ai-dotnet-text-completions/) diff --git a/docs/ai/quickstarts/use-function-calling.md b/docs/ai/quickstarts/use-function-calling.md index 060630ca79cdf..eae26394359a5 100644 --- a/docs/ai/quickstarts/use-function-calling.md +++ b/docs/ai/quickstarts/use-function-calling.md @@ -54,12 +54,12 @@ Complete the following steps to create a .NET console app to connect to an AI mo :::zone target="docs" pivot="azure-openai" ```bash - dotnet add package Azure.Identity - dotnet add package Azure.AI.OpenAI - dotnet add package Microsoft.Extensions.AI --prerelease - dotnet add package Microsoft.Extensions.AI.OpenAI --prerelease - dotnet add package Microsoft.Extensions.Configuration - dotnet add package Microsoft.Extensions.Configuration.UserSecrets + dotnet package add Azure.Identity + dotnet package add Azure.AI.OpenAI + dotnet package add Microsoft.Extensions.AI --prerelease + dotnet package add Microsoft.Extensions.AI.OpenAI --prerelease + dotnet package add Microsoft.Extensions.Configuration + dotnet package add Microsoft.Extensions.Configuration.UserSecrets ``` :::zone-end @@ -67,10 +67,10 @@ Complete the following steps to create a .NET console app to connect to an AI mo :::zone target="docs" pivot="openai" ```bash - dotnet add package Microsoft.Extensions.AI --prerelease - dotnet add package Microsoft.Extensions.AI.OpenAI --prerelease - dotnet add package Microsoft.Extensions.Configuration - dotnet add package Microsoft.Extensions.Configuration.UserSecrets + dotnet package add Microsoft.Extensions.AI --prerelease + dotnet package add Microsoft.Extensions.AI.OpenAI --prerelease + dotnet package add Microsoft.Extensions.Configuration + dotnet package add Microsoft.Extensions.Configuration.UserSecrets ``` :::zone-end @@ -154,5 +154,5 @@ azd down ## Next steps -- [Quickstart - Build an AI chat app with .NET](/dotnet/ai/quickstarts/build-chat-app) +- [Quickstart - Build an AI chat app with .NET](build-chat-app.md) - [Generate text and conversations with .NET and Azure OpenAI Completions](/training/modules/open-ai-dotnet-text-completions/) diff --git a/docs/ai/semantic-kernel-dotnet-overview.md b/docs/ai/semantic-kernel-dotnet-overview.md index 94eff8d840040..95f11b2f3f03f 100644 --- a/docs/ai/semantic-kernel-dotnet-overview.md +++ b/docs/ai/semantic-kernel-dotnet-overview.md @@ -27,7 +27,7 @@ The Semantic Kernel SDK is available as a NuGet package for .NET and integrates Install the [`Microsoft.SemanticKernel`](https://www.nuget.org/packages/Microsoft.SemanticKernel) package using the following command: ```dotnetcli -dotnet add package Microsoft.SemanticKernel +dotnet package add Microsoft.SemanticKernel ``` > [!NOTE] @@ -213,5 +213,5 @@ foreach (var fact in facts) { The preceding code loads a set of facts into memory so that the data is available to use when interacting with AI models and orchestrating tasks. >[!div class="step-by-step"] ->[Quickstart - Summarize text with OpenAI](/dotnet/ai/quickstarts/prompt-model) ->[Quickstart - Chat with your data](/dotnet/ai/quickstarts/build-vector-search-app) +>[Quickstart - Summarize text with OpenAI](quickstarts/prompt-model.md) +>[Quickstart - Chat with your data](quickstarts/build-vector-search-app.md) diff --git a/docs/ai/tutorials/evaluate-with-reporting.md b/docs/ai/tutorials/evaluate-with-reporting.md index d597527ba7150..ca475f2ce4975 100644 --- a/docs/ai/tutorials/evaluate-with-reporting.md +++ b/docs/ai/tutorials/evaluate-with-reporting.md @@ -32,15 +32,15 @@ Complete the following steps to create an MSTest project that connects to the `g 1. Navigate to the `TestAIWithReporting` directory, and add the necessary packages to your app: ```dotnetcli - dotnet add package Azure.AI.OpenAI - dotnet add package Azure.Identity - dotnet add package Microsoft.Extensions.AI.Abstractions --prerelease - dotnet add package Microsoft.Extensions.AI.Evaluation --prerelease - dotnet add package Microsoft.Extensions.AI.Evaluation.Quality --prerelease - dotnet add package Microsoft.Extensions.AI.Evaluation.Reporting --prerelease - dotnet add package Microsoft.Extensions.AI.OpenAI --prerelease - dotnet add package Microsoft.Extensions.Configuration - dotnet add package Microsoft.Extensions.Configuration.UserSecrets + dotnet package add Azure.AI.OpenAI + dotnet package add Azure.Identity + dotnet package add Microsoft.Extensions.AI.Abstractions --prerelease + dotnet package add Microsoft.Extensions.AI.Evaluation --prerelease + dotnet package add Microsoft.Extensions.AI.Evaluation.Quality --prerelease + dotnet package add Microsoft.Extensions.AI.Evaluation.Reporting --prerelease + dotnet package add Microsoft.Extensions.AI.OpenAI --prerelease + dotnet package add Microsoft.Extensions.Configuration + dotnet package add Microsoft.Extensions.Configuration.UserSecrets ``` 1. Run the following commands to add [app secrets](/aspnet/core/security/app-secrets) for your Azure OpenAI endpoint, model name, and tenant ID: diff --git a/docs/architecture/modern-web-apps-azure/work-with-data-in-asp-net-core-apps.md b/docs/architecture/modern-web-apps-azure/work-with-data-in-asp-net-core-apps.md index 53cd139f8e50b..b3607af6a100e 100644 --- a/docs/architecture/modern-web-apps-azure/work-with-data-in-asp-net-core-apps.md +++ b/docs/architecture/modern-web-apps-azure/work-with-data-in-asp-net-core-apps.md @@ -23,13 +23,13 @@ If you're writing a new ASP.NET Core application that needs to work with relatio To use EF Core with a SQL Server database, run the following dotnet CLI command: ```dotnetcli -dotnet add package Microsoft.EntityFrameworkCore.SqlServer +dotnet package add Microsoft.EntityFrameworkCore.SqlServer ``` To add support for an InMemory data source, for testing: ```dotnetcli -dotnet add package Microsoft.EntityFrameworkCore.InMemory +dotnet package add Microsoft.EntityFrameworkCore.InMemory ``` ### The DbContext diff --git a/docs/core/additional-tools/dotnet-svcutil.xmlserializer-guide.md b/docs/core/additional-tools/dotnet-svcutil.xmlserializer-guide.md index 14655be2e52e2..29e2cccf7eda9 100644 --- a/docs/core/additional-tools/dotnet-svcutil.xmlserializer-guide.md +++ b/docs/core/additional-tools/dotnet-svcutil.xmlserializer-guide.md @@ -46,7 +46,7 @@ To use `dotnet-svcutil.xmlserializer` in a .NET Core console application: 3. Add a package reference to `System.ServiceModel.Http` by running the following command: ```dotnetcli - dotnet add package System.ServiceModel.Http + dotnet package add System.ServiceModel.Http ``` 4. Add the WCF Client code: @@ -77,13 +77,13 @@ To use `dotnet-svcutil.xmlserializer` in a .NET Core console application: ``` 5. Add a reference to the `dotnet-svcutil.xmlserializer` package by running the following command: - + ```dotnetcli - dotnet add package dotnet-svcutil.xmlserializer + dotnet package add dotnet-svcutil.xmlserializer ``` Running the command should add an entry to your project file similar to this: - + ```xml diff --git a/docs/core/additional-tools/xml-serializer-generator.md b/docs/core/additional-tools/xml-serializer-generator.md index cab05fde355a1..897f391d15e7b 100644 --- a/docs/core/additional-tools/xml-serializer-generator.md +++ b/docs/core/additional-tools/xml-serializer-generator.md @@ -40,13 +40,13 @@ The following instructions show you how to use XML Serializer Generator in a .NE dotnet new console ``` -2. Use the [`dotnet add package`](../tools/dotnet-add-package.md) command to add a reference to the Microsoft.XmlSerializer.Generator package. +2. Use the [`dotnet package add`](../tools/dotnet-package-add.md) command to add a reference to the Microsoft.XmlSerializer.Generator package. ```dotnetcli - dotnet add package Microsoft.XmlSerializer.Generator -v 8.0.0 + dotnet package add Microsoft.XmlSerializer.Generator -v 8.0.0 ``` - After running the [`dotnet add package`](../tools/dotnet-add-package.md) command, the following lines are added to your *MyApp.csproj* project file: + After running the [`dotnet package add`](../tools/dotnet-package-add.md) command, the following lines are added to your *MyApp.csproj* project file: ```xml diff --git a/docs/core/deploying/deploy-with-cli.md b/docs/core/deploying/deploy-with-cli.md index c8f27597ff567..011086e88fae2 100644 --- a/docs/core/deploying/deploy-with-cli.md +++ b/docs/core/deploying/deploy-with-cli.md @@ -57,7 +57,7 @@ You can use the following app to explore the publishing commands. The app is cre mkdir apptest1 cd apptest1 dotnet new console -dotnet add package Figgle +dotnet package add Figgle ``` The `Program.cs` or `Program.vb` file that is generated by the console template needs to be changed to the following: diff --git a/docs/core/diagnostics/distributed-tracing-collection-walkthroughs.md b/docs/core/diagnostics/distributed-tracing-collection-walkthroughs.md index bcbcf1345b8f1..250b5443154da 100644 --- a/docs/core/diagnostics/distributed-tracing-collection-walkthroughs.md +++ b/docs/core/diagnostics/distributed-tracing-collection-walkthroughs.md @@ -45,10 +45,10 @@ if we browse the web page. To use OpenTelemetry, you need to add references to several NuGet packages. ```dotnetcli -dotnet add package OpenTelemetry -dotnet add package OpenTelemetry.Exporter.Console -dotnet add package OpenTelemetry.Extensions.Hosting -dotnet add package OpenTelemetry.Instrumentation.AspNetCore +dotnet package add OpenTelemetry +dotnet package add OpenTelemetry.Exporter.Console +dotnet package add OpenTelemetry.Extensions.Hosting +dotnet package add OpenTelemetry.Instrumentation.AspNetCore ``` Next, modify the source code in *Program.cs* so it looks like this: @@ -206,7 +206,7 @@ Example work done Add the [OpenTelemetry.Exporter.Console](https://www.nuget.org/packages/OpenTelemetry.Exporter.Console/) NuGet package. ```dotnetcli -dotnet add package OpenTelemetry.Exporter.Console +dotnet package add OpenTelemetry.Exporter.Console ``` Update Program.cs with additional OpenTelemetry `using` directives: diff --git a/docs/core/diagnostics/distributed-tracing-instrumentation-walkthroughs.md b/docs/core/diagnostics/distributed-tracing-instrumentation-walkthroughs.md index 6a0f350db2407..d5e18efa7ac9b 100644 --- a/docs/core/diagnostics/distributed-tracing-instrumentation-walkthroughs.md +++ b/docs/core/diagnostics/distributed-tracing-instrumentation-walkthroughs.md @@ -32,15 +32,15 @@ Applications that target .NET 5 and later already have the necessary distributed version 5 or greater. For libraries targeting netstandard, we recommend referencing the oldest version of the package which is still supported and contains the APIs your library needs. ```dotnetcli -dotnet add package System.Diagnostics.DiagnosticSource +dotnet package add System.Diagnostics.DiagnosticSource ``` Add the [OpenTelemetry](https://www.nuget.org/packages/OpenTelemetry/) and [OpenTelemetry.Exporter.Console](https://www.nuget.org/packages/OpenTelemetry.Exporter.Console/) NuGet packages, which will be used to collect the telemetry. ```dotnetcli -dotnet add package OpenTelemetry -dotnet add package OpenTelemetry.Exporter.Console +dotnet package add OpenTelemetry +dotnet package add OpenTelemetry.Exporter.Console ``` Replace the contents of the generated Program.cs with this example source: diff --git a/docs/core/diagnostics/metrics-collection.md b/docs/core/diagnostics/metrics-collection.md index f041c4a03c223..45a35cbed3fd2 100644 --- a/docs/core/diagnostics/metrics-collection.md +++ b/docs/core/diagnostics/metrics-collection.md @@ -28,7 +28,7 @@ Before metrics can be collected, measurements must be produced. This tutorial cr ```dotnetcli dotnet new console -o metric-instr cd metric-instr -dotnet add package System.Diagnostics.DiagnosticSource +dotnet package add System.Diagnostics.DiagnosticSource ``` Replace the contents of `Program.cs` with the following code: @@ -132,7 +132,7 @@ This tutorial shows one of the integrations available for OpenTelemetry metrics Add a reference to the OpenTelemetry Prometheus exporter to the example app: ```dotnetcli -dotnet add package OpenTelemetry.Exporter.Prometheus.HttpListener --prerelease +dotnet package add OpenTelemetry.Exporter.Prometheus.HttpListener --prerelease ``` > [!NOTE] diff --git a/docs/core/diagnostics/metrics-instrumentation.md b/docs/core/diagnostics/metrics-instrumentation.md index 219580e22e141..77ae839576384 100644 --- a/docs/core/diagnostics/metrics-instrumentation.md +++ b/docs/core/diagnostics/metrics-instrumentation.md @@ -26,7 +26,7 @@ version 8 or greater. Applications that target .NET 8+ include this reference by ```dotnetcli > dotnet new console -> dotnet add package System.Diagnostics.DiagnosticSource +> dotnet package add System.Diagnostics.DiagnosticSource ``` ```csharp @@ -302,14 +302,14 @@ Press p to pause, r to resume, q to quit. Name Current Value [HatCo.Store] - hatco.store.coats_sold (Count) 8,181 - hatco.store.hats_sold (Count) 548 + hatco.store.coats_sold (Count) 8,181 + hatco.store.hats_sold (Count) 548 hatco.store.order_processing_time Percentile - 50 0.012 - 95 0.013 + 50 0.012 + 95 0.013 99 0.013 - hatco.store.orders_pending 9 + hatco.store.orders_pending 9 ``` This example uses some randomly generated numbers so your values will vary a bit. Dotnet-counters renders Histogram instruments as three percentile statistics (50th, 95th, and 99th) but other tools might summarize the distribution differently or offer more configuration options. @@ -460,7 +460,7 @@ Name Current Value hatco.store.hats_sold (Count) product.color product.size blue 19 73 - red 12 146 + red 12 146 ``` For ObservableCounter and ObservableGauge, tagged measurements can be provided in the callback passed to the constructor: @@ -507,7 +507,7 @@ Name Current Value customer.country Italy 6 Mexico 1 - Spain 3 + Spain 3 ``` ### Best practices diff --git a/docs/core/extensions/artificial-intelligence.md b/docs/core/extensions/artificial-intelligence.md index 1a5ea49818d8d..6d07d1bfd4206 100644 --- a/docs/core/extensions/artificial-intelligence.md +++ b/docs/core/extensions/artificial-intelligence.md @@ -22,7 +22,7 @@ To install the [📦 Microsoft.Extensions.AI](https://www.nuget.org/packages/Mic ### [.NET CLI](#tab/dotnet-cli) ```dotnetcli -dotnet add package Microsoft.Extensions.AI --prerelease +dotnet package add Microsoft.Extensions.AI --prerelease ``` ### [PackageReference](#tab/package-reference) @@ -34,7 +34,7 @@ dotnet add package Microsoft.Extensions.AI --prerelease --- -For more information, see [dotnet add package](../tools/dotnet-add-package.md) or [Manage package dependencies in .NET applications](../tools/dependencies.md). +For more information, see [dotnet package add](../tools/dotnet-package-add.md) or [Manage package dependencies in .NET applications](../tools/dependencies.md). ## The `IChatClient` interface @@ -267,7 +267,7 @@ In this way, the `RateLimitingEmbeddingGenerator` can be composed with other `IE - [Develop .NET applications with AI features](../../ai/get-started/dotnet-ai-overview.md) - [Unified AI building blocks for .NET using Microsoft.Extensions.AI](../../ai/ai-extensions.md) -- [Build an AI chat app with .NET](/dotnet/ai/quickstarts/build-chat-app) +- [Build an AI chat app with .NET](../../ai/quickstarts/build-chat-app.md) - [.NET dependency injection](dependency-injection.md) - [Rate limit an HTTP handler in .NET](http-ratelimiter.md) - [.NET Generic Host](generic-host.md) diff --git a/docs/core/extensions/configuration.md b/docs/core/extensions/configuration.md index 5ad5de50f6c36..7f8964e3bf01a 100644 --- a/docs/core/extensions/configuration.md +++ b/docs/core/extensions/configuration.md @@ -32,7 +32,7 @@ Given one or more configuration sources, the and related types. +.NET console applications created using the [dotnet new](../tools/dotnet-new.md) command template or Visual Studio by default *don't* expose configuration capabilities. To add configuration in a new .NET console application, [add a package reference](../tools/dotnet-package-add.md) to [Microsoft.Extensions.Configuration](https://www.nuget.org/packages/Microsoft.Extensions.Configuration). This package is the foundation for configuration in .NET apps. It provides the and related types. :::code source="snippets/configuration/console-basic-builder/Program.cs"::: @@ -47,7 +47,7 @@ While this example uses an in-memory configuration, there are many configuration ### Alternative hosting approach -Commonly, your apps will do more than just read configuration. They'll likely use dependency injection, logging, and other services. The [.NET Generic Host](generic-host.md) approach is recommended for apps that use these services. Instead, consider [adding a package reference](../tools/dotnet-add-package.md) to [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting). Modify the *Program.cs* file to match the following code: +Commonly, your apps will do more than just read configuration. They'll likely use dependency injection, logging, and other services. The [.NET Generic Host](generic-host.md) approach is recommended for apps that use these services. Instead, consider [adding a package reference](../tools/dotnet-package-add.md) to [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting). Modify the *Program.cs* file to match the following code: :::code source="snippets/configuration/console/Program.cs" highlight="3"::: diff --git a/docs/core/extensions/data-classification.md b/docs/core/extensions/data-classification.md index 2c8012be8feed..4b51d5ea0aa57 100644 --- a/docs/core/extensions/data-classification.md +++ b/docs/core/extensions/data-classification.md @@ -20,7 +20,7 @@ To get started, install the [📦 Microsoft.Extensions.Compliance.Abstractions]( ### [.NET CLI](#tab/dotnet-cli) ```dotnetcli -dotnet add package Microsoft.Extensions.Compliance.Abstractions +dotnet package add Microsoft.Extensions.Compliance.Abstractions ``` ### [PackageReference](#tab/package-reference) diff --git a/docs/core/extensions/data-redaction.md b/docs/core/extensions/data-redaction.md index 9f655f3d31163..f190e5b74331f 100644 --- a/docs/core/extensions/data-redaction.md +++ b/docs/core/extensions/data-redaction.md @@ -15,7 +15,7 @@ To get started, install the [📦 Microsoft.Extensions.Compliance.Redaction](htt ### [.NET CLI](#tab/dotnet-cli) ```dotnetcli -dotnet add package Microsoft.Extensions.Compliance.Redaction +dotnet package add Microsoft.Extensions.Compliance.Redaction ``` ### [PackageReference](#tab/package-reference) diff --git a/docs/core/extensions/service-discovery.md b/docs/core/extensions/service-discovery.md index aa8be70c16dae..431837d7423bf 100644 --- a/docs/core/extensions/service-discovery.md +++ b/docs/core/extensions/service-discovery.md @@ -18,7 +18,7 @@ To get started with service discovery in .NET, install the [Microsoft.Extensions ### [.NET CLI](#tab/dotnet-cli) ```dotnetcli -dotnet add package Microsoft.Extensions.ServiceDiscovery --prerelease +dotnet package add Microsoft.Extensions.ServiceDiscovery --prerelease ``` ### [PackageReference](#tab/package-reference) @@ -30,7 +30,7 @@ dotnet add package Microsoft.Extensions.ServiceDiscovery --prerelease --- -For more information, see [dotnet add package](../tools/dotnet-add-package.md) or [Manage package dependencies in .NET applications](../tools/dependencies.md). +For more information, see [dotnet package add](../tools/dotnet-package-add.md) or [Manage package dependencies in .NET applications](../tools/dependencies.md). ## Example usage diff --git a/docs/core/extensions/windows-service-with-installer.md b/docs/core/extensions/windows-service-with-installer.md index 9f7e5d3a1863a..284dc32fb6d59 100644 --- a/docs/core/extensions/windows-service-with-installer.md +++ b/docs/core/extensions/windows-service-with-installer.md @@ -65,13 +65,13 @@ Open the solution in Visual Studio, and select F5 to ensure that the The Windows Service app needs to handle installation switches. The setup project will call into the Windows Service app with `/Install` and `/Uninstall` switches during installation and uninstallation respectively. When these switches are present, the app will behave differently, in that it will only perform installation or uninstallation using the Windows Service Control Manager executable (_sc.exe_). -For the app to call a separate process, install the [CliWrap](https://www.nuget.org/packages/CliWrap) NuGet package as a convenience. To install the `CliWrap` package, use the `dotnet add package` command: +For the app to call a separate process, install the [CliWrap](https://www.nuget.org/packages/CliWrap) NuGet package as a convenience. To install the `CliWrap` package, use the `dotnet package add` command: ```dotnetcli dotnet add App.WindowsService.csproj package CliWrap ``` -For more information, see [dotnet add package](../tools/dotnet-add-package.md). +For more information, see [dotnet package add](../tools/dotnet-package-add.md). With `CliWrap` installed, open the _Program.cs_ file of the `App.WindowsService` project. After the `using` directives, but before the `IHost` is created, add the following code: diff --git a/docs/core/extensions/windows-service.md b/docs/core/extensions/windows-service.md index 7fe5374a3d578..fa9358421c26d 100644 --- a/docs/core/extensions/windows-service.md +++ b/docs/core/extensions/windows-service.md @@ -40,13 +40,13 @@ In this tutorial, you'll learn how to: To interop with native Windows Services from .NET implementations, you'll need to install the [`Microsoft.Extensions.Hosting.WindowsServices` NuGet package](https://nuget.org/packages/Microsoft.Extensions.Hosting.WindowsServices). -To install this from Visual Studio, use the **Manage NuGet Packages...** dialog. Search for "Microsoft.Extensions.Hosting.WindowsServices", and install it. If you'd rather use the .NET CLI, run the `dotnet add package` command: +To install this from Visual Studio, use the **Manage NuGet Packages...** dialog. Search for "Microsoft.Extensions.Hosting.WindowsServices", and install it. If you'd rather use the .NET CLI, run the `dotnet package add` command: ```dotnetcli -dotnet add package Microsoft.Extensions.Hosting.WindowsServices +dotnet package add Microsoft.Extensions.Hosting.WindowsServices ``` -For more information on the .NET CLI add package command, see [dotnet add package](../tools/dotnet-add-package.md). +For more information on the .NET CLI add package command, see [dotnet package add](../tools/dotnet-package-add.md). After successfully adding the packages, your project file should now contain the following package references: diff --git a/docs/core/resilience/http-resilience.md b/docs/core/resilience/http-resilience.md index 79180e12e0cbb..fac10e59d27ef 100644 --- a/docs/core/resilience/http-resilience.md +++ b/docs/core/resilience/http-resilience.md @@ -17,7 +17,7 @@ To use resilience-patterns in HTTP apps, install the [Microsoft.Extensions.Http. ### [.NET CLI](#tab/dotnet-cli) ```dotnetcli -dotnet add package Microsoft.Extensions.Http.Resilience --version 8.0.0 +dotnet package add Microsoft.Extensions.Http.Resilience --version 8.0.0 ``` ### [PackageReference](#tab/package-reference) @@ -28,7 +28,7 @@ dotnet add package Microsoft.Extensions.Http.Resilience --version 8.0.0 --- -For more information, see [dotnet add package](../tools/dotnet-add-package.md) or [Manage package dependencies in .NET applications](../tools/dependencies.md). +For more information, see [dotnet package add](../tools/dotnet-package-add.md) or [Manage package dependencies in .NET applications](../tools/dependencies.md). ## Add resilience to an HTTP client diff --git a/docs/core/resilience/index.md b/docs/core/resilience/index.md index 383031621938b..4d3293d4fc26e 100644 --- a/docs/core/resilience/index.md +++ b/docs/core/resilience/index.md @@ -27,7 +27,7 @@ To get started with resilience in .NET, install the [Microsoft.Extensions.Resili ### [.NET CLI](#tab/dotnet-cli) ```dotnetcli -dotnet add package Microsoft.Extensions.Resilience --version 8.0.0 +dotnet package add Microsoft.Extensions.Resilience --version 8.0.0 ``` ### [PackageReference](#tab/package-reference) @@ -38,7 +38,7 @@ dotnet add package Microsoft.Extensions.Resilience --version 8.0.0 --- -For more information, see [dotnet add package](../tools/dotnet-add-package.md) or [Manage package dependencies in .NET applications](../tools/dependencies.md). +For more information, see [dotnet package add](../tools/dotnet-package-add.md) or [Manage package dependencies in .NET applications](../tools/dependencies.md). ## Build a resilience pipeline diff --git a/docs/core/testing/unit-testing-code-coverage.md b/docs/core/testing/unit-testing-code-coverage.md index 0acfa449a5221..98d255fb42345 100644 --- a/docs/core/testing/unit-testing-code-coverage.md +++ b/docs/core/testing/unit-testing-code-coverage.md @@ -73,7 +73,7 @@ dotnet new xunit -n XUnit.Coverlet.Collector dotnet new xunit -n XUnit.Coverlet.MSBuild ``` -Both of the newly created xUnit test projects need to add a project reference of the *Numbers* class library. This is so that the test projects have access to the *PrimeService* for testing. From the command prompt, use the [`dotnet add`](../tools/dotnet-add-reference.md) command: +Both of the newly created xUnit test projects need to add a project reference of the *Numbers* class library. This is so that the test projects have access to the *PrimeService* for testing. From the command prompt, use the [`dotnet add`](../tools/dotnet-reference-add.md) command: ```dotnetcli dotnet add XUnit.Coverlet.Collector\XUnit.Coverlet.Collector.csproj reference Numbers\Numbers.csproj @@ -83,10 +83,10 @@ dotnet add XUnit.Coverlet.Collector\XUnit.Coverlet.Collector.csproj reference Nu dotnet add XUnit.Coverlet.MSBuild\XUnit.Coverlet.MSBuild.csproj reference Numbers\Numbers.csproj ``` -The *MSBuild* project is named appropriately, as it will depend on the [coverlet.msbuild](https://www.nuget.org/packages/coverlet.msbuild) NuGet package. Add this package dependency by running the [`dotnet add package`](../tools/dotnet-add-package.md) command: +The *MSBuild* project is named appropriately, as it will depend on the [coverlet.msbuild](https://www.nuget.org/packages/coverlet.msbuild) NuGet package. Add this package dependency by running the [`dotnet package add`](../tools/dotnet-package-add.md) command: ```dotnetcli -cd XUnit.Coverlet.MSBuild && dotnet add package coverlet.msbuild && cd .. +cd XUnit.Coverlet.MSBuild && dotnet package add coverlet.msbuild && cd .. ``` The previous command changed directories effectively scoping to the *MSBuild* test project, then added the NuGet package. When that was done, it then changed directories, stepping up one level. diff --git a/docs/core/testing/unit-testing-csharp-with-mstest.md b/docs/core/testing/unit-testing-csharp-with-mstest.md index 859ffe1b97212..69376c64f1d28 100644 --- a/docs/core/testing/unit-testing-csharp-with-mstest.md +++ b/docs/core/testing/unit-testing-csharp-with-mstest.md @@ -72,10 +72,10 @@ Make the *PrimeService.Tests* directory the current directory and create a new p The test project requires other packages to create and run unit tests. `dotnet new` in the previous step added the necessary MSTest packages and tools for code coverage reporting. -Add the `PrimeService` class library as another dependency to the project. Use the [`dotnet add reference`](../tools/dotnet-add-reference.md) command: +Add the `PrimeService` class library as another dependency to the project. Use the [`dotnet reference add`](../tools/dotnet-reference-add.md) command: ```dotnetcli -dotnet add reference ../PrimeService/PrimeService.csproj +dotnet reference add ../PrimeService/PrimeService.csproj ``` You can see the entire file in the [samples repository](https://github.com/dotnet/samples/blob/main/core/getting-started/unit-testing-using-mstest/PrimeService.Tests/PrimeService.Tests.csproj) on GitHub. diff --git a/docs/core/testing/unit-testing-csharp-with-nunit.md b/docs/core/testing/unit-testing-csharp-with-nunit.md index 1eee945534622..0e0f1f48763f7 100644 --- a/docs/core/testing/unit-testing-csharp-with-nunit.md +++ b/docs/core/testing/unit-testing-csharp-with-nunit.md @@ -86,10 +86,10 @@ The [dotnet new](../tools/dotnet-new.md) command creates a test project that use > [!NOTE] > Prior to .NET 9, the generated code may reference older versions of the NUnit test framework. You may use [dotnet CLI](/nuget/consume-packages/install-use-packages-dotnet-cli) to update the packages. Alternatively, open the *PrimeService.Tests.csproj* file and replace the contents of the package references item group with the code above. -The test project requires other packages to create and run unit tests. The `dotnet new` command in the previous step added the Microsoft test SDK, the NUnit test framework, and the NUnit test adapter. Now, add the `PrimeService` class library as another dependency to the project. Use the [`dotnet add reference`](../tools/dotnet-add-reference.md) command: +The test project requires other packages to create and run unit tests. The `dotnet new` command in the previous step added the Microsoft test SDK, the NUnit test framework, and the NUnit test adapter. Now, add the `PrimeService` class library as another dependency to the project. Use the [`dotnet reference add`](../tools/dotnet-reference-add.md) command: ```dotnetcli -dotnet add reference ../PrimeService/PrimeService.csproj +dotnet reference add ../PrimeService/PrimeService.csproj ``` You can see the entire file in the [samples repository](https://github.com/dotnet/samples/blob/main/core/getting-started/unit-testing-using-nunit/PrimeService.Tests/PrimeService.Tests.csproj) on GitHub. diff --git a/docs/core/testing/unit-testing-csharp-with-xunit.md b/docs/core/testing/unit-testing-csharp-with-xunit.md index 1d7d887ac8b12..b58ec4df2cb2b 100644 --- a/docs/core/testing/unit-testing-csharp-with-xunit.md +++ b/docs/core/testing/unit-testing-csharp-with-xunit.md @@ -44,7 +44,7 @@ The following instructions provide the steps to create the test solution. See [C The [`dotnet new classlib`](../tools/dotnet-new.md) command creates a new class library project in the *PrimeService* folder. The new class library will contain the code to be tested. * Rename *Class1.cs* to *PrimeService.cs*. * Replace the code in *PrimeService.cs* with the following code: - + ```csharp using System; @@ -95,7 +95,7 @@ The following instructions provide the steps to create the test solution. See [C * Add the `PrimeService` class library as a dependency to the *PrimeService.Tests* project: ```dotnetcli - dotnet add ./PrimeService.Tests/PrimeService.Tests.csproj reference ./PrimeService/PrimeService.csproj + dotnet add ./PrimeService.Tests/PrimeService.Tests.csproj reference ./PrimeService/PrimeService.csproj ``` @@ -227,4 +227,4 @@ The completed `IsPrime` method is not an efficient algorithm for testing primali - [xUnit.net official site](https://xunit.net) - [Testing controller logic in ASP.NET Core](/aspnet/core/mvc/controllers/testing) -- [`dotnet add reference`](../tools/dotnet-add-reference.md) +- [`dotnet reference add`](../tools/dotnet-reference-add.md) diff --git a/docs/core/testing/unit-testing-fsharp-with-mstest.md b/docs/core/testing/unit-testing-fsharp-with-mstest.md index 692b511275f5c..16567f4c2b6dc 100644 --- a/docs/core/testing/unit-testing-fsharp-with-mstest.md +++ b/docs/core/testing/unit-testing-fsharp-with-mstest.md @@ -56,10 +56,10 @@ Make the *MathService.Tests* directory the current directory and create a new pr ``` -The test project requires other packages to create and run unit tests. `dotnet new` in the previous step added MSTest. Now, add the `MathService` class library as another dependency to the project. Use the `dotnet add reference` command: +The test project requires other packages to create and run unit tests. `dotnet new` in the previous step added MSTest. Now, add the `MathService` class library as another dependency to the project. Use the `dotnet reference add` command: ```dotnetcli -dotnet add reference ../MathService/MathService.fsproj +dotnet reference add ../MathService/MathService.fsproj ``` You can see the entire file in the [samples repository](https://github.com/dotnet/samples/blob/main/core/getting-started/unit-testing-with-fsharp/MathService.Tests/MathService.Tests.fsproj) on GitHub. @@ -179,5 +179,5 @@ You've built a small library and a set of unit tests for that library. You've st - [dotnet new](../tools/dotnet-new.md) - [dotnet sln](../tools/dotnet-sln.md) -- [dotnet add reference](../tools/dotnet-add-reference.md) +- [dotnet reference add](../tools/dotnet-reference-add.md) - [dotnet test](../tools/dotnet-test.md) diff --git a/docs/core/testing/unit-testing-fsharp-with-nunit.md b/docs/core/testing/unit-testing-fsharp-with-nunit.md index 5b814d6fd6922..357e1912e445a 100644 --- a/docs/core/testing/unit-testing-fsharp-with-nunit.md +++ b/docs/core/testing/unit-testing-fsharp-with-nunit.md @@ -82,10 +82,10 @@ This command creates a test project that uses NUnit as the test framework. The g ``` -The test project requires other packages to create and run unit tests. `dotnet new` in the previous step added NUnit and the NUnit test adapter. Now, add the `MathService` class library as another dependency to the project. Use the `dotnet add reference` command: +The test project requires other packages to create and run unit tests. `dotnet new` in the previous step added NUnit and the NUnit test adapter. Now, add the `MathService` class library as another dependency to the project. Use the `dotnet reference add` command: ```dotnetcli -dotnet add reference ../MathService/MathService.fsproj +dotnet reference add ../MathService/MathService.fsproj ``` You can see the entire file in the [samples repository](https://github.com/dotnet/samples/blob/main/core/getting-started/unit-testing-with-fsharp/MathService.Tests/MathService.Tests.fsproj) on GitHub. @@ -204,5 +204,5 @@ You've built a small library and a set of unit tests for that library. You struc ## See also -- [dotnet add reference](../tools/dotnet-add-reference.md) +- [dotnet reference add](../tools/dotnet-reference-add.md) - [dotnet test](../tools/dotnet-test.md) diff --git a/docs/core/testing/unit-testing-fsharp-with-xunit.md b/docs/core/testing/unit-testing-fsharp-with-xunit.md index 5749e5bff72bb..064366680b4e4 100644 --- a/docs/core/testing/unit-testing-fsharp-with-xunit.md +++ b/docs/core/testing/unit-testing-fsharp-with-xunit.md @@ -56,10 +56,10 @@ Make the *MathService.Tests* directory the current directory and create a new pr ``` -The test project requires other packages to create and run unit tests. `dotnet new` in the previous step added xUnit and the xUnit runner. Now, add the `MathService` class library as another dependency to the project. Use the `dotnet add reference` command: +The test project requires other packages to create and run unit tests. `dotnet new` in the previous step added xUnit and the xUnit runner. Now, add the `MathService` class library as another dependency to the project. Use the `dotnet reference add` command: ```dotnetcli -dotnet add reference ../MathService/MathService.fsproj +dotnet reference add ../MathService/MathService.fsproj ``` You can see the entire file in the [samples repository](https://github.com/dotnet/samples/blob/main/core/getting-started/unit-testing-with-fsharp/MathService.Tests/MathService.Tests.fsproj) on GitHub. @@ -165,5 +165,5 @@ You've built a small library and a set of unit tests for that library. You've st - [dotnet new](../tools/dotnet-new.md) - [dotnet sln](../tools/dotnet-sln.md) -- [dotnet add reference](../tools/dotnet-add-reference.md) +- [dotnet reference add](../tools/dotnet-reference-add.md) - [dotnet test](../tools/dotnet-test.md) diff --git a/docs/core/testing/unit-testing-visual-basic-with-mstest.md b/docs/core/testing/unit-testing-visual-basic-with-mstest.md index 00502c36afc7e..d00c8b2a4bdd2 100644 --- a/docs/core/testing/unit-testing-visual-basic-with-mstest.md +++ b/docs/core/testing/unit-testing-visual-basic-with-mstest.md @@ -61,10 +61,10 @@ Make the *PrimeService.Tests* directory the current directory and create a new p ``` -The test project requires other packages to create and run unit tests. `dotnet new` in the previous step added MSTest. Now, add the `PrimeService` class library as another dependency to the project. Use the [`dotnet add reference`](../tools/dotnet-add-reference.md) command: +The test project requires other packages to create and run unit tests. `dotnet new` in the previous step added MSTest. Now, add the `PrimeService` class library as another dependency to the project. Use the [`dotnet reference add`](../tools/dotnet-reference-add.md) command: ```dotnetcli -dotnet add reference ../PrimeService/PrimeService.vbproj +dotnet reference add ../PrimeService/PrimeService.vbproj ``` You can see the entire file in the [samples repository](https://github.com/dotnet/samples/blob/main/core/getting-started/unit-testing-vb-mstest/PrimeService.Tests/PrimeService.Tests.vbproj) on GitHub. diff --git a/docs/core/testing/unit-testing-visual-basic-with-nunit.md b/docs/core/testing/unit-testing-visual-basic-with-nunit.md index df8f6a21c0773..b77be0dd92341 100644 --- a/docs/core/testing/unit-testing-visual-basic-with-nunit.md +++ b/docs/core/testing/unit-testing-visual-basic-with-nunit.md @@ -81,10 +81,10 @@ The [dotnet new](../tools/dotnet-new.md) command creates a test project that use > [!NOTE] > Prior to .NET 9, the generated code may reference older versions of the NUnit test framework. You may use [dotnet CLI](/nuget/consume-packages/install-use-packages-dotnet-cli) to update the packages. Alternatively, open the *PrimeService.Tests.vbproj* file and replace the contents of the package references item group with the code above. -The test project requires other packages to create and run unit tests. `dotnet new` in the previous step added NUnit and the NUnit test adapter. Now, add the `PrimeService` class library as another dependency to the project. Use the [`dotnet add reference`](../tools/dotnet-add-reference.md) command: +The test project requires other packages to create and run unit tests. `dotnet new` in the previous step added NUnit and the NUnit test adapter. Now, add the `PrimeService` class library as another dependency to the project. Use the [`dotnet reference add`](../tools/dotnet-reference-add.md) command: ```dotnetcli -dotnet add reference ../PrimeService/PrimeService.vbproj +dotnet reference add ../PrimeService/PrimeService.vbproj ``` You can see the entire file in the [samples repository](https://github.com/dotnet/samples/blob/main/core/getting-started/unit-testing-vb-nunit/PrimeService.Tests/PrimeService.Tests.vbproj) on GitHub. diff --git a/docs/core/testing/unit-testing-visual-basic-with-xunit.md b/docs/core/testing/unit-testing-visual-basic-with-xunit.md index 47af09d290ba3..5ffa3df78abcf 100644 --- a/docs/core/testing/unit-testing-visual-basic-with-xunit.md +++ b/docs/core/testing/unit-testing-visual-basic-with-xunit.md @@ -44,10 +44,10 @@ The following instructions provide the steps to create the test solution. See [C The [`dotnet new classlib`](../tools/dotnet-new.md) command creates a new class library project in the *PrimeService* folder. The new class library will contain the code to be tested. * Rename *Class1.vb* to *PrimeService.vb*. * Replace the code in *PrimeService.vb* with the following code: - + ```vb Imports System - + Namespace Prime.Services Public Class PrimeService Public Function IsPrime(candidate As Integer) As Boolean @@ -91,7 +91,7 @@ The following instructions provide the steps to create the test solution. See [C * Add the `PrimeService` class library as a dependency to the *PrimeService.Tests* project: ```dotnetcli - dotnet add ./PrimeService.Tests/PrimeService.Tests.vbproj reference ./PrimeService/PrimeService.vbproj + dotnet add ./PrimeService.Tests/PrimeService.Tests.vbproj reference ./PrimeService/PrimeService.vbproj ``` @@ -224,4 +224,4 @@ The completed `IsPrime` method is not an efficient algorithm for testing primali - [xUnit.net official site](https://xunit.net/) - [Testing controller logic in ASP.NET Core](/aspnet/core/mvc/controllers/testing) -- [`dotnet add reference`](../tools/dotnet-add-reference.md) +- [`dotnet reference add`](../tools/dotnet-reference-add.md) diff --git a/docs/core/tools/dependencies.md b/docs/core/tools/dependencies.md index d0386ef0ed1ad..68fe69994eb92 100644 --- a/docs/core/tools/dependencies.md +++ b/docs/core/tools/dependencies.md @@ -1,7 +1,7 @@ --- title: Manage package dependencies in .NET description: Explains how to manage NuGet package dependencies for a .NET application. -no-loc: [dotnet add package, dotnet remove package, dotnet list package] +no-loc: [dotnet package add, dotnet package remove, dotnet package list] ms.topic: how-to ms.date: 01/28/2021 --- @@ -53,16 +53,16 @@ To remove a dependency, remove its `` item from the project fi ### Use the CLI -To add a dependency, run the [dotnet add package](dotnet-add-package.md) command, as shown in the following example: +To add a dependency, run the [dotnet package add](dotnet-package-add.md) command, as shown in the following example: ```dotnetcli -dotnet add package Microsoft.EntityFrameworkCore +dotnet package add Microsoft.EntityFrameworkCore ``` -To remove a dependency, run the [dotnet remove package](dotnet-remove-package.md) command, as shown in the following example: +To remove a dependency, run the [dotnet package remove](dotnet-package-remove.md) command, as shown in the following example: ```dotnetcli -dotnet remove package Microsoft.EntityFrameworkCore +dotnet package remove Microsoft.EntityFrameworkCore ``` ## Tips @@ -77,5 +77,5 @@ dotnet remove package Microsoft.EntityFrameworkCore ## See also * [Package references in project files](../project-sdk/msbuild-props.md#reference-related-properties) -* [dotnet list package command](dotnet-list-package.md) +* [dotnet package list command](dotnet-package-list.md) * [Dependencies (library guidance)](../../standard/library-guidance/dependencies.md) diff --git a/docs/core/tools/dotnet-list-reference.md b/docs/core/tools/dotnet-list-reference.md deleted file mode 100644 index 2ab39806996d9..0000000000000 --- a/docs/core/tools/dotnet-list-reference.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -title: dotnet list reference command -description: The dotnet list reference command provides a convenient option to list project to project references. -ms.date: 02/14/2020 ---- -# dotnet list reference - -**This article applies to:** ✔️ .NET Core 3.1 SDK and later versions - -## Name - -`dotnet list reference` - Lists project-to-project references. - -## Synopsis - -```dotnetcli -dotnet list [] reference - -dotnet list -h|--help -``` - -## Description - -The `dotnet list reference` command provides a convenient option to list project references for a given project. - -## Arguments - -* **`PROJECT`** - - The project file to operate on. If a file is not specified, the command will search the current directory for one. - -## Options - -[!INCLUDE [help](../../../includes/cli-help.md)] - -## Examples - -* List the project references for the specified project: - - ```dotnetcli - dotnet list app/app.csproj reference - ``` - -* List the project references for the project in the current directory: - - ```dotnetcli - dotnet list reference - ``` diff --git a/docs/core/tools/dotnet-add-package.md b/docs/core/tools/dotnet-package-add.md similarity index 84% rename from docs/core/tools/dotnet-add-package.md rename to docs/core/tools/dotnet-package-add.md index aded0480bcd83..1754c42c4bc95 100644 --- a/docs/core/tools/dotnet-add-package.md +++ b/docs/core/tools/dotnet-package-add.md @@ -1,30 +1,33 @@ --- -title: dotnet add package command -description: The 'dotnet add package' command provides a convenient option to add a NuGet package reference to a project. -ms.date: 04/13/2022 +title: dotnet package add command +description: The 'dotnet package add' command provides a convenient option to add a NuGet package reference to a project. +ms.date: 04/02/2025 --- -# dotnet add package +# dotnet package add **This article applies to:** ✔️ .NET Core 3.1 SDK and later versions ## Name -`dotnet add package` - Adds or updates a package reference in a project file. +`dotnet package add` - Adds or updates a package reference in a project file. + +> [!NOTE] +> If you're using .NET 9 SDK or earlier, use the "verb first" form (`dotnet add package`) instead. The "noun first" form was introduced in .NET 10. For more information, see [More consistent command order](../whats-new/dotnet-10/sdk.md#more-consistent-command-order). ## Synopsis ```dotnetcli -dotnet add [] package - [-f|--framework ] [--interactive] +dotnet package add + [-f|--framework ] [--interactive] [--project ] [-n|--no-restore] [--package-directory ] [--prerelease] [-s|--source ] [-v|--version ] -dotnet add package -h|--help +dotnet package add -h|--help ``` ## Description -The `dotnet add package` command provides a convenient option to add or update a package reference in a project file. When you run the command, there's a compatibility check to ensure the package is compatible with the frameworks in the project. If the check passes and the package isn't referenced in the project file, a `` element is added to the project file. If the check passes and the package is already referenced in the project file, the `` element is updated to the latest compatible version. After the project file is updated, [dotnet restore](dotnet-restore.md) is run. +The `dotnet package add` command provides a convenient option to add or update a package reference in a project file. When you run the command, there's a compatibility check to ensure the package is compatible with the frameworks in the project. If the check passes and the package isn't referenced in the project file, a `` element is added to the project file. If the check passes and the package is already referenced in the project file, the `` element is updated to the latest compatible version. After the project file is updated, [dotnet restore](dotnet-restore.md) is run. For example, adding `Microsoft.EntityFrameworkCore` to *ToDo.csproj* produces output similar to the following example: @@ -57,7 +60,7 @@ The following scenarios are currently supported. These examples assume that the Scenario 1: `` does not exist in the project file, `` element does not exist in the `Directory.Packages.props file`, and the version argument is not passed from the commandline. - CLI command that is executed: `dotnet add ToDo.csproj package Microsoft.EntityFrameworkCore` + CLI command that is executed: `dotnet package add Microsoft.EntityFrameworkCore --project ToDo.csproj` The `` element is added to the `Directory.Packages.props file`. @@ -73,7 +76,7 @@ Scenario 1: `` does not exist in the project file, `` does not exist in the project file, `` element does not exist in the `Directory.Packages.props file`, and the version argument is passed from the commandline. - CLI command that is executed: `dotnet add ToDo.csproj package Microsoft.EntityFrameworkCore --version 5.0.4` + CLI command that is executed: `dotnet package add Microsoft.EntityFrameworkCore --version 5.0.4 --project ToDo.csproj` The `` element is added to the `Directory.Packages.props file`. @@ -89,7 +92,7 @@ Scenario 2: `` does not exist in the project file, `` does not exist in the project file, `` element does exist in the `Directory.Packages.props file`, and the version argument is not passed from the commandline. - CLI command that is executed: `dotnet add ToDo.csproj package Microsoft.EntityFrameworkCore` + CLI command that is executed: `dotnet package add Microsoft.EntityFrameworkCore --project ToDo.csproj` The `` element is added to the `Directory.Packages.props file`. @@ -105,7 +108,7 @@ The `` element is added to the project file. Scenario 4: `` does not exist in the project file, `` element does exist in the `Directory.Packages.props file`, and the version argument is passed from the commandline. - CLI command that is executed: `dotnet add ToDo.csproj package Microsoft.EntityFrameworkCore --version 5.0.4` + CLI command that is executed: `dotnet package add Microsoft.EntityFrameworkCore --version 5.0.4 --project ToDo.csproj` The `` element is added to the `Directory.Packages.props file`. @@ -168,19 +171,19 @@ Scenario 4: `` does not exist in the project file, ` [!NOTE] +> If you're using .NET 9 SDK or earlier, use the "verb first" form (`dotnet list package`) instead. The "noun first" form was introduced in .NET 10. For more information, see [More consistent command order](../whats-new/dotnet-10/sdk.md#more-consistent-command-order). ## Synopsis ```dotnetcli -dotnet list [|] package [--config ] - [--deprecated] +dotnet package list [--config ] + [--deprecated] [--project [|]] [-f|--framework ] [--highest-minor] [--highest-patch] [--include-prerelease] [--include-transitive] [--interactive] [--outdated] [--source ] [-v|--verbosity ] @@ -23,12 +26,12 @@ dotnet list [|] package [--config ] [--format ] [--output-version ] -dotnet list package -h|--help +dotnet package list -h|--help ``` ## Description -The `dotnet list package` command provides a convenient option to list all NuGet package references for a specific project or a solution. You first need to build the project in order to have the assets needed for this command to process. The following example shows the output of the `dotnet list package` command for the [SentimentAnalysis](https://github.com/dotnet/samples/tree/main/machine-learning/tutorials/SentimentAnalysis) project: +The `dotnet package list` command provides a convenient option to list all NuGet package references for a specific project or a solution. You first need to build the project in order to have the assets needed for this command to process. The following example shows the output of the `dotnet package list` command for the [SentimentAnalysis](https://github.com/dotnet/samples/tree/main/machine-learning/tutorials/SentimentAnalysis) project: ```output Project 'SentimentAnalysis' has the following package references @@ -42,9 +45,9 @@ Project 'SentimentAnalysis' has the following package references The **Requested** column refers to the package version specified in the project file and can be a range. The **Resolved** column lists the version that the project is currently using and is always a single value. The packages displaying an `(A)` right next to their names represent implicit package references that are inferred from your project settings (`Sdk` type, or `` or `` property). -Use the `--outdated` option to find out if there are newer versions available of the packages you're using in your projects. By default, `--outdated` lists the latest stable packages unless the resolved version is also a prerelease version. To include prerelease versions when listing newer versions, also specify the `--include-prerelease` option. To update a package to the latest version, use [dotnet add package](dotnet-add-package.md). +Use the `--outdated` option to find out if there are newer versions available of the packages you're using in your projects. By default, `--outdated` lists the latest stable packages unless the resolved version is also a prerelease version. To include prerelease versions when listing newer versions, also specify the `--include-prerelease` option. To update a package to the latest version, use [dotnet package add](dotnet-package-add.md). -The following example shows the output of the `dotnet list package --outdated --include-prerelease` command for the same project as the previous example: +The following example shows the output of the `dotnet package list --outdated --include-prerelease` command for the same project as the previous example: ```output The following sources were used: @@ -57,7 +60,7 @@ Project `SentimentAnalysis` has the following updates to its packages > Microsoft.ML 1.4.0 1.4.0 1.5.0-preview ``` -If you need to find out whether your project has transitive dependencies, use the `--include-transitive` option. Transitive dependencies occur when you add a package to your project that in turn relies on another package. The following example shows the output from running the `dotnet list package --include-transitive` command for the [HelloPlugin](https://github.com/dotnet/samples/tree/main/core/extensions/AppWithPlugin/HelloPlugin) project, which displays top-level packages and the packages they depend on: +If you need to find out whether your project has transitive dependencies, use the `--include-transitive` option. Transitive dependencies occur when you add a package to your project that in turn relies on another package. The following example shows the output from running the `dotnet package list --include-transitive` command for the [HelloPlugin](https://github.com/dotnet/samples/tree/main/core/extensions/AppWithPlugin/HelloPlugin) project, which displays top-level packages and the packages they depend on: ```output Project 'HelloPlugin' has the following package references @@ -81,7 +84,7 @@ The project or solution file to operate on. If not specified, the command search - **`--deprecated`** Displays packages that have been deprecated. - + - **`-f|--framework `** Displays only the packages applicable for the specified [target framework](../../standard/frameworks.md). To specify multiple frameworks, repeat the option multiple times. For example: `--framework net6.0 --framework netstandard2.0`. The short form of the option (`-f`) is available starting in .NET 9 SDK. @@ -136,41 +139,41 @@ The project or solution file to operate on. If not specified, the command search - List package references of a specific project: ```dotnetcli - dotnet list SentimentAnalysis.csproj package + dotnet package list --project SentimentAnalysis.csproj ``` - List package references that have newer versions available, including prerelease versions: ```dotnetcli - dotnet list package --outdated --include-prerelease + dotnet package list --outdated --include-prerelease ``` - List package references for a specific target framework: ```dotnetcli - dotnet list package --framework netcoreapp3.0 + dotnet package list --framework netcoreapp3.0 ``` - List package references in machine readable json output format: ```dotnetcli - dotnet list package --format json + dotnet package list --format json ``` - List package references for a specific target framework in machine readable json output format: ```dotnetcli - dotnet list package --framework netcoreapp3.0 --format json + dotnet package list --framework netcoreapp3.0 --format json ``` - Save machine readable json output of package references, including transitive dependency and vulnerability details into a file: ```dotnetcli - dotnet list package --include-transitive --vulnerable --format json >> dependencyReport.json + dotnet package list --include-transitive --vulnerable --format json >> dependencyReport.json ``` - List package references in machine readable json output format with output version 1: ```dotnetcli - dotnet list package --format json --output-version 1 + dotnet package list --format json --output-version 1 ``` diff --git a/docs/core/tools/dotnet-package-remove.md b/docs/core/tools/dotnet-package-remove.md new file mode 100644 index 0000000000000..11fbd48aa8f45 --- /dev/null +++ b/docs/core/tools/dotnet-package-remove.md @@ -0,0 +1,49 @@ +--- +title: dotnet package remove command +description: The dotnet package remove command provides a convenient option to remove NuGet package reference to a project. +ms.date: 04/02/2025 +--- +# dotnet package remove + +**This article applies to:** ✔️ .NET Core 3.1 SDK and later versions + +## Name + +`dotnet package remove` - Removes package reference from a project file. + +> [!NOTE] +> If you're using .NET 9 SDK or earlier, use the "verb first" form (`dotnet remove package`) instead. The "noun first" form was introduced in .NET 10. For more information, see [More consistent command order](../whats-new/dotnet-10/sdk.md#more-consistent-command-order). + +## Synopsis + +```dotnetcli +dotnet package remove [--project ] + +dotnet package remove -h|--help +``` + +## Description + +The `dotnet package remove` command provides a convenient option to remove a NuGet package reference from a project. + +## Arguments + +`PROJECT` + +Specifies the project file. If not specified, the command searches the current directory for one. + +`PACKAGE_NAME` + +The package reference to remove. + +## Options + +[!INCLUDE [help](../../../includes/cli-help.md)] + +## Examples + +- Remove `Newtonsoft.Json` NuGet package from a project in the current directory: + + ```dotnetcli + dotnet package remove Newtonsoft.Json + ``` diff --git a/docs/core/tools/dotnet-add-reference.md b/docs/core/tools/dotnet-reference-add.md similarity index 69% rename from docs/core/tools/dotnet-add-reference.md rename to docs/core/tools/dotnet-reference-add.md index 49c15814fae55..296dcf07d7397 100644 --- a/docs/core/tools/dotnet-add-reference.md +++ b/docs/core/tools/dotnet-reference-add.md @@ -1,28 +1,31 @@ --- -title: dotnet add reference command -description: The dotnet add reference command provides a convenient option to add project-to-project references. -ms.date: 03/21/2023 +title: dotnet reference add command +description: The dotnet reference add command provides a convenient option to add project-to-project references. +ms.date: 04/02/2025 --- -# dotnet add reference +# dotnet reference add **This article applies to:** ✔️ .NET Core 3.1 SDK and later versions ## Name -`dotnet add reference` - Adds project-to-project (P2P) references. +`dotnet reference add` - Adds project-to-project (P2P) references. + +> [!NOTE] +> If you're using .NET 9 SDK or earlier, use the "verb first" form (`dotnet add reference`) instead. The "noun first" form was introduced in .NET 10. For more information, see [More consistent command order](../whats-new/dotnet-10/sdk.md#more-consistent-command-order). ## Synopsis ```dotnetcli -dotnet add [] reference [-f|--framework ] - [--interactive] +dotnet reference add reference [-f|--framework ] + [--interactive] [--project ] -dotnet add reference -h|--help +dotnet reference add -h|--help ``` ## Description -The `dotnet add reference` command provides a convenient option to add project references to a project. After running the command, the `` elements are added to the project file. +The `dotnet reference add` command provides a convenient option to add project references to a project. After running the command, the `` elements are added to the project file. ```xml @@ -70,7 +73,7 @@ There's no CLI command to add a reference to an assembly that isn't in a project - Add a project reference: ```dotnetcli - dotnet add app/app.csproj reference lib/lib.csproj + dotnet reference add lib/lib.csproj --project app/app.csproj ``` - Add a compatible .NET language (for example, F#) project reference, which works in both directions: @@ -82,11 +85,11 @@ There's no CLI command to add a reference to an assembly that isn't in a project - Add multiple project references to the project in the current directory: ```dotnetcli - dotnet add reference lib1/lib1.csproj lib2/lib2.csproj + dotnet reference add lib1/lib1.csproj lib2/lib2.csproj ``` - Add multiple project references using a globbing pattern on Linux/Unix: ```dotnetcli - dotnet add app/app.csproj reference **/*.csproj + dotnet reference add **/*.csproj --project app/app.csproj ``` diff --git a/docs/core/tools/dotnet-reference-list.md b/docs/core/tools/dotnet-reference-list.md new file mode 100644 index 0000000000000..81e234d2c7ca8 --- /dev/null +++ b/docs/core/tools/dotnet-reference-list.md @@ -0,0 +1,51 @@ +--- +title: dotnet reference list command +description: The dotnet reference list command provides a convenient option to list project to project references. +ms.date: 04/02/2025 +--- +# dotnet reference list + +**This article applies to:** ✔️ .NET Core 3.1 SDK and later versions + +## Name + +`dotnet reference list` - Lists project-to-project references. + +> [!NOTE] +> If you're using .NET 9 SDK or earlier, use the "verb first" form (`dotnet list reference`) instead. The "noun first" form was introduced in .NET 10. For more information, see [More consistent command order](../whats-new/dotnet-10/sdk.md#more-consistent-command-order). + +## Synopsis + +```dotnetcli +dotnet reference list [--project ] + +dotnet reference list -h|--help +``` + +## Description + +The `dotnet reference list` command provides a convenient option to list project references for a given project. + +## Arguments + +* **`PROJECT`** + + The project file to operate on. If a file is not specified, the command will search the current directory for one. + +## Options + +[!INCLUDE [help](../../../includes/cli-help.md)] + +## Examples + +* List the project references for the specified project: + + ```dotnetcli + dotnet reference list --project app/app.csproj + ``` + +* List the project references for the project in the current directory: + + ```dotnetcli + dotnet reference list + ``` diff --git a/docs/core/tools/dotnet-remove-reference.md b/docs/core/tools/dotnet-reference-remove.md similarity index 56% rename from docs/core/tools/dotnet-remove-reference.md rename to docs/core/tools/dotnet-reference-remove.md index ac9d7f117cf92..85e1302b4c42e 100644 --- a/docs/core/tools/dotnet-remove-reference.md +++ b/docs/core/tools/dotnet-reference-remove.md @@ -1,28 +1,31 @@ --- -title: dotnet remove reference command -description: The dotnet remove reference command provides a convenient option to remove project to project references. -ms.date: 02/14/2020 +title: dotnet reference remove command +description: The dotnet reference remove command provides a convenient option to remove project to project references. +ms.date: 04/02/2025 --- -# dotnet remove reference +# dotnet reference remove **This article applies to:** ✔️ .NET Core 3.1 SDK and later versions ## Name -`dotnet remove reference` - Removes project-to-project (P2P) references. +`dotnet reference remove` - Removes project-to-project (P2P) references. + +> [!NOTE] +> If you're using .NET 9 SDK or earlier, use the "verb first" form (`dotnet reference remove`) instead. The "noun first" form was introduced in .NET 10. For more information, see [More consistent command order](../whats-new/dotnet-10/sdk.md#more-consistent-command-order). ## Synopsis ```dotnetcli -dotnet remove [] reference [-f|--framework ] +dotnet reference remove [-f|--framework ] [--project ] -dotnet remove reference -h|--help +dotnet reference remove -h|--help ``` ## Description -The `dotnet remove reference` command provides a convenient option to remove project references from a project. +The `dotnet reference remove` command provides a convenient option to remove project references from a project. ## Arguments @@ -47,17 +50,17 @@ Project-to-project (P2P) references to remove. You can specify one or multiple p - Remove a project reference from the specified project: ```dotnetcli - dotnet remove app/app.csproj reference lib/lib.csproj + dotnet reference remove lib/lib.csproj --project app/app.csproj ``` - Remove multiple project references from the project in the current directory: ```dotnetcli - dotnet remove reference lib1/lib1.csproj lib2/lib2.csproj + dotnet reference remove lib1/lib1.csproj lib2/lib2.csproj ``` - Remove multiple project references using a glob pattern on Unix/Linux: ```dotnetcli - dotnet remove app/app.csproj reference **/*.csproj` + dotnet reference remove **/*.csproj` --project app/app.csproj ``` diff --git a/docs/core/tools/dotnet-remove-package.md b/docs/core/tools/dotnet-remove-package.md deleted file mode 100644 index 905654ca72e03..0000000000000 --- a/docs/core/tools/dotnet-remove-package.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -title: dotnet remove package command -description: The dotnet remove package command provides a convenient option to remove NuGet package reference to a project. -ms.date: 02/14/2020 ---- -# dotnet remove package - -**This article applies to:** ✔️ .NET Core 3.1 SDK and later versions - -## Name - -`dotnet remove package` - Removes package reference from a project file. - -## Synopsis - -```dotnetcli -dotnet remove [] package - -dotnet remove package -h|--help -``` - -## Description - -The `dotnet remove package` command provides a convenient option to remove a NuGet package reference from a project. - -## Arguments - -`PROJECT` - -Specifies the project file. If not specified, the command searches the current directory for one. - -`PACKAGE_NAME` - -The package reference to remove. - -## Options - -[!INCLUDE [help](../../../includes/cli-help.md)] - -## Examples - -- Remove `Newtonsoft.Json` NuGet package from a project in the current directory: - - ```dotnetcli - dotnet remove package Newtonsoft.Json - ``` diff --git a/docs/core/tools/dotnet.md b/docs/core/tools/dotnet.md index 479f77d911fdc..6c4dbd9346af8 100644 --- a/docs/core/tools/dotnet.md +++ b/docs/core/tools/dotnet.md @@ -1,7 +1,7 @@ --- title: dotnet command description: Learn about the dotnet command (the generic driver for the .NET CLI) and its usage. -ms.date: 05/06/2022 +ms.date: 04/01/2025 --- # dotnet command @@ -182,16 +182,18 @@ The following options are available only when `dotnet` runs an application by us | Command | Function | |-------------------------------------------------------|------------------------------| -| [dotnet add reference](dotnet-add-reference.md) | Adds a project reference. | -| [dotnet list reference](dotnet-list-reference.md) | Lists project references. | -| [dotnet remove reference](dotnet-remove-reference.md) | Removes a project reference. | +| [dotnet reference add](dotnet-reference-add.md) | Adds a project reference. | +| [dotnet reference list](dotnet-reference-list.md) | Lists project references. | +| [dotnet reference remove](dotnet-reference-remove.md) | Removes a project reference. | ### NuGet packages -| Command | Function | -|---------------------------------------------------|--------------------------| -| [dotnet add package](dotnet-add-package.md) | Adds a NuGet package. | -| [dotnet remove package](dotnet-remove-package.md) | Removes a NuGet package. | +| Command | Function | +|---------------------------------------------------|-------------------------------| +| [dotnet package add](dotnet-package-add.md) | Adds a NuGet package. | +| [dotnet package list](dotnet-package-add.md) | Lists NuGet packages. | +| [dotnet package remove](dotnet-package-remove.md) | Removes a NuGet package. | +| [dotnet package search](dotnet-package-search.md) | Searches for a NuGet package. | ### NuGet commands diff --git a/docs/core/tools/enable-tab-autocomplete.md b/docs/core/tools/enable-tab-autocomplete.md index 6e3c37b48f232..77e90dcad542b 100644 --- a/docs/core/tools/enable-tab-autocomplete.md +++ b/docs/core/tools/enable-tab-autocomplete.md @@ -30,13 +30,13 @@ If that command doesn't work, make sure that .NET Core 2.0 SDK or later is insta Here are some examples of what tab completion provides: -Input | becomes | because -:------------------------------------|:----------------------------------------------------------------------------|:-------------------------------- -`dotnet a⇥` | `dotnet add` | `add` is the first subcommand, alphabetically. -`dotnet add p⇥` | `dotnet add --help` | Tab completion matches substrings and `--help` comes first alphabetically. -`dotnet add p⇥⇥` | `dotnet add package` | Pressing tab a second time brings up the next suggestion. -`dotnet add package Microsoft⇥` | `dotnet add package Microsoft.ApplicationInsights.Web` | Results are returned alphabetically. -`dotnet remove reference ⇥` | `dotnet remove reference ..\..\src\OmniSharp.DotNet\OmniSharp.DotNet.csproj` | Tab completion is project file aware. +| Input | Becomes | Because | +|:----------------|:--------------------|:-----------------------------------------------| +| `dotnet a⇥` | `dotnet add` | `add` is the first subcommand, alphabetically. | +| `dotnet add p⇥` | `dotnet add --help` | Tab completion matches substrings, and `--help` comes first alphabetically. | +| `dotnet add p⇥⇥` | `dotnet add package` | Pressing tab a second time brings up the next suggestion. | +| `dotnet package add Microsoft⇥` | `dotnet package add Microsoft.ApplicationInsights.Web` | Results are returned alphabetically. | +| `dotnet reference remove ⇥` | `dotnet reference remove ..\..\src\OmniSharp.DotNet\OmniSharp.DotNet.csproj` | Tab completion is project file aware. | ## PowerShell diff --git a/docs/core/tools/index.md b/docs/core/tools/index.md index b609ae6a84eae..33c8da824c4bc 100644 --- a/docs/core/tools/index.md +++ b/docs/core/tools/index.md @@ -3,8 +3,7 @@ title: .NET CLI titleSuffix: "" description: An overview of the .NET CLI and its features. ms.topic: overview -ms.date: 12/14/2022 -ms.custom: devdivchpfy22 +ms.date: 04/02/2025 --- # .NET CLI overview @@ -75,12 +74,13 @@ The following commands are installed by default: ### Project modification commands -- [`add package`](dotnet-add-package.md) -- [`add reference`](dotnet-add-reference.md) -- [`remove package`](dotnet-remove-package.md) -- [`remove reference`](dotnet-remove-reference.md) -- [`list package`](dotnet-list-package.md) -- [`list reference`](dotnet-list-reference.md) +- [`package add`](dotnet-package-add.md) +- [`package list`](dotnet-package-list.md) +- [`package remove`](dotnet-package-remove.md) +- [`package search`](dotnet-package-search.md) +- [`reference add`](dotnet-reference-add.md) +- [`reference list`](dotnet-reference-list.md) +- [`reference remove`](dotnet-reference-remove.md) ### NuGet commands diff --git a/docs/core/tutorials/libraries.md b/docs/core/tutorials/libraries.md index c9d5f72174623..c043661b226d9 100644 --- a/docs/core/tutorials/libraries.md +++ b/docs/core/tutorials/libraries.md @@ -231,7 +231,7 @@ It's important to be able to test across platforms. You can use either [xUnit](h ```dotnetcli cd MyProject.Test - dotnet add reference ../MyProject/MyProject.csproj + dotnet reference add ../MyProject/MyProject.csproj ``` 1. Restore packages and build projects: @@ -307,7 +307,7 @@ This will add the three projects above and a solution file that links them toget The best way to reference a project is to use the .NET CLI to add a project reference. From the **AwesomeLibrary.CSharp** and **AwesomeLibrary.FSharp** project directories, you can run the following command: ```dotnetcli -dotnet add reference ../AwesomeLibrary.Core/AwesomeLibrary.Core.csproj +dotnet reference add ../AwesomeLibrary.Core/AwesomeLibrary.Core.csproj ``` The project files for both **AwesomeLibrary.CSharp** and **AwesomeLibrary.FSharp** will now reference **AwesomeLibrary.Core** as a `ProjectReference` target. You can verify this by inspecting the project files and seeing the following in them: diff --git a/docs/core/tutorials/testing-with-cli.md b/docs/core/tutorials/testing-with-cli.md index b68d60816f528..cf087dbe403de 100644 --- a/docs/core/tutorials/testing-with-cli.md +++ b/docs/core/tutorials/testing-with-cli.md @@ -105,10 +105,10 @@ The `NewTypes` project is in place, and you've organized it by keeping the pets- Navigate back to the *src* folder and create a *test* folder with a *NewTypesTests* folder within it. At a command prompt from the *NewTypesTests* folder, execute `dotnet new xunit`. This command produces two files: *NewTypesTests.csproj* and *UnitTest1.cs*. -The test project can't currently test the types in `NewTypes` and requires a project reference to the `NewTypes` project. To add a project reference, use the [`dotnet add reference`](../tools/dotnet-add-reference.md) command: +The test project can't currently test the types in `NewTypes` and requires a project reference to the `NewTypes` project. To add a project reference, use the [`dotnet reference add`](../tools/dotnet-reference-add.md) command: ```dotnetcli -dotnet add reference ../../src/NewTypes/NewTypes.csproj +dotnet reference add ../../src/NewTypes/NewTypes.csproj ``` Or, you also have the option of manually adding the project reference by adding an `` node to the *NewTypesTests.csproj* file: diff --git a/docs/core/whats-new/dotnet-10/sdk.md b/docs/core/whats-new/dotnet-10/sdk.md index 05a30043f17e3..1a0b14fdfb6b5 100644 --- a/docs/core/whats-new/dotnet-10/sdk.md +++ b/docs/core/whats-new/dotnet-10/sdk.md @@ -26,15 +26,15 @@ While this feature is enabled by default for the listed TFMs, you can disable it ## More consistent command order -Starting in .NET 10, the `dotnet` CLI tool includes new aliases for common commands to make them easier to remember and type. The new commands are: - -- `dotnet package add` -- `dotnet package list` -- `dotnet package remove` -- `dotnet reference add` -- `dotnet reference list` -- `dotnet reference remove` - -These commands are aliases for the existing verb-first forms: `dotnet add package`, `dotnet list package`, `dotnet remove package`, `dotnet add reference`, `dotnet list reference`, and `dotnet remove reference`. - -The new noun-first forms align with general CLI standards, making the `dotnet` CLI more consistent with other tools. While the verb-first forms continue to work, using the noun-first forms for improved readability and consistency in scripts and documentation is recommended. +Starting in .NET 10, the `dotnet` CLI tool includes new aliases for common commands to make them easier to remember and type. The new commands are shown in the following table. + +| New noun-first form | Alias for | +|---------------------------------------------------------------------|---------------------------| +| [`dotnet package add`](../../tools/dotnet-package-add.md) | `dotnet add package` | +| [`dotnet package list`](../../tools/dotnet-package-list.md) | `dotnet list package` | +| [`dotnet package remove`](../../tools/dotnet-package-remove.md) | `dotnet remove package` | +| [`dotnet reference add`](../../tools/dotnet-reference-add.md) | `dotnet add reference` | +| [`dotnet reference list`](../../tools/dotnet-reference-list.md) | `dotnet list reference` | +| [`dotnet reference remove`](../../tools/dotnet-reference-remove.md) | `dotnet remove reference` | + +The new noun-first forms align with general CLI standards, making the `dotnet` CLI more consistent with other tools. While the verb-first forms continue to work, it's better to use the noun-first forms for improved readability and consistency in scripts and documentation. diff --git a/docs/fsharp/get-started/get-started-command-line.md b/docs/fsharp/get-started/get-started-command-line.md index dac4a503d73a1..17014e8b6c194 100644 --- a/docs/fsharp/get-started/get-started-command-line.md +++ b/docs/fsharp/get-started/get-started-command-line.md @@ -109,7 +109,7 @@ let main args = 0 // return an integer exit code ``` -Add a reference to the `Library` project using [dotnet add reference](../../core/tools/dotnet-add-reference.md). +Add a reference to the `Library` project using [dotnet reference add](../../core/tools/dotnet-reference-add.md). ```dotnetcli dotnet add src/App/App.fsproj reference src/Library/Library.fsproj diff --git a/docs/iot/includes/tutorial-add-gpio-package.md b/docs/iot/includes/tutorial-add-gpio-package.md index f5f5bf52a88ee..878961c10d1f9 100644 --- a/docs/iot/includes/tutorial-add-gpio-package.md +++ b/docs/iot/includes/tutorial-add-gpio-package.md @@ -1,5 +1,5 @@ -Add the [System.Device.Gpio](https://www.nuget.org/packages/System.Device.Gpio/) package to the project. Use either [.NET CLI](../../core/tools/dotnet-add-package.md) from the project directory or [Visual Studio](/nuget/consume-packages/install-use-packages-visual-studio). +Add the [System.Device.Gpio](https://www.nuget.org/packages/System.Device.Gpio/) package to the project. Use either [.NET CLI](../../core/tools/dotnet-package-add.md) from the project directory or [Visual Studio](/nuget/consume-packages/install-use-packages-visual-studio). ```dotnetcli -dotnet add package System.Device.Gpio --version 3.2.0-* +dotnet package add System.Device.Gpio --version 3.2.0-* ``` diff --git a/docs/iot/includes/tutorial-add-iot-package.md b/docs/iot/includes/tutorial-add-iot-package.md index 565c1ff7f3bc9..7058c7cb91c2b 100644 --- a/docs/iot/includes/tutorial-add-iot-package.md +++ b/docs/iot/includes/tutorial-add-iot-package.md @@ -1,5 +1,5 @@ -Add the [Iot.Device.Bindings](https://www.nuget.org/packages/Iot.Device.Bindings/) package to the project. Use either [.NET CLI](../../core/tools/dotnet-add-package.md) from the project directory or [Visual Studio](/nuget/consume-packages/install-use-packages-visual-studio). +Add the [Iot.Device.Bindings](https://www.nuget.org/packages/Iot.Device.Bindings/) package to the project. Use either [.NET CLI](../../core/tools/dotnet-package-add.md) from the project directory or [Visual Studio](/nuget/consume-packages/install-use-packages-visual-studio). ```dotnetcli -dotnet add package Iot.Device.Bindings --version 3.2.0-* +dotnet package add Iot.Device.Bindings --version 3.2.0-* ``` diff --git a/docs/machine-learning/how-to-guides/getting-started-dataframe.md b/docs/machine-learning/how-to-guides/getting-started-dataframe.md index ac0ba163dfe59..fdaef16b2eaad 100644 --- a/docs/machine-learning/how-to-guides/getting-started-dataframe.md +++ b/docs/machine-learning/how-to-guides/getting-started-dataframe.md @@ -16,7 +16,7 @@ Learn how to get started with [DataFrames](/dotnet/api/microsoft.data.analysis.d In most cases, accessing is as simple as referencing the [Microsoft.Data.Analysis](https://www.nuget.org/packages/Microsoft.Data.Analysis/) NuGet package. ```dotnetcli -dotnet add package Microsoft.Data.Analysis +dotnet package add Microsoft.Data.Analysis ``` ## Load data diff --git a/docs/machine-learning/how-to-guides/install-extra-dependencies.md b/docs/machine-learning/how-to-guides/install-extra-dependencies.md index 1ecd3d559fb96..7d4293277cc5d 100644 --- a/docs/machine-learning/how-to-guides/install-extra-dependencies.md +++ b/docs/machine-learning/how-to-guides/install-extra-dependencies.md @@ -13,7 +13,7 @@ ms.topic: how-to In most cases, on all operating systems, installing ML.NET is as simple as referencing the appropriate NuGet package. ```dotnetcli -dotnet add package Microsoft.ML +dotnet package add Microsoft.ML ``` In some cases though, there are additional installation requirements, particularly when native components are required. This article describes the installation requirements for those cases. The sections are broken down by the specific `Microsoft.ML.*` NuGet package that has the additional dependency. diff --git a/docs/machine-learning/how-to-guides/matchup-app-infer-net.md b/docs/machine-learning/how-to-guides/matchup-app-infer-net.md index 7315ee1c8eae4..1a30db3bb5e0d 100644 --- a/docs/machine-learning/how-to-guides/matchup-app-infer-net.md +++ b/docs/machine-learning/how-to-guides/matchup-app-infer-net.md @@ -36,7 +36,7 @@ The `dotnet` command creates a `new` application of type `console`. The `-o` par To use Infer.NET, you need to install the `Microsoft.ML.Probabilistic.Compiler` package. In your command prompt, run the following command: ```dotnetcli -dotnet add package Microsoft.ML.Probabilistic.Compiler +dotnet package add Microsoft.ML.Probabilistic.Compiler ``` ## Design your model diff --git a/docs/navigate/tools-diagnostics/toc.yml b/docs/navigate/tools-diagnostics/toc.yml index ff958cb848efe..424d001cb75c0 100644 --- a/docs/navigate/tools-diagnostics/toc.yml +++ b/docs/navigate/tools-diagnostics/toc.yml @@ -104,22 +104,6 @@ items: items: - name: dotnet href: ../../core/tools/dotnet.md - - name: dotnet add/list/remove package - items: - - name: dotnet add package - href: ../../core/tools/dotnet-add-package.md - - name: dotnet list package - href: ../../core/tools/dotnet-list-package.md - - name: dotnet remove package - href: ../../core/tools/dotnet-remove-package.md - - name: dotnet add/list/remove reference - items: - - name: dotnet add reference - href: ../../core/tools/dotnet-add-reference.md - - name: dotnet list reference - href: ../../core/tools/dotnet-list-reference.md - - name: dotnet remove reference - href: ../../core/tools/dotnet-remove-reference.md - name: dotnet build href: ../../core/tools/dotnet-build.md - name: dotnet build-server @@ -196,10 +180,26 @@ items: href: ../../core/tools/dotnet-nuget-config-paths.md - name: dotnet pack href: ../../core/tools/dotnet-pack.md - - name: dotnet package search - href: ../../core/tools/dotnet-package-search.md + - name: dotnet package add/list/remove/earch + items: + - name: dotnet package add + href: ../../core/tools/dotnet-package-add.md + - name: dotnet package list + href: ../../core/tools/dotnet-package-list.md + - name: dotnet package remove + href: ../../core/tools/dotnet-package-remove.md + - name: dotnet package search + href: ../../core/tools/dotnet-package-search.md - name: dotnet publish href: ../../core/tools/dotnet-publish.md + - name: dotnet reference add/list/remove + items: + - name: dotnet reference add + href: ../../core/tools/dotnet-reference-add.md + - name: dotnet reference list + href: ../../core/tools/dotnet-reference-list.md + - name: dotnet reference remove + href: ../../core/tools/dotnet-reference-remove.md - name: dotnet restore href: ../../core/tools/dotnet-restore.md - name: dotnet run diff --git a/docs/orleans/host/configuration-guide/local-development-configuration.md b/docs/orleans/host/configuration-guide/local-development-configuration.md index ed7474ddbad63..baa5e0434207c 100644 --- a/docs/orleans/host/configuration-guide/local-development-configuration.md +++ b/docs/orleans/host/configuration-guide/local-development-configuration.md @@ -49,7 +49,7 @@ For local development, refer to the below example of how to configure a silo for Add the `Microsoft.Orleans.Server` NuGet meta-package to the project. ```dotnetcli -dotnet add package Microsoft.Orleans.Server +dotnet package add Microsoft.Orleans.Server ``` You need to configure via `Configure` method, specify that you want `LocalhostClustering` as your clustering choice with this silo being the primary, and then configure silo endpoints. diff --git a/docs/orleans/quickstarts/build-your-first-orleans-app.md b/docs/orleans/quickstarts/build-your-first-orleans-app.md index 02b249e1026ff..dfa0447bc030e 100644 --- a/docs/orleans/quickstarts/build-your-first-orleans-app.md +++ b/docs/orleans/quickstarts/build-your-first-orleans-app.md @@ -77,7 +77,7 @@ Orleans is available through a collection of NuGet packages, each of which provi In the Visual Studio Code terminal, run the following command: ```dotnetcli -dotnet add package Microsoft.Orleans.Server +dotnet package add Microsoft.Orleans.Server ``` --- diff --git a/docs/orleans/quickstarts/deploy-scale-orleans-on-azure.md b/docs/orleans/quickstarts/deploy-scale-orleans-on-azure.md index 5ae477779e717..d9b63038c3246 100644 --- a/docs/orleans/quickstarts/deploy-scale-orleans-on-azure.md +++ b/docs/orleans/quickstarts/deploy-scale-orleans-on-azure.md @@ -127,10 +127,10 @@ Prior to using the grain, you must install the corresponding `Microsoft.Orleans. cd ./src/web ``` -1. Import the `Azure.Identity` package from NuGet using `dotnet add package`. +1. Import the `Azure.Identity` package from NuGet using `dotnet package add`. ```dotnetcli - dotnet add package Azure.Identity --version 1.* + dotnet package add Azure.Identity --version 1.* ``` 1. Import the `Microsoft.Orleans.Clustering.AzureStorage` and `Microsoft.Orleans.Persistence.AzureStorage` packages. @@ -141,18 +141,18 @@ Prior to using the grain, you must install the corresponding `Microsoft.Orleans. | **Persistence** | `Microsoft.Orleans.Persistence.AzureStorage` | ```dotnetcli - dotnet add package Microsoft.Orleans.Clustering.AzureStorage --version 8.* - dotnet add package Microsoft.Orleans.Persistence.AzureStorage --version 8.* + dotnet package add Microsoft.Orleans.Clustering.AzureStorage --version 8.* + dotnet package add Microsoft.Orleans.Persistence.AzureStorage --version 8.* ``` ::: zone-end ::: zone pivot="azure-cosmos-db-nosql" -1. Import the `Azure.Identity` package from NuGet using `dotnet add package`. +1. Import the `Azure.Identity` package from NuGet using `dotnet package add`. ```dotnetcli - dotnet add package Azure.Identity --version 1.* + dotnet package add Azure.Identity --version 1.* ``` 1. Import the `Microsoft.Orleans.Clustering.Cosmos` and `Microsoft.Orleans.Persistence.Cosmos` packages. @@ -163,8 +163,8 @@ Prior to using the grain, you must install the corresponding `Microsoft.Orleans. | **Persistence** | `Microsoft.Orleans.Persistence.Cosmos` | ```dotnetcli - dotnet add package Microsoft.Orleans.Clustering.Cosmos --version 8.* - dotnet add package Microsoft.Orleans.Persistence.Cosmos --version 8.* + dotnet package add Microsoft.Orleans.Clustering.Cosmos --version 8.* + dotnet package add Microsoft.Orleans.Persistence.Cosmos --version 8.* ``` ::: zone-end diff --git a/docs/orleans/resources/nuget-packages.md b/docs/orleans/resources/nuget-packages.md index 4c7d26fae91db..398fcda329102 100644 --- a/docs/orleans/resources/nuget-packages.md +++ b/docs/orleans/resources/nuget-packages.md @@ -25,7 +25,7 @@ You reference one of two mutually exclusive NuGet packages when writing Orleans For information on installing NuGet packages, see the following options: -- [.NET CLI: dotnet add package](../../core/tools/dotnet-add-package.md) +- [.NET CLI: dotnet package add](../../core/tools/dotnet-package-add.md) - [Ways to install a NuGet package](/nuget/consume-packages/overview-and-workflow#ways-to-install-a-nuget-package) ## Hosting diff --git a/docs/orleans/tutorials-and-samples/tutorial-1.md b/docs/orleans/tutorials-and-samples/tutorial-1.md index 71ef8bafb3700..1948afe432b69 100644 --- a/docs/orleans/tutorials-and-samples/tutorial-1.md +++ b/docs/orleans/tutorials-and-samples/tutorial-1.md @@ -53,7 +53,7 @@ Replace the default code with the code given for each project. | Grain Interfaces | `Microsoft.Orleans.Sdk` | | Grains | `Microsoft.Orleans.Sdk`
`Microsoft.Extensions.Logging.Abstractions` | -`Microsoft.Orleans.Server`, `Microsoft.Orleans.Client` and `Microsoft.Orleans.Sdk` are metapackages that bring dependencies that you'll most likely need on the Silo and client. For more information on adding package references, see [dotnet add package](../../core/tools/dotnet-add-package.md) or [Install and manage packages in Visual Studio using the NuGet Package Manager](/nuget/consume-packages/install-use-packages-visual-studio). +`Microsoft.Orleans.Server`, `Microsoft.Orleans.Client` and `Microsoft.Orleans.Sdk` are metapackages that bring dependencies that you'll most likely need on the Silo and client. For more information on adding package references, see [dotnet package add](../../core/tools/dotnet-package-add.md) or [Install and manage packages in Visual Studio using the NuGet Package Manager](/nuget/consume-packages/install-use-packages-visual-studio). ## Define a grain interface diff --git a/docs/standard/commandline/get-started-tutorial.md b/docs/standard/commandline/get-started-tutorial.md index ce4f2f93d370d..b1baa6f9da516 100644 --- a/docs/standard/commandline/get-started-tutorial.md +++ b/docs/standard/commandline/get-started-tutorial.md @@ -54,7 +54,7 @@ Create a .NET 6 console app project named "scl". * Run the following command: ```dotnetcli - dotnet add package System.CommandLine --prerelease + dotnet package add System.CommandLine --prerelease ``` The `--prerelease` option is necessary because the library is still in beta. diff --git a/docs/standard/commandline/syntax.md b/docs/standard/commandline/syntax.md index 49913a28c1883..67546304fec16 100644 --- a/docs/standard/commandline/syntax.md +++ b/docs/standard/commandline/syntax.md @@ -128,15 +128,15 @@ Arguments also have expectations about how many values can be provided. Examples You can provide options before arguments or arguments before options on the command line. The following commands are equivalent: ```dotnetcli -dotnet add package System.CommandLine --prerelease -dotnet add package --prerelease System.CommandLine +dotnet package add System.CommandLine --prerelease +dotnet package add --prerelease System.CommandLine ``` Options can be specified in any order. The following commands are equivalent: ```dotnetcli -dotnet add package System.CommandLine --prerelease --no-restore --source https://api.nuget.org/v3/index.json -dotnet add package System.CommandLine --source https://api.nuget.org/v3/index.json --no-restore --prerelease +dotnet package add System.CommandLine --prerelease --no-restore --source https://api.nuget.org/v3/index.json +dotnet package add System.CommandLine --source https://api.nuget.org/v3/index.json --no-restore --prerelease ``` When there are multiple arguments, the order does matter. The following commands are not necessarily equivalent: @@ -380,7 +380,7 @@ Contents of *sample1.rsp*: ```console build ---no-restore +--no-restore --output ./build-output/ ``` diff --git a/docs/standard/data/sqlite/custom-versions.md b/docs/standard/data/sqlite/custom-versions.md index c91b4b0aee771..794c6cad1224e 100644 --- a/docs/standard/data/sqlite/custom-versions.md +++ b/docs/standard/data/sqlite/custom-versions.md @@ -26,8 +26,8 @@ For example, to use the unofficial, open-source build of `SQLCipher` use the fol ### [.NET CLI](#tab/net-cli) ```dotnetcli -dotnet add package Microsoft.Data.Sqlite.Core -dotnet add package SQLitePCLRaw.bundle_e_sqlcipher +dotnet package add Microsoft.Data.Sqlite.Core +dotnet package add SQLitePCLRaw.bundle_e_sqlcipher ``` ### [Visual Studio](#tab/visual-studio) @@ -57,9 +57,9 @@ To use the `sqlite3` provider use the following commands: ### [.NET CLI](#tab/net-cli) ```dotnetcli -dotnet add package Microsoft.Data.Sqlite.Core -dotnet add package SQLitePCLRaw.core -dotnet add package SQLitePCLRaw.provider.sqlite3 +dotnet package add Microsoft.Data.Sqlite.Core +dotnet package add SQLitePCLRaw.core +dotnet package add SQLitePCLRaw.provider.sqlite3 ``` ### [Visual Studio](#tab/visual-studio) diff --git a/docs/standard/data/sqlite/encryption.md b/docs/standard/data/sqlite/encryption.md index 3aa578896ea60..edb00ee3376ce 100644 --- a/docs/standard/data/sqlite/encryption.md +++ b/docs/standard/data/sqlite/encryption.md @@ -12,9 +12,9 @@ SQLite doesn't support encrypting database files by default. Instead, you need t ### [.NET CLI](#tab/net-cli) ```dotnetcli -dotnet remove package Microsoft.Data.Sqlite -dotnet add package Microsoft.Data.Sqlite.Core -dotnet add package SQLitePCLRaw.bundle_e_sqlcipher +dotnet package remove Microsoft.Data.Sqlite +dotnet package add Microsoft.Data.Sqlite.Core +dotnet package add SQLitePCLRaw.bundle_e_sqlcipher ``` ### [Visual Studio](#tab/visual-studio) diff --git a/docs/standard/data/sqlite/index.md b/docs/standard/data/sqlite/index.md index 39870944a354a..9aca64701a938 100644 --- a/docs/standard/data/sqlite/index.md +++ b/docs/standard/data/sqlite/index.md @@ -14,7 +14,7 @@ The latest stable version is available on [NuGet](https://www.nuget.org/packages ### [.NET CLI](#tab/net-cli) ```dotnetcli -dotnet add package Microsoft.Data.Sqlite +dotnet package add Microsoft.Data.Sqlite ``` ### [Visual Studio](#tab/visual-studio)