dotnet/samples is a collection of code examples that accompany the .NET documentation.
The repository serves as a centralized source of working code samples referenced throughout the official .NET documentation. Each sample demonstrates specific application or library scenarios, often combining multiple technologies or features. Samples are organized in subfolders that mirror the structure of the .NET documentation itself. The approach ensures that code examples remain synchronized with their corresponding documentation articles, with each sample including a readme file that explains its purpose and links to relevant resources.
Developers should use this repository as a reference when learning .NET concepts or when seeking working examples of specific features. The samples are designed to be buildable projects that run on the widest range of platforms possible, with a preference for .NET Core-based console applications where applicable. Platform-specific samples, such as web applications, WPF, Windows Forms, or mobile apps, include their required tools. The repository suits anyone building their understanding of .NET through practical examples, from beginners exploring core language features to developers implementing specialized scenarios. Issues and feature requests should be filed in the dotnet/docs repository rather than here, keeping discussions tied to the documentation pages that explain each sample's concepts.
The project maintains active validation workflows that check markdown formatting and build correctness across samples. Samples are expected to be buildable from the command line on platforms supported by .NET Core, with some samples requiring Visual Studio or platform-specific environments. The repository enforces that updates include buildable projects and ideally include tests for correctness. A continuous integration system validates that code samples remain functional and up to date with supported .NET versions.