https://github.com/alexhedley/dotnetbyexample
.NET By Example
https://github.com/alexhedley/dotnetbyexample
batch csharp fsharp vb-net
Last synced: about 2 months ago
JSON representation
.NET By Example
- Host: GitHub
- URL: https://github.com/alexhedley/dotnetbyexample
- Owner: AlexHedley
- License: mit
- Created: 2025-05-09T19:16:31.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-16T17:32:16.000Z (about 1 year ago)
- Last Synced: 2025-07-01T16:08:41.847Z (12 months ago)
- Topics: batch, csharp, fsharp, vb-net
- Language: C#
- Homepage: https://alexhedley.com/dotnetbyexample/
- Size: 276 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# .NET By Example
[](https://dotnet.microsoft.com/)
[](https://learn.microsoft.com/en-us/dotnet/csharp/)
[](https://fsharp.org)
[](https://learn.microsoft.com/en-us/dotnet/visual-basic/)
[](LICENSE)
[](https://github.com/AlexHedley/dotnetbyexample/security/dependabot)
[](https://alexhedley.github.io/dotnetbyexample/reports/dependency-check-report.html)
[](https://github.com/AlexHedley/dotnetbyexample/actions/workflows/dependabot/dependabot-updates)
[](https://github.com/AlexHedley/dotnetbyexample/actions/workflows/depcheck.yml)
> Content and build toolchain for _.NET by Example_, a site that teaches .NET (C#, F#, VB.NET) via annotated example programs/scripts.
## Overview
The .NET by Example site is built by extracting code and comments from source files in [examples](examples/) and rendering them using templates into a static public directory. The programs implementing this build process are in tools, along with dependencies specified in the [.csproj](src/dotnetbyexample/dotnetbyexample.csproj).
The built public directory can be served by any static content system. The production site uses [GitHub](https://github.com) [Pages](https://docs.github.com/en/pages), for example - https://alexhedley.github.io/dotnetbyexample/.
Inspired by [Go by Example](https://gobyexample.com/) ([Source](https://github.com/mmcgrana/gobyexample))
## examples
A 📂 folder containing a `.csx`, `.vb`, `.fs` (and `.bat` with run instructions) file complete with code and code comments is converted to a corresponding `.html` file.
- 📂[examples](examples/)
Please raise a new 💡[Discussion](https://github.com/AlexHedley/dotnetbyexample/discussions/new?category=ideas) with any ideas for another example, then MRs are welcome :).
## src
- 📂[src](src/)
## build
`cd src`
`dotnet build --configuration Release`
## run
Locally
`dotnet run --project src/dotnetbyexample/dotnetbyexample.csproj`
> src\dotnetbyexample\bin\Release\net10.0\dotnetbyexample.exe
## docs
- 📂[docs](docs/README.md)
## Dependencies
If you wish to run the examples locally you can use `dotnet script`, although see [Announcing dotnet run app.cs – A simpler way to start with C# and .NET 10](https://devblogs.microsoft.com/dotnet/announcing-dotnet-run-app/) and I will update the scripts over time.
**dotnet script**
https://github.com/dotnet-script/dotnet-script
`dotnet tool install -g dotnet-script`
`dotnet tool list -g`
`dotnet tool uninstall dotnet-script -g`