whatisgithub

What is samples?

dotnet/samples — explained in plain English

Analysis updated 2026-07-03

3,709C#Audience · developerComplexity · 2/5Setup · easy

In one sentence

The official collection of runnable code examples that go alongside Microsoft's .NET documentation, covering C#, F#, and Visual Basic across web, desktop, and console topics.

Mindmap

mindmap
  root((dotnet/samples))
    What it does
      Official code examples
      Mirrors docs structure
      Runnable programs
    Languages
      C#
      F#
      Visual Basic
    Topics
      Console apps
      Web apps
      Desktop apps
    How to use
      Download folder
      Run two CLI commands
      Read sample readme
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Download and run a working .NET code example while following the official documentation

USE CASE 2

Find a complete working sample for a specific .NET feature like async programming or LINQ

USE CASE 3

Use an official sample as a starting template for a new .NET console or web project

USE CASE 4

Contribute a new code example that accompanies a .NET documentation article

What is it built with?

C#F#Visual Basic.NET

How does it compare?

dotnet/samplesstephencleary/asyncexbuiltbybel/privatezilla
Stars3,7093,7153,719
LanguageC#C#C#
Setup difficultyeasyeasyeasy
Complexity2/52/51/5
Audiencedeveloperdevelopergeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min
Not specified in the explanation.

So what is it?

This repository holds all the code examples that accompany the official .NET documentation. .NET is Microsoft's platform for building software applications, and the documentation explains how to use it. The samples in this repo are the runnable programs that readers can download and try alongside the written explanations. The collection covers a wide range of topics and is organized to mirror the structure of the documentation itself. Many articles link to one or more sample programs. Each sample has its own readme file explaining what it demonstrates and pointing back to the relevant documentation page. The samples are written primarily in C#, but the repo also contains F# and Visual Basic examples. Most of them are designed to work on any operating system that .NET supports, since they are built as console applications. Some samples are specific to Windows or to particular frameworks like web or desktop applications, and those include their own requirements. Contributors who want to add new samples are expected to make sure the code compiles and runs, follows the project's coding style, and handles errors appropriately. Issues and feature requests are tracked in the dotnet/docs repository rather than this one, and the recommended way to report a problem with a sample is through the feedback link at the bottom of the documentation page it belongs to. Running any sample is straightforward: download the folder, open a terminal, and run two commands to build and start the program. The .NET tooling handles fetching any additional pieces the sample depends on.

Copy-paste prompts

Prompt 1
I'm reading the official .NET docs on async/await in C# and want to run the accompanying sample. Show me how to find, download, and run the relevant sample from the dotnet/samples repo.
Prompt 2
Walk me through the dotnet/samples folder structure so I can find the right example for the .NET topic I'm learning.
Prompt 3
I want to contribute a new C# sample to the dotnet/samples repo. What are the requirements for code style, error handling, and readme format?
Prompt 4
Show me how to build and run any sample from the dotnet/samples repo using just a terminal and the .NET CLI.
Prompt 5
Find me a dotnet/samples example that demonstrates dependency injection in ASP.NET Core and explain what it shows.

Frequently asked questions

What is samples?

The official collection of runnable code examples that go alongside Microsoft's .NET documentation, covering C#, F#, and Visual Basic across web, desktop, and console topics.

What language is samples written in?

Mainly C#. The stack also includes C#, F#, Visual Basic.

What license does samples use?

Not specified in the explanation.

How hard is samples to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is samples for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.