From c2680946f5be16e4e75e9b167f01b839aaae6827 Mon Sep 17 00:00:00 2001 From: David Pine Date: Wed, 24 Sep 2025 13:51:48 -0500 Subject: [PATCH 1/2] Update preprocessor directives documentation Updated the date for the preprocessor directives documentation and added new information about the `#:project` token. --- .../preprocessor-directives.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/csharp/language-reference/preprocessor-directives.md b/docs/csharp/language-reference/preprocessor-directives.md index 930ab1fadc953..29bb015587a71 100644 --- a/docs/csharp/language-reference/preprocessor-directives.md +++ b/docs/csharp/language-reference/preprocessor-directives.md @@ -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" @@ -109,6 +109,20 @@ The `#:` directives that are used in file-based apps include: ```xml ``` + +- `#: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 + + ``` Tools can add new tokens following the `#:` convention. From 4c189c7c6216d2991ba348c50be0a6fa25c2851e Mon Sep 17 00:00:00 2001 From: David Pine Date: Wed, 24 Sep 2025 13:53:48 -0500 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- docs/csharp/language-reference/preprocessor-directives.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/csharp/language-reference/preprocessor-directives.md b/docs/csharp/language-reference/preprocessor-directives.md index 29bb015587a71..d93158c7ce056 100644 --- a/docs/csharp/language-reference/preprocessor-directives.md +++ b/docs/csharp/language-reference/preprocessor-directives.md @@ -112,7 +112,7 @@ The `#:` directives that are used in file-based apps include: - `#:project`: - Instance of `#:project` are translated into `ProjectReference` elements to include the project with the specified path to the project. For example: + Instances 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