Project directive

The project directive is used to reference other C# project files or directories that contain a project file. This is equivalent to adding a ProjectReference in a .csproj file.

Usage

The directive has one parameter which is the path to the project file or directory containing a project file.

Reference project file

#:project ../SharedLibrary/SharedLibrary.csproj

This is equivalent to the following .csproj:

<ItemGroup>
  <ProjectReference Include="../SharedLibrary/SharedLibrary.csproj" />
</ItemGroup>

Reference project directory

You can also reference a directory that contains a project file:

#:project ../SharedLibrary

See also