dotnet-add-reference - Man Page

Adds project-to-project (P2P) references.

dotnet add reference

This article applies to: āœ”ļø .NET Core 3.1 SDK and later versions

Synopsis

dotnet add [<PROJECT>] reference [-f|--framework <FRAMEWORK>]
     [--interactive] <PROJECT_REFERENCES>

dotnet add reference -h|--help

Description

The dotnet add reference command provides a convenient option to add project references to a project. After running the command, the <ProjectReference> elements are added to the project file.

<ItemGroup>
  <ProjectReference Include="app.csproj" />
  <ProjectReference Include="..\lib2\lib2.csproj" />
  <ProjectReference Include="..\lib1\lib1.csproj" />
</ItemGroup>

Arguments

Options

Examples

Info

2022-10-10 .NET Documentation