This folder contains standalone, executable C# examples for each cookbook recipe. These are file-based apps that can be run directly with dotnet run.
- .NET 9.0 or later
- GitHub Copilot SDK package (referenced automatically)
Each .cs file is a complete, runnable program. Simply use:
dotnet run <filename>.cs| Recipe | Command | Description |
|---|---|---|
| Error Handling | dotnet run error-handling.cs |
Demonstrates error handling patterns |
| Multiple Sessions | dotnet run multiple-sessions.cs |
Manages multiple independent conversations |
| Managing Local Files | dotnet run managing-local-files.cs |
Organizes files using AI grouping |
| PR Visualization | dotnet run pr-visualization.cs |
Generates PR age charts |
| Persisting Sessions | dotnet run persisting-sessions.cs |
Save and resume sessions across restarts |
PR Visualization with specific repo:
dotnet run pr-visualization.cs -- --repo github/copilot-sdkManaging Local Files (edit the file to change target folder):
# Edit the targetFolder variable in managing-local-files.cs first
dotnet run managing-local-files.csThese examples use .NET's file-based app feature, which allows single-file C# programs to:
- Run without a project file
- Automatically reference common packages
- Support top-level statements
Each file includes #:property PublishAot=false to disable AOT compilation, ensuring compatibility with the Copilot SDK.