Skip to content
16 changes: 14 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,7 @@ 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 include: `#:package`, `#:project`, `#:include`, `#:property`, and `#:sdk`. Place these directives at the top of the C# file.
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.

Insert alphabetically.

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.

Addressed in 45e2f60. The supported directives list and directive sections are now ordered alphabetically.


### `#:package`

Expand All @@ -44,6 +44,17 @@ References another project file or directory that contains a project file.
#:project ../SharedLibrary/SharedLibrary.csproj
```

### `#:include`
Comment thread
gewarren marked this conversation as resolved.
Outdated

Includes another C# source file in your file-based app.
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.

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

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 45e2f60. The sentence now reads: “Includes another C# source file in the file-based app.”


```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.

### `#:property`

Sets an MSBuild property value.
Expand Down Expand Up @@ -215,6 +226,7 @@ Different SDKs include other file types:

- `Microsoft.NET.Sdk.Web` includes `*.json` configuration files.
- Non-default SDKs include ResX resource files.
- Files referenced by `#:include` are included for compilation.
Comment thread
gewarren marked this conversation as resolved.
Outdated

## Native AOT publishing

Expand Down
Loading