cs
What is a .cs file?
text/x-csharp
C# (.cs) is a plain-text source file for Microsoft's C# language — a statically typed, object-oriented language on .NET. It features classes, records, LINQ, async/await, and nullable reference types.
How to use a .cs file
Use an example .cs file to test syntax highlighters, Roslyn-based analyzers, formatters (dotnet format), and language-detection tooling.
Download example .cs files
- C# HelloIdiomatic C# hello-world for syntax highlighters and Roslyn-style parsers.
- C# FibonacciA small C# iterator Fibonacci utility — realistic snippet for language tooling.
- C# LINQ SAMPLEC# LINQ chain SAMPLE for Roslyn fixtures.
- Csharp Lint Invalid — Empty Catch InvalidIntentionally lint-bait SAMPLE csharp snippet (empty-catch-invalid) for rule-engine tests.