A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://learn.microsoft.com/dotnet/core/tools/dotnet-add-reference below:

dotnet reference add command - .NET CLI

This article applies to: ✔️ .NET Core 3.1 SDK and later versions

Name

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.

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

dotnet reference add -h|--help
Description

The dotnet reference add 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" />
  <ProjectReference Include="..\lib3\lib3.fsproj" />
</ItemGroup>
Add a reference to an assembly that isn't in a project

There's no CLI command to add a reference to an assembly that isn't in a project or a package. But you can do that by editing your .csproj file and adding markup similar to the following example:

<ItemGroup>
  <Reference Include="MyAssembly">
    <HintPath>.\MyDLLFolder\MyAssembly.dll</HintPath>
  </Reference>
</ItemGroup>
Arguments Options Examples

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4