Add/Remove References Using dotnet CLI Tool
In the latest update made to the .NET Core tooling, dotnet new and add command has undergone significant changes in the usage and options available for the command. You can read more about the updates here in the official blog. In this current update it replaces the dotnet add p2p command with a new syntax.
Adding a Reference
Syntax
dotnet add reference <path to project file>
Usage
dotnet add reference ..\Lib\Lib.csproj
When you execute the following command it will get added to the project and if look at the csproj file of the project to which the reference is added you will see the entry for it
Remove a Reference
Syntax
dotnet remove reference <path to the proj file which needs to be removed>
Usage
dotnet remove reference ..\Lib\Lib.csproj
To remove the referernce we will use the dotnet remove reference as shown below.
Documentation
To view the help documentation for the above two commands, just add --help switch in the command as shown below.
No Comments
Connecting Azure Blob Storage account using Managed Identity
Posted 12/9/2022Securing Azure KeyVault connections using Managed Identity
Posted 11/26/2022Manage application settings with Azure KeyVault
Posted 11/9/2022Adding Serilog to Azure Functions created using .NET 5
Posted 4/3/2021Learn how to split log data into different tables using Serilog in ASP.NET Core
Posted 4/23/2020