Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion docs/csharp/language-reference/preprocessor-directives.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: "Learn the different C# preprocessor directives that control conditional compilation, warnings, nullable analysis, and more"
title: "Preprocessor directives"
ms.date: 06/19/2025
ms.date: 09/24/2025
f1_keywords:
- "cs.preprocessor"
- "#nullable"
Expand Down Expand Up @@ -109,6 +109,20 @@ The `#:` directives that are used in file-based apps include:
```xml
<PackageReference Include="System.CommandLine" Version="2.0.0-*">
```

- `#:project`:

Instance of `#:project` are translated into `ProjectReference` elements to include the project with the specified path to the project. For example:

```csharp
#:project ../Path/To.Example.csproj
```

The preceding preprocessor token is translated into:

```xml
<ProjectReference Include="../Path/To.Example.csproj" />
```

Tools can add new tokens following the `#:` convention.

Expand Down
Loading