How to screenshot C# code properly: what C# snippets actually look like, how auto-detection behaves, the theme that reads best, and the settings that keep the card legible.
Modern C# is not Java with different keywords: record types, pattern-matching switch expressions with => arms, nullable reference annotations (string?), async Task<T>, LINQ chains (orders.Where(o => o.Total > 0).Select(o => o.Id)), and file-scoped namespaces (namespace App.Services;). Two features fight the renderer. Lambda arrows => appear inside switch arms and LINQ, and $"…{value}…" interpolated strings nest braces in a way that confuses grammars that treat {} as structure.
C# is rule 8. Three triggers: using System, namespace <word>, and Console.Write. There is a real cross-language collision here: rule 6 (C++) fires on #include or int main(, but a C++ snippet that opens with using namespace std; and no #include matches the C# rule and is rendered as C#. The same happens to a TypeScript snippet containing namespace Foo { — the C# rule comes long before the TS rule (14), so a namespaced TS file is typed as C#. File-scoped namespace App.Services; alone is enough to trigger it, which makes a one-line header the cheapest reliable fix for a misdetected C# card.
one-dark-pro for dark: LINQ chains and switch arms produce long runs of punctuation and one-dark-pro keeps punctuation receded, so the lambda bodies stay readable. github-light for light cards that will sit next to .NET docs.
using System; or file-scoped namespace line — it is both idiomatic and the cheapest way to make auto-detection land on C# instead of TypeScript..; a single-line Where().Select().OrderBy() is unreadable at any font size that fits a 16:9 card.$"Order {id} at {time}" inside a card is the one place braces and quotes collide, so keep that line short and away from the card's right edge.Feature by feature, against the other code screenshot tools.