dotnet-file-based-apps

Create and run .NET applications from single C# files without .csproj files.

1|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/rudironsoni/dotnet-agent-harness --skill dotnet-file-based-apps-rudironsoni
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-file-based-apps
Source: https://github.com/rudironsoni/dotnet-agent-harness/tree/main/.rulesync/skills/dotnet-file-based-apps
Command: npx skills add https://github.com/rudironsoni/dotnet-agent-harness --skill dotnet-file-based-apps-rudironsoni

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill simplifies .NET development by allowing you to create, run, and publish C# applications directly from a single .cs file, eliminating the need for traditional .csproj project files for simpler tasks.

Core Features & Use Cases

  • Simplified Development: Build scripts, utilities, and small applications without project scaffolding.
  • Embedded Configuration: Use #: directives within your C# file to specify package references, SDKs, properties, and project references.
  • Familiar CLI Commands: Leverage dotnet run, dotnet build, dotnet publish, and more directly on your .cs files.
  • Use Case: Quickly create a command-line tool to process a text file by writing a single tool.cs file with #:package Spectre.Console and then running dotnet tool.cs.

Quick Start

Run the app.cs file using the command dotnet run app.cs.

Frequently Asked Questions about dotnet-file-based-apps

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run a single C# file without creating a .csproj project file?

You can run a single C# file directly using the `dotnet run app.cs` command. This approach eliminates the need for traditional .csproj project scaffolding when building simple scripts and utilities.

What is the best way to add NuGet packages to a C# script?

The best way to add packages to a C# script is by using embedded `#:` directives, such as `#:package Spectre.Console`. This allows you to specify package references directly within the single .cs file.

Can I use standard dotnet CLI commands like build and publish on a single .cs file?

Yes, you can use familiar .NET CLI commands like `dotnet build`, `dotnet publish`, and `dotnet run` directly on your .cs files. This integrates file-based apps into standard .NET development workflows.

How does file-based app development compare to traditional .NET project scaffolding?

File-based app development abstracts project file complexity by using embedded `#:` directives for SDKs and properties, whereas traditional scaffolding requires managing explicit .csproj files. This facilitates rapid development for small tasks.

When should I avoid building .NET apps from single C# files?

You should avoid building .NET apps from single C# files when your project requires complex project file structures beyond simple scripts and utilities, as this approach is designed to abstract away .csproj complexity for rapid development.