Skip to content
17 changes: 15 additions & 2 deletions docs/core/sdk/file-based-apps.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: File-based apps
description: Learn how to create, build, and run C# applications from a single file without a project file.
ms.date: 12/05/2025
ms.date: 04/22/2026
ai-usage: ai-assisted
---
# File-based apps
Expand All @@ -21,7 +21,20 @@ In this article, learn how to create, configure, and work with file-based apps e

## Supported directives

File-based apps use directives prefixed with `#:` to configure the build and run the application. Supported directives include: `#:package`, `#:project`, `#:property`, and `#:sdk`. Place these directives at the top of the C# file.
File-based apps use directives prefixed with `#:` to configure the build and run the application. Supported directives are: `#:include`, `#:package`, `#:project`, `#:property`, and `#:sdk`. Place these directives at the top of the C# file.

### `#:include`

Includes another C# source file in the file-based app.

Included files compile as part of the same app. They can add types, top-level statements, and other declarations.

```csharp
#:include helpers.cs
#:include models/customer.cs
```

The `#:include` directive is available in .NET 11 Preview 3 and .NET SDK 10.0.3xx and later.
Comment on lines +26 to +37
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new #:include section doesn't currently explain how included files participate in compilation (for example, that the included source is compiled as part of the same app and can contribute types/top-level statements). That detail is called out in the PR description, so consider adding one clarifying sentence here to avoid ambiguity about what "includes" means.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applied in 95713a7. I added clarification that included files compile as part of the same app and can add declarations.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should wait for this to actually land in 3xx. It might not, you never know.

Do you think it's a good idea to put this up front? Someone may get here, try it, find it not working, never see that paragraph and complain it doesn't work.


### `#:package`

Expand Down
Loading