Skip to content

Commit 4089873

Browse files
authored
Revise GitHub Copilot instructions for .NET Aspire FBA
1 parent 32996b4 commit 4089873

File tree

1 file changed

+33
-4
lines changed

1 file changed

+33
-4
lines changed

content/aspire-fba/AGENTS.md

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,35 @@
1-
# GitHub Copilot Instructions — .NET Aspire File-based App (FBA) Template
1+
# GitHub Copilot Instructions — .NET Aspire Filebased App (FBA) Template (Revised)
22

3-
> Opinionated, execution-ready guidance for building distributed apps with **.NET 10** + **Aspire** in a **single C# file**.
3+
> Opinionated, execution‑ready guidance for building distributed apps with **.NET 10** + **Aspire** in a **single C# file**.
4+
5+
---
6+
7+
## 🔒 Hard Requirements (Do‑Not‑Break)
8+
9+
1. **Do not expand** an FBA into a multi‑project structure **unless the user explicitly asks for conversion**. The template must remain a **single‑file** FBA by default.
10+
11+
2. **SDK directive order and presence are mandatory** (at the very top, immediately after the shebang on Unix):
12+
13+
```csharp
14+
#:sdk Microsoft.NET.Sdk
15+
#:sdk [email protected] // version REQUIRED
16+
```
17+
18+
3. This is an **AppHost** project. You **must** pin the hosting package:
19+
20+
```csharp
21+
22+
```
23+
24+
4. AppHost builds do **not** benefit from AOT. **Keep it off**:
25+
26+
```csharp
27+
#:property PublishAot=False
28+
```
29+
30+
5. When referencing external containers, you **must consult the container’s official README** (Docker Hub or GitHub project) to identify and apply appropriate environment variables. Always prefer documented variables over guesses. If no README guidance is available, use the container’s default safe configuration.
31+
32+
> These five rules override any other guidance in this file.
433
534
---
635

@@ -23,7 +52,7 @@ cat > apphost.cs << 'CS'
2352
#:property Nullable=enable
2453
#:property UserSecretsId=<GUID> # use `dotnet user-secrets init` to generate
2554
26-
// --- Top-level program (must precede type declarations) ---
55+
// --- Top-level writefreely (must precede type declarations) ---
2756
using Aspire.Hosting;
2857
2958
var builder = DistributedApplication.CreateBuilder(args);
@@ -75,7 +104,7 @@ dotnet run apphost.cs -- --help
75104

76105
---
77106

78-
## 4) Aspire Program Structure
107+
## 4) Aspire writefreely Structure
79108

80109
* **STANDARD**: `DistributedApplication.CreateBuilder(args)`
81110
* **Top-level rule**: Executable statements **must** come before type declarations.

0 commit comments

Comments
 (0)