[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-dotnet-system-text-json-net11":3,"mdc-74sq25-key":37,"related-org-dotnet-system-text-json-net11":2428,"related-repo-dotnet-system-text-json-net11":2593},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":25,"repoUrl":26,"updatedAt":27,"license":28,"forks":29,"topics":30,"repo":32,"sourceUrl":35,"mdContent":36},"system-text-json-net11","implement System.Text.Json APIs in .NET 11","Imperative guidance for the System.Text.Json APIs added in .NET 11: the built-in `JsonNamingPolicy.PascalCase` naming policy, and the strongly-typed `JsonSerializerOptions.GetTypeInfo\u003CT>()` and `JsonSerializerOptions.TryGetTypeInfo\u003CT>(out JsonTypeInfo\u003CT>? info)` metadata accessors. USE FOR: serializing or deserializing JSON in a net11.0-or-later project when you need PascalCase JSON property names without writing a custom naming policy, a strongly-typed `JsonTypeInfo\u003CT>` instead of the non-generic `JsonTypeInfo`, or a no-throw way to probe whether a type's serialization metadata is resolved. DO NOT USE FOR: projects targeting net10.0 or earlier (none of these APIs exist there), JSON libraries other than System.Text.Json (e.g. Newtonsoft.Json), or camelCase \u002F snake_case \u002F kebab-case naming — those policies shipped in earlier releases.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"dotnet",".NET (Microsoft)","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fdotnet.png",[12,16,19,22],{"name":13,"slug":14,"type":15},"C#","csharp","tag",{"name":17,"slug":18,"type":15},".NET","net",{"name":20,"slug":21,"type":15},"Documentation","documentation",{"name":23,"slug":24,"type":15},"JSON","json",4576,"https:\u002F\u002Fgithub.com\u002Fdotnet\u002Fskills","2026-07-25T05:31:24.299801","MIT",332,[31],"agent-skills",{"repoUrl":26,"stars":25,"forks":29,"topics":33,"description":34},[31],"Repository for skills to assist AI coding agents with .NET and C#","https:\u002F\u002Fgithub.com\u002Fdotnet\u002Fskills\u002Ftree\u002FHEAD\u002Fplugins\u002Fdotnet11\u002Fskills\u002Fsystem-text-json-net11","---\nname: system-text-json-net11\ndescription: >\n  Imperative guidance for the System.Text.Json APIs added in .NET 11: the built-in\n  `JsonNamingPolicy.PascalCase` naming policy, and the strongly-typed\n  `JsonSerializerOptions.GetTypeInfo\u003CT>()` and\n  `JsonSerializerOptions.TryGetTypeInfo\u003CT>(out JsonTypeInfo\u003CT>? info)`\n  metadata accessors.\n  USE FOR: serializing or deserializing JSON in a net11.0-or-later project when you need\n  PascalCase JSON property names without writing a custom naming policy, a strongly-typed\n  `JsonTypeInfo\u003CT>` instead of the non-generic `JsonTypeInfo`, or a no-throw way to probe\n  whether a type's serialization metadata is resolved.\n  DO NOT USE FOR: projects targeting net10.0 or earlier (none of these APIs exist there),\n  JSON libraries other than System.Text.Json (e.g. Newtonsoft.Json), or camelCase \u002F\n  snake_case \u002F kebab-case naming — those policies shipped in earlier releases.\nlicense: MIT\n---\n\n# System.Text.Json — .NET 11\n\nThree APIs were added to `System.Text.Json` in .NET 11. This skill tells you exactly\nwhen to reach for each one, what to write, what **not** to write, and how to prove the\nresult runs. Do not describe these APIs to the user — apply them, then run the code and\nshow the output.\n\n| API | Replaces the pre-.NET-11 workaround of... |\n| --- | --- |\n| `JsonNamingPolicy.PascalCase` (static property) | writing a custom `JsonNamingPolicy` subclass or hand-annotating every member with `[JsonPropertyName]` |\n| `JsonSerializerOptions.GetTypeInfo\u003CT>()` | calling non-generic `GetTypeInfo(typeof(T))` and casting to `JsonTypeInfo\u003CT>` |\n| `JsonSerializerOptions.TryGetTypeInfo\u003CT>(out JsonTypeInfo\u003CT>? info)` | wrapping `GetTypeInfo` in `try`\u002F`catch` to probe availability |\n\n## Step 0 — Confirm you can target .NET 11\n\nThese APIs only exist in the .NET 11 base class library. Before writing code:\n\n1. Run `dotnet --list-sdks` and confirm an SDK that can target `net11.0` is present — an\n   `11.x` SDK, or any later SDK (`12.x`+) that has the `net11.0` targeting pack installed.\n2. If no such SDK is available, **stop**: tell the user these APIs require targeting\n   `net11.0` (on the .NET 11 SDK or later) and cannot compile on `net10.0` or earlier. Do\n   not fall back to a custom implementation and pretend it is the new API.\n\n## Decision table — symptom → do this → never do this\n\nMatch the user's request to a row, apply the **Do this** cell verbatim, and confirm the\n**Verify** column before you are done.\n\n| User asks for… | Do this (on `net11.0`) | Never do this | Verify |\n| --- | --- | --- | --- |\n| PascalCase JSON property names | `options.PropertyNamingPolicy = JsonNamingPolicy.PascalCase;` | define `class …: JsonNamingPolicy`; add per-member `[JsonPropertyName]`; string-case the names yourself | output JSON keys are PascalCase — e.g. `\"Name\"`, `\"Age\"` |\n| Strongly-typed metadata `JsonTypeInfo\u003CT>` | set `TypeInfoResolver = new DefaultJsonTypeInfoResolver()`, then `JsonTypeInfo\u003CT> ti = options.GetTypeInfo\u003CT>();` | `(JsonTypeInfo\u003CT>)options.GetTypeInfo(typeof(T))` | variable is typed `JsonTypeInfo\u003CT>`, no cast |\n| Probe whether metadata is resolved | `if (options.TryGetTypeInfo\u003CT>(out var ti)) { … } else { … }` | `try { options.GetTypeInfo\u003CT>(); } catch (…) { … }` | no `try`\u002F`catch`; both branches handled |\n\n## Rule 1 — PascalCase property names\n\n**When** the user wants JSON output whose property names are PascalCase (`Name`, `Age`)\nand asks for the built-in \u002F framework-provided way:\n\n1. Create or reuse a `JsonSerializerOptions` and set\n   `PropertyNamingPolicy = JsonNamingPolicy.PascalCase`.\n2. Serialize with those options.\n\nDo **not** write a `JsonNamingPolicy` subclass, do **not** add `[JsonPropertyName(\"…\")]`\nattributes to force casing, and do **not** upper-case the first letter of each name by\nhand. `JsonNamingPolicy.PascalCase` is the single correct answer on .NET 11.\n\n```csharp\n\u002F\u002F Console project (reflection enabled by default). To run this as a file-based app\n\u002F\u002F (dotnet run app.cs), also set TypeInfoResolver = new DefaultJsonTypeInfoResolver()\n\u002F\u002F — see \"Producing runnable output\" below.\nusing System.Text.Json;\n\nvar options = new JsonSerializerOptions\n{\n    PropertyNamingPolicy = JsonNamingPolicy.PascalCase\n};\nstring json = JsonSerializer.Serialize(new { name = \"Jane\", age = 30 }, options);\nConsole.WriteLine(json);\n\u002F\u002F {\"Name\":\"Jane\",\"Age\":30}\n```\n\n## Rule 2 — Strongly-typed `JsonTypeInfo\u003CT>`\n\n**When** the user wants type metadata back as `JsonTypeInfo\u003CT>` (not the non-generic\n`JsonTypeInfo` that needs a cast):\n\n1. Call `options.GetTypeInfo\u003CT>()` — it returns `JsonTypeInfo\u003CT>` directly.\n2. Assign it to a `JsonTypeInfo\u003CT>` variable and use it (e.g. pass it to\n   `JsonSerializer.Serialize`\u002F`Deserialize`).\n\nDo **not** call the non-generic `GetTypeInfo(Type)` overload and cast the result.\n\n> **Requires a resolver.** `GetTypeInfo\u003CT>()` throws `NotSupportedException`\n> (`NoMetadataForType`) unless the options have a `TypeInfoResolver` — set\n> `TypeInfoResolver = new DefaultJsonTypeInfoResolver()` for reflection-based apps, or use\n> a source-generated `JsonSerializerContext` for trimmed\u002FAOT apps.\n\n```csharp\n\u002F\u002F File-based app (run: dotnet run app.cs). In a .csproj project, remove this line and\n\u002F\u002F set \u003CTargetFramework>net11.0\u003C\u002FTargetFramework> in the project file instead.\n#:property TargetFramework=net11.0\n\nusing System.Text.Json;\nusing System.Text.Json.Serialization.Metadata;\n\nvar options = new JsonSerializerOptions\n{\n    TypeInfoResolver = new DefaultJsonTypeInfoResolver()\n};\n\nJsonTypeInfo\u003CPerson> typeInfo = options.GetTypeInfo\u003CPerson>();\nConsole.WriteLine(typeInfo.Type.Name); \u002F\u002F Person\n\nrecord Person(string Name, int Age);\n```\n\n## Rule 3 — Probe metadata without throwing\n\n**When** the user wants to check whether metadata for `T` is available and branch on it —\n*without* an exception being thrown when it is not:\n\n1. Call `options.TryGetTypeInfo\u003CT>(out var info)`.\n2. Handle the `true` branch (metadata resolved, use `info`) and the `false` branch\n   (not resolved) explicitly.\n\nDo **not** wrap `GetTypeInfo\u003CT>()` in `try`\u002F`catch` to detect the missing case — that is\nexactly the anti-pattern this API removes. `TryGetTypeInfo\u003CT>` returns `false` (instead of\nthrowing) when no resolver can produce metadata for `T`, which is precisely the case you\nwant to branch on.\n\n```csharp\n\u002F\u002F File-based app (run: dotnet run app.cs). In a .csproj project, remove this line and\n\u002F\u002F set \u003CTargetFramework>net11.0\u003C\u002FTargetFramework> in the project file instead.\n#:property TargetFramework=net11.0\n\nusing System.Text.Json;\nusing System.Text.Json.Serialization.Metadata;\n\n\u002F\u002F Configured with a resolver → metadata is available.\nvar configured = new JsonSerializerOptions\n{\n    TypeInfoResolver = new DefaultJsonTypeInfoResolver()\n};\nif (configured.TryGetTypeInfo\u003CPerson>(out JsonTypeInfo\u003CPerson>? info) && info is not null)\n{\n    Console.WriteLine($\"Resolved: {info.Type.Name}\"); \u002F\u002F Resolved: Person\n}\nelse\n{\n    Console.WriteLine(\"Type info not available\");\n}\n\n\u002F\u002F No resolver → TryGetTypeInfo returns false instead of throwing.\nvar empty = new JsonSerializerOptions();\nConsole.WriteLine(empty.TryGetTypeInfo\u003CPerson>(out _)); \u002F\u002F False\n\nrecord Person(string Name, int Age);\n```\n\n## Producing runnable output on `net11.0`\n\nThe task is not done until the program runs on `net11.0` and prints its JSON. Prefer a\nconsole **project** — reflection-based serialization works there out of the box. A\nfile-based app also works but has one important caveat (below).\n\n### Option A — console project (recommended)\n\nCreate a project whose `.csproj` contains `\u003CTargetFramework>net11.0\u003C\u002FTargetFramework>`,\nput the code in `Program.cs`, then run `dotnet run`. Confirm the process exits with code 0\nand prints the expected JSON.\n\n```csharp\nusing System.Text.Json;\n\nvar options = new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.PascalCase };\nConsole.WriteLine(JsonSerializer.Serialize(new { name = \"Jane\", age = 30 }, options));\n\u002F\u002F {\"Name\":\"Jane\",\"Age\":30}\n```\n\n### Option B — file-based app (quickest, one caveat)\n\nSave as `app.cs`, then run `dotnet run app.cs`; the first directive pins the framework.\n\n> **Caveat — file-based apps disable System.Text.Json reflection.** In a `dotnet run app.cs`\n> file-based app, `JsonSerializer.IsReflectionEnabledByDefault` is `false`, so plain\n> reflection serialization throws `NotSupportedException` (`NoMetadataForType`). Set an\n> explicit `TypeInfoResolver = new DefaultJsonTypeInfoResolver()` on the options (as below),\n> or use a source-generated `JsonSerializerContext`. A regular project does **not** need this.\n\n```csharp\n\u002F\u002F File-based app (run: dotnet run app.cs). In a .csproj project, remove this line and\n\u002F\u002F set \u003CTargetFramework>net11.0\u003C\u002FTargetFramework> in the project file instead.\n#:property TargetFramework=net11.0\n\nusing System.Text.Json;\nusing System.Text.Json.Serialization.Metadata;\n\nvar options = new JsonSerializerOptions\n{\n    PropertyNamingPolicy = JsonNamingPolicy.PascalCase,\n    TypeInfoResolver = new DefaultJsonTypeInfoResolver()\n};\nConsole.WriteLine(JsonSerializer.Serialize(new { name = \"Jane\", age = 30 }, options));\n\u002F\u002F {\"Name\":\"Jane\",\"Age\":30}\n```\n\n## Worked example — serialize with typed metadata + PascalCase\n\nThe record below uses lowercase member names on purpose, so the PascalCase policy\nvisibly rewrites them in the output:\n\n```csharp\n\u002F\u002F File-based app (run: dotnet run app.cs). In a .csproj project, remove this line and\n\u002F\u002F set \u003CTargetFramework>net11.0\u003C\u002FTargetFramework> in the project file instead.\n#:property TargetFramework=net11.0\n\nusing System.Text.Json;\nusing System.Text.Json.Serialization.Metadata;\n\nvar options = new JsonSerializerOptions\n{\n    PropertyNamingPolicy = JsonNamingPolicy.PascalCase,\n    TypeInfoResolver = new DefaultJsonTypeInfoResolver()\n};\n\nJsonTypeInfo\u003CPerson> typeInfo = options.GetTypeInfo\u003CPerson>();\nstring json = JsonSerializer.Serialize(new Person(\"Jane\", 30), typeInfo);\nConsole.WriteLine(json);\n\u002F\u002F {\"Name\":\"Jane\",\"Age\":30}\n\nrecord Person(string name, int age);\n```\n\n## Validation checklist\n\nBefore reporting success, confirm every applicable box:\n\n- [ ] The project or file-based app targets `net11.0` (visible in the `.csproj` or the\n      `#:property TargetFramework=net11.0` directive).\n- [ ] PascalCase requests use `JsonNamingPolicy.PascalCase` — no custom `JsonNamingPolicy`\n      subclass and no per-member `[JsonPropertyName]` attributes just to change casing.\n- [ ] Typed-metadata requests use the generic `GetTypeInfo\u003CT>()` — no cast of a\n      non-generic `JsonTypeInfo` — and the options set a `TypeInfoResolver` (e.g.\n      `DefaultJsonTypeInfoResolver`) so the call doesn't throw `NoMetadataForType`.\n- [ ] Probing requests use `TryGetTypeInfo\u003CT>(out …)` — no `try`\u002F`catch` around\n      `GetTypeInfo`.\n- [ ] The program was actually run (`dotnet run …`), exited 0, and its printed JSON shows\n      the expected property names (e.g. `\"Name\"`, `\"Age\"`).\n- [ ] If a **file-based app** (`dotnet run app.cs`) is used, every `JsonSerializerOptions`\n      sets a `TypeInfoResolver` — file-based apps disable reflection so plain serialization\n      throws `NoMetadataForType` without one.\n\n## Common pitfalls\n\n| Pitfall | Fix |\n| --- | --- |\n| Hand-rolling a `class … : JsonNamingPolicy` for PascalCase | Delete it; set `PropertyNamingPolicy = JsonNamingPolicy.PascalCase`. |\n| Adding `[JsonPropertyName(\"Name\")]` to every member to force casing | Remove the attributes; the naming policy handles all members at once. |\n| Casting `(JsonTypeInfo\u003CT>)options.GetTypeInfo(typeof(T))` | Call the generic `options.GetTypeInfo\u003CT>()`; no cast needed. |\n| `try { options.GetTypeInfo\u003CT>(); } catch (…) { … }` to test availability | Replace with `if (options.TryGetTypeInfo\u003CT>(out var info)) { … }`. |\n| `NotSupportedException` \u002F `NoMetadataForType` from `GetTypeInfo\u003CT>()` | The options have no resolver. Set `TypeInfoResolver = new DefaultJsonTypeInfoResolver()` (reflection) or a source-generated `JsonSerializerContext` (trim\u002FAOT). |\n| `NoMetadataForType` even for a plain `Serialize` in a `dotnet run app.cs` file-based app | File-based apps disable STJ reflection. Add `TypeInfoResolver = new DefaultJsonTypeInfoResolver()`, or run it as a normal project instead. |\n| Leaving the app on the SDK's default TFM | Pin `net11.0` explicitly so the .NET 11 APIs resolve and the output shows the target. |\n| Claiming success without running | Run `dotnet run` and paste the actual JSON output; the target is a working, executed program. |\n\n## More info\n\n- [JsonNamingPolicy class](https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fapi\u002Fsystem.text.json.jsonnamingpolicy) — built-in naming policies including `PascalCase`\n- [JsonSerializerOptions.GetTypeInfo](https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fapi\u002Fsystem.text.json.jsonserializeroptions.gettypeinfo) — typed and non-typed metadata access\n- [JsonTypeInfo\\\u003CT\\>](https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fapi\u002Fsystem.text.json.serialization.metadata.jsontypeinfo-1) — strongly-typed serialization metadata\n- [DefaultJsonTypeInfoResolver](https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fapi\u002Fsystem.text.json.serialization.metadata.defaultjsontypeinforesolver) — reflection-based resolver required by `GetTypeInfo`\u002F`TryGetTypeInfo`\n- [File-based apps](https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fcore\u002Fsdk\u002Ffile-based-apps) — `dotnet run app.cs` and the `#:property` directive\n",{"data":38,"body":39},{"name":4,"description":6,"license":28},{"type":40,"children":41},"root",[42,51,74,207,214,219,295,301,320,511,517,542,571,616,737,748,772,822,840,901,1032,1038,1063,1106,1157,1366,1377,1396,1403,1440,1484,1490,1510,1579,1685,1691,1696,1838,1844,1849,2071,2077,2320,2326,2422],{"type":43,"tag":44,"props":45,"children":47},"element","h1",{"id":46},"systemtextjson-net-11",[48],{"type":49,"value":50},"text","System.Text.Json — .NET 11",{"type":43,"tag":52,"props":53,"children":54},"p",{},[55,57,64,66,72],{"type":49,"value":56},"Three APIs were added to ",{"type":43,"tag":58,"props":59,"children":61},"code",{"className":60},[],[62],{"type":49,"value":63},"System.Text.Json",{"type":49,"value":65}," in .NET 11. This skill tells you exactly\nwhen to reach for each one, what to write, what ",{"type":43,"tag":67,"props":68,"children":69},"strong",{},[70],{"type":49,"value":71},"not",{"type":49,"value":73}," to write, and how to prove the\nresult runs. Do not describe these APIs to the user — apply them, then run the code and\nshow the output.",{"type":43,"tag":75,"props":76,"children":77},"table",{},[78,97],{"type":43,"tag":79,"props":80,"children":81},"thead",{},[82],{"type":43,"tag":83,"props":84,"children":85},"tr",{},[86,92],{"type":43,"tag":87,"props":88,"children":89},"th",{},[90],{"type":49,"value":91},"API",{"type":43,"tag":87,"props":93,"children":94},{},[95],{"type":49,"value":96},"Replaces the pre-.NET-11 workaround of...",{"type":43,"tag":98,"props":99,"children":100},"tbody",{},[101,135,166],{"type":43,"tag":83,"props":102,"children":103},{},[104,116],{"type":43,"tag":105,"props":106,"children":107},"td",{},[108,114],{"type":43,"tag":58,"props":109,"children":111},{"className":110},[],[112],{"type":49,"value":113},"JsonNamingPolicy.PascalCase",{"type":49,"value":115}," (static property)",{"type":43,"tag":105,"props":117,"children":118},{},[119,121,127,129],{"type":49,"value":120},"writing a custom ",{"type":43,"tag":58,"props":122,"children":124},{"className":123},[],[125],{"type":49,"value":126},"JsonNamingPolicy",{"type":49,"value":128}," subclass or hand-annotating every member with ",{"type":43,"tag":58,"props":130,"children":132},{"className":131},[],[133],{"type":49,"value":134},"[JsonPropertyName]",{"type":43,"tag":83,"props":136,"children":137},{},[138,147],{"type":43,"tag":105,"props":139,"children":140},{},[141],{"type":43,"tag":58,"props":142,"children":144},{"className":143},[],[145],{"type":49,"value":146},"JsonSerializerOptions.GetTypeInfo\u003CT>()",{"type":43,"tag":105,"props":148,"children":149},{},[150,152,158,160],{"type":49,"value":151},"calling non-generic ",{"type":43,"tag":58,"props":153,"children":155},{"className":154},[],[156],{"type":49,"value":157},"GetTypeInfo(typeof(T))",{"type":49,"value":159}," and casting to ",{"type":43,"tag":58,"props":161,"children":163},{"className":162},[],[164],{"type":49,"value":165},"JsonTypeInfo\u003CT>",{"type":43,"tag":83,"props":167,"children":168},{},[169,178],{"type":43,"tag":105,"props":170,"children":171},{},[172],{"type":43,"tag":58,"props":173,"children":175},{"className":174},[],[176],{"type":49,"value":177},"JsonSerializerOptions.TryGetTypeInfo\u003CT>(out JsonTypeInfo\u003CT>? info)",{"type":43,"tag":105,"props":179,"children":180},{},[181,183,189,191,197,199,205],{"type":49,"value":182},"wrapping ",{"type":43,"tag":58,"props":184,"children":186},{"className":185},[],[187],{"type":49,"value":188},"GetTypeInfo",{"type":49,"value":190}," in ",{"type":43,"tag":58,"props":192,"children":194},{"className":193},[],[195],{"type":49,"value":196},"try",{"type":49,"value":198},"\u002F",{"type":43,"tag":58,"props":200,"children":202},{"className":201},[],[203],{"type":49,"value":204},"catch",{"type":49,"value":206}," to probe availability",{"type":43,"tag":208,"props":209,"children":211},"h2",{"id":210},"step-0-confirm-you-can-target-net-11",[212],{"type":49,"value":213},"Step 0 — Confirm you can target .NET 11",{"type":43,"tag":52,"props":215,"children":216},{},[217],{"type":49,"value":218},"These APIs only exist in the .NET 11 base class library. Before writing code:",{"type":43,"tag":220,"props":221,"children":222},"ol",{},[223,268],{"type":43,"tag":224,"props":225,"children":226},"li",{},[227,229,235,237,243,245,251,253,259,261,266],{"type":49,"value":228},"Run ",{"type":43,"tag":58,"props":230,"children":232},{"className":231},[],[233],{"type":49,"value":234},"dotnet --list-sdks",{"type":49,"value":236}," and confirm an SDK that can target ",{"type":43,"tag":58,"props":238,"children":240},{"className":239},[],[241],{"type":49,"value":242},"net11.0",{"type":49,"value":244}," is present — an\n",{"type":43,"tag":58,"props":246,"children":248},{"className":247},[],[249],{"type":49,"value":250},"11.x",{"type":49,"value":252}," SDK, or any later SDK (",{"type":43,"tag":58,"props":254,"children":256},{"className":255},[],[257],{"type":49,"value":258},"12.x",{"type":49,"value":260},"+) that has the ",{"type":43,"tag":58,"props":262,"children":264},{"className":263},[],[265],{"type":49,"value":242},{"type":49,"value":267}," targeting pack installed.",{"type":43,"tag":224,"props":269,"children":270},{},[271,273,278,280,285,287,293],{"type":49,"value":272},"If no such SDK is available, ",{"type":43,"tag":67,"props":274,"children":275},{},[276],{"type":49,"value":277},"stop",{"type":49,"value":279},": tell the user these APIs require targeting\n",{"type":43,"tag":58,"props":281,"children":283},{"className":282},[],[284],{"type":49,"value":242},{"type":49,"value":286}," (on the .NET 11 SDK or later) and cannot compile on ",{"type":43,"tag":58,"props":288,"children":290},{"className":289},[],[291],{"type":49,"value":292},"net10.0",{"type":49,"value":294}," or earlier. Do\nnot fall back to a custom implementation and pretend it is the new API.",{"type":43,"tag":208,"props":296,"children":298},{"id":297},"decision-table-symptom-do-this-never-do-this",[299],{"type":49,"value":300},"Decision table — symptom → do this → never do this",{"type":43,"tag":52,"props":302,"children":303},{},[304,306,311,313,318],{"type":49,"value":305},"Match the user's request to a row, apply the ",{"type":43,"tag":67,"props":307,"children":308},{},[309],{"type":49,"value":310},"Do this",{"type":49,"value":312}," cell verbatim, and confirm the\n",{"type":43,"tag":67,"props":314,"children":315},{},[316],{"type":49,"value":317},"Verify",{"type":49,"value":319}," column before you are done.",{"type":43,"tag":75,"props":321,"children":322},{},[323,355],{"type":43,"tag":79,"props":324,"children":325},{},[326],{"type":43,"tag":83,"props":327,"children":328},{},[329,334,346,351],{"type":43,"tag":87,"props":330,"children":331},{},[332],{"type":49,"value":333},"User asks for…",{"type":43,"tag":87,"props":335,"children":336},{},[337,339,344],{"type":49,"value":338},"Do this (on ",{"type":43,"tag":58,"props":340,"children":342},{"className":341},[],[343],{"type":49,"value":242},{"type":49,"value":345},")",{"type":43,"tag":87,"props":347,"children":348},{},[349],{"type":49,"value":350},"Never do this",{"type":43,"tag":87,"props":352,"children":353},{},[354],{"type":49,"value":317},{"type":43,"tag":98,"props":356,"children":357},{},[358,414,467],{"type":43,"tag":83,"props":359,"children":360},{},[361,366,375,395],{"type":43,"tag":105,"props":362,"children":363},{},[364],{"type":49,"value":365},"PascalCase JSON property names",{"type":43,"tag":105,"props":367,"children":368},{},[369],{"type":43,"tag":58,"props":370,"children":372},{"className":371},[],[373],{"type":49,"value":374},"options.PropertyNamingPolicy = JsonNamingPolicy.PascalCase;",{"type":43,"tag":105,"props":376,"children":377},{},[378,380,386,388,393],{"type":49,"value":379},"define ",{"type":43,"tag":58,"props":381,"children":383},{"className":382},[],[384],{"type":49,"value":385},"class …: JsonNamingPolicy",{"type":49,"value":387},"; add per-member ",{"type":43,"tag":58,"props":389,"children":391},{"className":390},[],[392],{"type":49,"value":134},{"type":49,"value":394},"; string-case the names yourself",{"type":43,"tag":105,"props":396,"children":397},{},[398,400,406,408],{"type":49,"value":399},"output JSON keys are PascalCase — e.g. ",{"type":43,"tag":58,"props":401,"children":403},{"className":402},[],[404],{"type":49,"value":405},"\"Name\"",{"type":49,"value":407},", ",{"type":43,"tag":58,"props":409,"children":411},{"className":410},[],[412],{"type":49,"value":413},"\"Age\"",{"type":43,"tag":83,"props":415,"children":416},{},[417,427,446,455],{"type":43,"tag":105,"props":418,"children":419},{},[420,422],{"type":49,"value":421},"Strongly-typed metadata ",{"type":43,"tag":58,"props":423,"children":425},{"className":424},[],[426],{"type":49,"value":165},{"type":43,"tag":105,"props":428,"children":429},{},[430,432,438,440],{"type":49,"value":431},"set ",{"type":43,"tag":58,"props":433,"children":435},{"className":434},[],[436],{"type":49,"value":437},"TypeInfoResolver = new DefaultJsonTypeInfoResolver()",{"type":49,"value":439},", then ",{"type":43,"tag":58,"props":441,"children":443},{"className":442},[],[444],{"type":49,"value":445},"JsonTypeInfo\u003CT> ti = options.GetTypeInfo\u003CT>();",{"type":43,"tag":105,"props":447,"children":448},{},[449],{"type":43,"tag":58,"props":450,"children":452},{"className":451},[],[453],{"type":49,"value":454},"(JsonTypeInfo\u003CT>)options.GetTypeInfo(typeof(T))",{"type":43,"tag":105,"props":456,"children":457},{},[458,460,465],{"type":49,"value":459},"variable is typed ",{"type":43,"tag":58,"props":461,"children":463},{"className":462},[],[464],{"type":49,"value":165},{"type":49,"value":466},", no cast",{"type":43,"tag":83,"props":468,"children":469},{},[470,475,484,493],{"type":43,"tag":105,"props":471,"children":472},{},[473],{"type":49,"value":474},"Probe whether metadata is resolved",{"type":43,"tag":105,"props":476,"children":477},{},[478],{"type":43,"tag":58,"props":479,"children":481},{"className":480},[],[482],{"type":49,"value":483},"if (options.TryGetTypeInfo\u003CT>(out var ti)) { … } else { … }",{"type":43,"tag":105,"props":485,"children":486},{},[487],{"type":43,"tag":58,"props":488,"children":490},{"className":489},[],[491],{"type":49,"value":492},"try { options.GetTypeInfo\u003CT>(); } catch (…) { … }",{"type":43,"tag":105,"props":494,"children":495},{},[496,498,503,504,509],{"type":49,"value":497},"no ",{"type":43,"tag":58,"props":499,"children":501},{"className":500},[],[502],{"type":49,"value":196},{"type":49,"value":198},{"type":43,"tag":58,"props":505,"children":507},{"className":506},[],[508],{"type":49,"value":204},{"type":49,"value":510},"; both branches handled",{"type":43,"tag":208,"props":512,"children":514},{"id":513},"rule-1-pascalcase-property-names",[515],{"type":49,"value":516},"Rule 1 — PascalCase property names",{"type":43,"tag":52,"props":518,"children":519},{},[520,525,527,533,534,540],{"type":43,"tag":67,"props":521,"children":522},{},[523],{"type":49,"value":524},"When",{"type":49,"value":526}," the user wants JSON output whose property names are PascalCase (",{"type":43,"tag":58,"props":528,"children":530},{"className":529},[],[531],{"type":49,"value":532},"Name",{"type":49,"value":407},{"type":43,"tag":58,"props":535,"children":537},{"className":536},[],[538],{"type":49,"value":539},"Age",{"type":49,"value":541},")\nand asks for the built-in \u002F framework-provided way:",{"type":43,"tag":220,"props":543,"children":544},{},[545,566],{"type":43,"tag":224,"props":546,"children":547},{},[548,550,556,558,564],{"type":49,"value":549},"Create or reuse a ",{"type":43,"tag":58,"props":551,"children":553},{"className":552},[],[554],{"type":49,"value":555},"JsonSerializerOptions",{"type":49,"value":557}," and set\n",{"type":43,"tag":58,"props":559,"children":561},{"className":560},[],[562],{"type":49,"value":563},"PropertyNamingPolicy = JsonNamingPolicy.PascalCase",{"type":49,"value":565},".",{"type":43,"tag":224,"props":567,"children":568},{},[569],{"type":49,"value":570},"Serialize with those options.",{"type":43,"tag":52,"props":572,"children":573},{},[574,576,580,582,587,589,593,595,601,603,607,609,614],{"type":49,"value":575},"Do ",{"type":43,"tag":67,"props":577,"children":578},{},[579],{"type":49,"value":71},{"type":49,"value":581}," write a ",{"type":43,"tag":58,"props":583,"children":585},{"className":584},[],[586],{"type":49,"value":126},{"type":49,"value":588}," subclass, do ",{"type":43,"tag":67,"props":590,"children":591},{},[592],{"type":49,"value":71},{"type":49,"value":594}," add ",{"type":43,"tag":58,"props":596,"children":598},{"className":597},[],[599],{"type":49,"value":600},"[JsonPropertyName(\"…\")]",{"type":49,"value":602},"\nattributes to force casing, and do ",{"type":43,"tag":67,"props":604,"children":605},{},[606],{"type":49,"value":71},{"type":49,"value":608}," upper-case the first letter of each name by\nhand. ",{"type":43,"tag":58,"props":610,"children":612},{"className":611},[],[613],{"type":49,"value":113},{"type":49,"value":615}," is the single correct answer on .NET 11.",{"type":43,"tag":617,"props":618,"children":622},"pre",{"className":619,"code":620,"language":14,"meta":621,"style":621},"language-csharp shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F Console project (reflection enabled by default). To run this as a file-based app\n\u002F\u002F (dotnet run app.cs), also set TypeInfoResolver = new DefaultJsonTypeInfoResolver()\n\u002F\u002F — see \"Producing runnable output\" below.\nusing System.Text.Json;\n\nvar options = new JsonSerializerOptions\n{\n    PropertyNamingPolicy = JsonNamingPolicy.PascalCase\n};\nstring json = JsonSerializer.Serialize(new { name = \"Jane\", age = 30 }, options);\nConsole.WriteLine(json);\n\u002F\u002F {\"Name\":\"Jane\",\"Age\":30}\n","",[623],{"type":43,"tag":58,"props":624,"children":625},{"__ignoreMap":621},[626,637,646,655,664,674,683,692,701,710,719,728],{"type":43,"tag":627,"props":628,"children":631},"span",{"class":629,"line":630},"line",1,[632],{"type":43,"tag":627,"props":633,"children":634},{},[635],{"type":49,"value":636},"\u002F\u002F Console project (reflection enabled by default). To run this as a file-based app\n",{"type":43,"tag":627,"props":638,"children":640},{"class":629,"line":639},2,[641],{"type":43,"tag":627,"props":642,"children":643},{},[644],{"type":49,"value":645},"\u002F\u002F (dotnet run app.cs), also set TypeInfoResolver = new DefaultJsonTypeInfoResolver()\n",{"type":43,"tag":627,"props":647,"children":649},{"class":629,"line":648},3,[650],{"type":43,"tag":627,"props":651,"children":652},{},[653],{"type":49,"value":654},"\u002F\u002F — see \"Producing runnable output\" below.\n",{"type":43,"tag":627,"props":656,"children":658},{"class":629,"line":657},4,[659],{"type":43,"tag":627,"props":660,"children":661},{},[662],{"type":49,"value":663},"using System.Text.Json;\n",{"type":43,"tag":627,"props":665,"children":667},{"class":629,"line":666},5,[668],{"type":43,"tag":627,"props":669,"children":671},{"emptyLinePlaceholder":670},true,[672],{"type":49,"value":673},"\n",{"type":43,"tag":627,"props":675,"children":677},{"class":629,"line":676},6,[678],{"type":43,"tag":627,"props":679,"children":680},{},[681],{"type":49,"value":682},"var options = new JsonSerializerOptions\n",{"type":43,"tag":627,"props":684,"children":686},{"class":629,"line":685},7,[687],{"type":43,"tag":627,"props":688,"children":689},{},[690],{"type":49,"value":691},"{\n",{"type":43,"tag":627,"props":693,"children":695},{"class":629,"line":694},8,[696],{"type":43,"tag":627,"props":697,"children":698},{},[699],{"type":49,"value":700},"    PropertyNamingPolicy = JsonNamingPolicy.PascalCase\n",{"type":43,"tag":627,"props":702,"children":704},{"class":629,"line":703},9,[705],{"type":43,"tag":627,"props":706,"children":707},{},[708],{"type":49,"value":709},"};\n",{"type":43,"tag":627,"props":711,"children":713},{"class":629,"line":712},10,[714],{"type":43,"tag":627,"props":715,"children":716},{},[717],{"type":49,"value":718},"string json = JsonSerializer.Serialize(new { name = \"Jane\", age = 30 }, options);\n",{"type":43,"tag":627,"props":720,"children":722},{"class":629,"line":721},11,[723],{"type":43,"tag":627,"props":724,"children":725},{},[726],{"type":49,"value":727},"Console.WriteLine(json);\n",{"type":43,"tag":627,"props":729,"children":731},{"class":629,"line":730},12,[732],{"type":43,"tag":627,"props":733,"children":734},{},[735],{"type":49,"value":736},"\u002F\u002F {\"Name\":\"Jane\",\"Age\":30}\n",{"type":43,"tag":208,"props":738,"children":740},{"id":739},"rule-2-strongly-typed-jsontypeinfot",[741,743],{"type":49,"value":742},"Rule 2 — Strongly-typed ",{"type":43,"tag":58,"props":744,"children":746},{"className":745},[],[747],{"type":49,"value":165},{"type":43,"tag":52,"props":749,"children":750},{},[751,755,757,762,764,770],{"type":43,"tag":67,"props":752,"children":753},{},[754],{"type":49,"value":524},{"type":49,"value":756}," the user wants type metadata back as ",{"type":43,"tag":58,"props":758,"children":760},{"className":759},[],[761],{"type":49,"value":165},{"type":49,"value":763}," (not the non-generic\n",{"type":43,"tag":58,"props":765,"children":767},{"className":766},[],[768],{"type":49,"value":769},"JsonTypeInfo",{"type":49,"value":771}," that needs a cast):",{"type":43,"tag":220,"props":773,"children":774},{},[775,795],{"type":43,"tag":224,"props":776,"children":777},{},[778,780,786,788,793],{"type":49,"value":779},"Call ",{"type":43,"tag":58,"props":781,"children":783},{"className":782},[],[784],{"type":49,"value":785},"options.GetTypeInfo\u003CT>()",{"type":49,"value":787}," — it returns ",{"type":43,"tag":58,"props":789,"children":791},{"className":790},[],[792],{"type":49,"value":165},{"type":49,"value":794}," directly.",{"type":43,"tag":224,"props":796,"children":797},{},[798,800,805,807,813,814,820],{"type":49,"value":799},"Assign it to a ",{"type":43,"tag":58,"props":801,"children":803},{"className":802},[],[804],{"type":49,"value":165},{"type":49,"value":806}," variable and use it (e.g. pass it to\n",{"type":43,"tag":58,"props":808,"children":810},{"className":809},[],[811],{"type":49,"value":812},"JsonSerializer.Serialize",{"type":49,"value":198},{"type":43,"tag":58,"props":815,"children":817},{"className":816},[],[818],{"type":49,"value":819},"Deserialize",{"type":49,"value":821},").",{"type":43,"tag":52,"props":823,"children":824},{},[825,826,830,832,838],{"type":49,"value":575},{"type":43,"tag":67,"props":827,"children":828},{},[829],{"type":49,"value":71},{"type":49,"value":831}," call the non-generic ",{"type":43,"tag":58,"props":833,"children":835},{"className":834},[],[836],{"type":49,"value":837},"GetTypeInfo(Type)",{"type":49,"value":839}," overload and cast the result.",{"type":43,"tag":841,"props":842,"children":843},"blockquote",{},[844],{"type":43,"tag":52,"props":845,"children":846},{},[847,852,854,860,862,868,870,876,878,884,886,891,893,899],{"type":43,"tag":67,"props":848,"children":849},{},[850],{"type":49,"value":851},"Requires a resolver.",{"type":49,"value":853}," ",{"type":43,"tag":58,"props":855,"children":857},{"className":856},[],[858],{"type":49,"value":859},"GetTypeInfo\u003CT>()",{"type":49,"value":861}," throws ",{"type":43,"tag":58,"props":863,"children":865},{"className":864},[],[866],{"type":49,"value":867},"NotSupportedException",{"type":49,"value":869},"\n(",{"type":43,"tag":58,"props":871,"children":873},{"className":872},[],[874],{"type":49,"value":875},"NoMetadataForType",{"type":49,"value":877},") unless the options have a ",{"type":43,"tag":58,"props":879,"children":881},{"className":880},[],[882],{"type":49,"value":883},"TypeInfoResolver",{"type":49,"value":885}," — set\n",{"type":43,"tag":58,"props":887,"children":889},{"className":888},[],[890],{"type":49,"value":437},{"type":49,"value":892}," for reflection-based apps, or use\na source-generated ",{"type":43,"tag":58,"props":894,"children":896},{"className":895},[],[897],{"type":49,"value":898},"JsonSerializerContext",{"type":49,"value":900}," for trimmed\u002FAOT apps.",{"type":43,"tag":617,"props":902,"children":904},{"className":619,"code":903,"language":14,"meta":621,"style":621},"\u002F\u002F File-based app (run: dotnet run app.cs). In a .csproj project, remove this line and\n\u002F\u002F set \u003CTargetFramework>net11.0\u003C\u002FTargetFramework> in the project file instead.\n#:property TargetFramework=net11.0\n\nusing System.Text.Json;\nusing System.Text.Json.Serialization.Metadata;\n\nvar options = new JsonSerializerOptions\n{\n    TypeInfoResolver = new DefaultJsonTypeInfoResolver()\n};\n\nJsonTypeInfo\u003CPerson> typeInfo = options.GetTypeInfo\u003CPerson>();\nConsole.WriteLine(typeInfo.Type.Name); \u002F\u002F Person\n\nrecord Person(string Name, int Age);\n",[905],{"type":43,"tag":58,"props":906,"children":907},{"__ignoreMap":621},[908,916,924,932,939,946,954,961,968,975,983,990,997,1006,1015,1023],{"type":43,"tag":627,"props":909,"children":910},{"class":629,"line":630},[911],{"type":43,"tag":627,"props":912,"children":913},{},[914],{"type":49,"value":915},"\u002F\u002F File-based app (run: dotnet run app.cs). In a .csproj project, remove this line and\n",{"type":43,"tag":627,"props":917,"children":918},{"class":629,"line":639},[919],{"type":43,"tag":627,"props":920,"children":921},{},[922],{"type":49,"value":923},"\u002F\u002F set \u003CTargetFramework>net11.0\u003C\u002FTargetFramework> in the project file instead.\n",{"type":43,"tag":627,"props":925,"children":926},{"class":629,"line":648},[927],{"type":43,"tag":627,"props":928,"children":929},{},[930],{"type":49,"value":931},"#:property TargetFramework=net11.0\n",{"type":43,"tag":627,"props":933,"children":934},{"class":629,"line":657},[935],{"type":43,"tag":627,"props":936,"children":937},{"emptyLinePlaceholder":670},[938],{"type":49,"value":673},{"type":43,"tag":627,"props":940,"children":941},{"class":629,"line":666},[942],{"type":43,"tag":627,"props":943,"children":944},{},[945],{"type":49,"value":663},{"type":43,"tag":627,"props":947,"children":948},{"class":629,"line":676},[949],{"type":43,"tag":627,"props":950,"children":951},{},[952],{"type":49,"value":953},"using System.Text.Json.Serialization.Metadata;\n",{"type":43,"tag":627,"props":955,"children":956},{"class":629,"line":685},[957],{"type":43,"tag":627,"props":958,"children":959},{"emptyLinePlaceholder":670},[960],{"type":49,"value":673},{"type":43,"tag":627,"props":962,"children":963},{"class":629,"line":694},[964],{"type":43,"tag":627,"props":965,"children":966},{},[967],{"type":49,"value":682},{"type":43,"tag":627,"props":969,"children":970},{"class":629,"line":703},[971],{"type":43,"tag":627,"props":972,"children":973},{},[974],{"type":49,"value":691},{"type":43,"tag":627,"props":976,"children":977},{"class":629,"line":712},[978],{"type":43,"tag":627,"props":979,"children":980},{},[981],{"type":49,"value":982},"    TypeInfoResolver = new DefaultJsonTypeInfoResolver()\n",{"type":43,"tag":627,"props":984,"children":985},{"class":629,"line":721},[986],{"type":43,"tag":627,"props":987,"children":988},{},[989],{"type":49,"value":709},{"type":43,"tag":627,"props":991,"children":992},{"class":629,"line":730},[993],{"type":43,"tag":627,"props":994,"children":995},{"emptyLinePlaceholder":670},[996],{"type":49,"value":673},{"type":43,"tag":627,"props":998,"children":1000},{"class":629,"line":999},13,[1001],{"type":43,"tag":627,"props":1002,"children":1003},{},[1004],{"type":49,"value":1005},"JsonTypeInfo\u003CPerson> typeInfo = options.GetTypeInfo\u003CPerson>();\n",{"type":43,"tag":627,"props":1007,"children":1009},{"class":629,"line":1008},14,[1010],{"type":43,"tag":627,"props":1011,"children":1012},{},[1013],{"type":49,"value":1014},"Console.WriteLine(typeInfo.Type.Name); \u002F\u002F Person\n",{"type":43,"tag":627,"props":1016,"children":1018},{"class":629,"line":1017},15,[1019],{"type":43,"tag":627,"props":1020,"children":1021},{"emptyLinePlaceholder":670},[1022],{"type":49,"value":673},{"type":43,"tag":627,"props":1024,"children":1026},{"class":629,"line":1025},16,[1027],{"type":43,"tag":627,"props":1028,"children":1029},{},[1030],{"type":49,"value":1031},"record Person(string Name, int Age);\n",{"type":43,"tag":208,"props":1033,"children":1035},{"id":1034},"rule-3-probe-metadata-without-throwing",[1036],{"type":49,"value":1037},"Rule 3 — Probe metadata without throwing",{"type":43,"tag":52,"props":1039,"children":1040},{},[1041,1045,1047,1053,1055,1061],{"type":43,"tag":67,"props":1042,"children":1043},{},[1044],{"type":49,"value":524},{"type":49,"value":1046}," the user wants to check whether metadata for ",{"type":43,"tag":58,"props":1048,"children":1050},{"className":1049},[],[1051],{"type":49,"value":1052},"T",{"type":49,"value":1054}," is available and branch on it —\n",{"type":43,"tag":1056,"props":1057,"children":1058},"em",{},[1059],{"type":49,"value":1060},"without",{"type":49,"value":1062}," an exception being thrown when it is not:",{"type":43,"tag":220,"props":1064,"children":1065},{},[1066,1077],{"type":43,"tag":224,"props":1067,"children":1068},{},[1069,1070,1076],{"type":49,"value":779},{"type":43,"tag":58,"props":1071,"children":1073},{"className":1072},[],[1074],{"type":49,"value":1075},"options.TryGetTypeInfo\u003CT>(out var info)",{"type":49,"value":565},{"type":43,"tag":224,"props":1078,"children":1079},{},[1080,1082,1088,1090,1096,1098,1104],{"type":49,"value":1081},"Handle the ",{"type":43,"tag":58,"props":1083,"children":1085},{"className":1084},[],[1086],{"type":49,"value":1087},"true",{"type":49,"value":1089}," branch (metadata resolved, use ",{"type":43,"tag":58,"props":1091,"children":1093},{"className":1092},[],[1094],{"type":49,"value":1095},"info",{"type":49,"value":1097},") and the ",{"type":43,"tag":58,"props":1099,"children":1101},{"className":1100},[],[1102],{"type":49,"value":1103},"false",{"type":49,"value":1105}," branch\n(not resolved) explicitly.",{"type":43,"tag":52,"props":1107,"children":1108},{},[1109,1110,1114,1116,1121,1122,1127,1128,1133,1135,1141,1143,1148,1150,1155],{"type":49,"value":575},{"type":43,"tag":67,"props":1111,"children":1112},{},[1113],{"type":49,"value":71},{"type":49,"value":1115}," wrap ",{"type":43,"tag":58,"props":1117,"children":1119},{"className":1118},[],[1120],{"type":49,"value":859},{"type":49,"value":190},{"type":43,"tag":58,"props":1123,"children":1125},{"className":1124},[],[1126],{"type":49,"value":196},{"type":49,"value":198},{"type":43,"tag":58,"props":1129,"children":1131},{"className":1130},[],[1132],{"type":49,"value":204},{"type":49,"value":1134}," to detect the missing case — that is\nexactly the anti-pattern this API removes. ",{"type":43,"tag":58,"props":1136,"children":1138},{"className":1137},[],[1139],{"type":49,"value":1140},"TryGetTypeInfo\u003CT>",{"type":49,"value":1142}," returns ",{"type":43,"tag":58,"props":1144,"children":1146},{"className":1145},[],[1147],{"type":49,"value":1103},{"type":49,"value":1149}," (instead of\nthrowing) when no resolver can produce metadata for ",{"type":43,"tag":58,"props":1151,"children":1153},{"className":1152},[],[1154],{"type":49,"value":1052},{"type":49,"value":1156},", which is precisely the case you\nwant to branch on.",{"type":43,"tag":617,"props":1158,"children":1160},{"className":619,"code":1159,"language":14,"meta":621,"style":621},"\u002F\u002F File-based app (run: dotnet run app.cs). In a .csproj project, remove this line and\n\u002F\u002F set \u003CTargetFramework>net11.0\u003C\u002FTargetFramework> in the project file instead.\n#:property TargetFramework=net11.0\n\nusing System.Text.Json;\nusing System.Text.Json.Serialization.Metadata;\n\n\u002F\u002F Configured with a resolver → metadata is available.\nvar configured = new JsonSerializerOptions\n{\n    TypeInfoResolver = new DefaultJsonTypeInfoResolver()\n};\nif (configured.TryGetTypeInfo\u003CPerson>(out JsonTypeInfo\u003CPerson>? info) && info is not null)\n{\n    Console.WriteLine($\"Resolved: {info.Type.Name}\"); \u002F\u002F Resolved: Person\n}\nelse\n{\n    Console.WriteLine(\"Type info not available\");\n}\n\n\u002F\u002F No resolver → TryGetTypeInfo returns false instead of throwing.\nvar empty = new JsonSerializerOptions();\nConsole.WriteLine(empty.TryGetTypeInfo\u003CPerson>(out _)); \u002F\u002F False\n\nrecord Person(string Name, int Age);\n",[1161],{"type":43,"tag":58,"props":1162,"children":1163},{"__ignoreMap":621},[1164,1171,1178,1185,1192,1199,1206,1213,1221,1229,1236,1243,1250,1258,1265,1273,1281,1290,1298,1307,1315,1323,1332,1341,1350,1358],{"type":43,"tag":627,"props":1165,"children":1166},{"class":629,"line":630},[1167],{"type":43,"tag":627,"props":1168,"children":1169},{},[1170],{"type":49,"value":915},{"type":43,"tag":627,"props":1172,"children":1173},{"class":629,"line":639},[1174],{"type":43,"tag":627,"props":1175,"children":1176},{},[1177],{"type":49,"value":923},{"type":43,"tag":627,"props":1179,"children":1180},{"class":629,"line":648},[1181],{"type":43,"tag":627,"props":1182,"children":1183},{},[1184],{"type":49,"value":931},{"type":43,"tag":627,"props":1186,"children":1187},{"class":629,"line":657},[1188],{"type":43,"tag":627,"props":1189,"children":1190},{"emptyLinePlaceholder":670},[1191],{"type":49,"value":673},{"type":43,"tag":627,"props":1193,"children":1194},{"class":629,"line":666},[1195],{"type":43,"tag":627,"props":1196,"children":1197},{},[1198],{"type":49,"value":663},{"type":43,"tag":627,"props":1200,"children":1201},{"class":629,"line":676},[1202],{"type":43,"tag":627,"props":1203,"children":1204},{},[1205],{"type":49,"value":953},{"type":43,"tag":627,"props":1207,"children":1208},{"class":629,"line":685},[1209],{"type":43,"tag":627,"props":1210,"children":1211},{"emptyLinePlaceholder":670},[1212],{"type":49,"value":673},{"type":43,"tag":627,"props":1214,"children":1215},{"class":629,"line":694},[1216],{"type":43,"tag":627,"props":1217,"children":1218},{},[1219],{"type":49,"value":1220},"\u002F\u002F Configured with a resolver → metadata is available.\n",{"type":43,"tag":627,"props":1222,"children":1223},{"class":629,"line":703},[1224],{"type":43,"tag":627,"props":1225,"children":1226},{},[1227],{"type":49,"value":1228},"var configured = new JsonSerializerOptions\n",{"type":43,"tag":627,"props":1230,"children":1231},{"class":629,"line":712},[1232],{"type":43,"tag":627,"props":1233,"children":1234},{},[1235],{"type":49,"value":691},{"type":43,"tag":627,"props":1237,"children":1238},{"class":629,"line":721},[1239],{"type":43,"tag":627,"props":1240,"children":1241},{},[1242],{"type":49,"value":982},{"type":43,"tag":627,"props":1244,"children":1245},{"class":629,"line":730},[1246],{"type":43,"tag":627,"props":1247,"children":1248},{},[1249],{"type":49,"value":709},{"type":43,"tag":627,"props":1251,"children":1252},{"class":629,"line":999},[1253],{"type":43,"tag":627,"props":1254,"children":1255},{},[1256],{"type":49,"value":1257},"if (configured.TryGetTypeInfo\u003CPerson>(out JsonTypeInfo\u003CPerson>? info) && info is not null)\n",{"type":43,"tag":627,"props":1259,"children":1260},{"class":629,"line":1008},[1261],{"type":43,"tag":627,"props":1262,"children":1263},{},[1264],{"type":49,"value":691},{"type":43,"tag":627,"props":1266,"children":1267},{"class":629,"line":1017},[1268],{"type":43,"tag":627,"props":1269,"children":1270},{},[1271],{"type":49,"value":1272},"    Console.WriteLine($\"Resolved: {info.Type.Name}\"); \u002F\u002F Resolved: Person\n",{"type":43,"tag":627,"props":1274,"children":1275},{"class":629,"line":1025},[1276],{"type":43,"tag":627,"props":1277,"children":1278},{},[1279],{"type":49,"value":1280},"}\n",{"type":43,"tag":627,"props":1282,"children":1284},{"class":629,"line":1283},17,[1285],{"type":43,"tag":627,"props":1286,"children":1287},{},[1288],{"type":49,"value":1289},"else\n",{"type":43,"tag":627,"props":1291,"children":1293},{"class":629,"line":1292},18,[1294],{"type":43,"tag":627,"props":1295,"children":1296},{},[1297],{"type":49,"value":691},{"type":43,"tag":627,"props":1299,"children":1301},{"class":629,"line":1300},19,[1302],{"type":43,"tag":627,"props":1303,"children":1304},{},[1305],{"type":49,"value":1306},"    Console.WriteLine(\"Type info not available\");\n",{"type":43,"tag":627,"props":1308,"children":1310},{"class":629,"line":1309},20,[1311],{"type":43,"tag":627,"props":1312,"children":1313},{},[1314],{"type":49,"value":1280},{"type":43,"tag":627,"props":1316,"children":1318},{"class":629,"line":1317},21,[1319],{"type":43,"tag":627,"props":1320,"children":1321},{"emptyLinePlaceholder":670},[1322],{"type":49,"value":673},{"type":43,"tag":627,"props":1324,"children":1326},{"class":629,"line":1325},22,[1327],{"type":43,"tag":627,"props":1328,"children":1329},{},[1330],{"type":49,"value":1331},"\u002F\u002F No resolver → TryGetTypeInfo returns false instead of throwing.\n",{"type":43,"tag":627,"props":1333,"children":1335},{"class":629,"line":1334},23,[1336],{"type":43,"tag":627,"props":1337,"children":1338},{},[1339],{"type":49,"value":1340},"var empty = new JsonSerializerOptions();\n",{"type":43,"tag":627,"props":1342,"children":1344},{"class":629,"line":1343},24,[1345],{"type":43,"tag":627,"props":1346,"children":1347},{},[1348],{"type":49,"value":1349},"Console.WriteLine(empty.TryGetTypeInfo\u003CPerson>(out _)); \u002F\u002F False\n",{"type":43,"tag":627,"props":1351,"children":1353},{"class":629,"line":1352},25,[1354],{"type":43,"tag":627,"props":1355,"children":1356},{"emptyLinePlaceholder":670},[1357],{"type":49,"value":673},{"type":43,"tag":627,"props":1359,"children":1361},{"class":629,"line":1360},26,[1362],{"type":43,"tag":627,"props":1363,"children":1364},{},[1365],{"type":49,"value":1031},{"type":43,"tag":208,"props":1367,"children":1369},{"id":1368},"producing-runnable-output-on-net110",[1370,1372],{"type":49,"value":1371},"Producing runnable output on ",{"type":43,"tag":58,"props":1373,"children":1375},{"className":1374},[],[1376],{"type":49,"value":242},{"type":43,"tag":52,"props":1378,"children":1379},{},[1380,1382,1387,1389,1394],{"type":49,"value":1381},"The task is not done until the program runs on ",{"type":43,"tag":58,"props":1383,"children":1385},{"className":1384},[],[1386],{"type":49,"value":242},{"type":49,"value":1388}," and prints its JSON. Prefer a\nconsole ",{"type":43,"tag":67,"props":1390,"children":1391},{},[1392],{"type":49,"value":1393},"project",{"type":49,"value":1395}," — reflection-based serialization works there out of the box. A\nfile-based app also works but has one important caveat (below).",{"type":43,"tag":1397,"props":1398,"children":1400},"h3",{"id":1399},"option-a-console-project-recommended",[1401],{"type":49,"value":1402},"Option A — console project (recommended)",{"type":43,"tag":52,"props":1404,"children":1405},{},[1406,1408,1414,1416,1422,1424,1430,1432,1438],{"type":49,"value":1407},"Create a project whose ",{"type":43,"tag":58,"props":1409,"children":1411},{"className":1410},[],[1412],{"type":49,"value":1413},".csproj",{"type":49,"value":1415}," contains ",{"type":43,"tag":58,"props":1417,"children":1419},{"className":1418},[],[1420],{"type":49,"value":1421},"\u003CTargetFramework>net11.0\u003C\u002FTargetFramework>",{"type":49,"value":1423},",\nput the code in ",{"type":43,"tag":58,"props":1425,"children":1427},{"className":1426},[],[1428],{"type":49,"value":1429},"Program.cs",{"type":49,"value":1431},", then run ",{"type":43,"tag":58,"props":1433,"children":1435},{"className":1434},[],[1436],{"type":49,"value":1437},"dotnet run",{"type":49,"value":1439},". Confirm the process exits with code 0\nand prints the expected JSON.",{"type":43,"tag":617,"props":1441,"children":1443},{"className":619,"code":1442,"language":14,"meta":621,"style":621},"using System.Text.Json;\n\nvar options = new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.PascalCase };\nConsole.WriteLine(JsonSerializer.Serialize(new { name = \"Jane\", age = 30 }, options));\n\u002F\u002F {\"Name\":\"Jane\",\"Age\":30}\n",[1444],{"type":43,"tag":58,"props":1445,"children":1446},{"__ignoreMap":621},[1447,1454,1461,1469,1477],{"type":43,"tag":627,"props":1448,"children":1449},{"class":629,"line":630},[1450],{"type":43,"tag":627,"props":1451,"children":1452},{},[1453],{"type":49,"value":663},{"type":43,"tag":627,"props":1455,"children":1456},{"class":629,"line":639},[1457],{"type":43,"tag":627,"props":1458,"children":1459},{"emptyLinePlaceholder":670},[1460],{"type":49,"value":673},{"type":43,"tag":627,"props":1462,"children":1463},{"class":629,"line":648},[1464],{"type":43,"tag":627,"props":1465,"children":1466},{},[1467],{"type":49,"value":1468},"var options = new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.PascalCase };\n",{"type":43,"tag":627,"props":1470,"children":1471},{"class":629,"line":657},[1472],{"type":43,"tag":627,"props":1473,"children":1474},{},[1475],{"type":49,"value":1476},"Console.WriteLine(JsonSerializer.Serialize(new { name = \"Jane\", age = 30 }, options));\n",{"type":43,"tag":627,"props":1478,"children":1479},{"class":629,"line":666},[1480],{"type":43,"tag":627,"props":1481,"children":1482},{},[1483],{"type":49,"value":736},{"type":43,"tag":1397,"props":1485,"children":1487},{"id":1486},"option-b-file-based-app-quickest-one-caveat",[1488],{"type":49,"value":1489},"Option B — file-based app (quickest, one caveat)",{"type":43,"tag":52,"props":1491,"children":1492},{},[1493,1495,1501,1502,1508],{"type":49,"value":1494},"Save as ",{"type":43,"tag":58,"props":1496,"children":1498},{"className":1497},[],[1499],{"type":49,"value":1500},"app.cs",{"type":49,"value":1431},{"type":43,"tag":58,"props":1503,"children":1505},{"className":1504},[],[1506],{"type":49,"value":1507},"dotnet run app.cs",{"type":49,"value":1509},"; the first directive pins the framework.",{"type":43,"tag":841,"props":1511,"children":1512},{},[1513],{"type":43,"tag":52,"props":1514,"children":1515},{},[1516,1521,1523,1528,1530,1536,1538,1543,1545,1550,1552,1557,1559,1564,1566,1571,1573,1577],{"type":43,"tag":67,"props":1517,"children":1518},{},[1519],{"type":49,"value":1520},"Caveat — file-based apps disable System.Text.Json reflection.",{"type":49,"value":1522}," In a ",{"type":43,"tag":58,"props":1524,"children":1526},{"className":1525},[],[1527],{"type":49,"value":1507},{"type":49,"value":1529},"\nfile-based app, ",{"type":43,"tag":58,"props":1531,"children":1533},{"className":1532},[],[1534],{"type":49,"value":1535},"JsonSerializer.IsReflectionEnabledByDefault",{"type":49,"value":1537}," is ",{"type":43,"tag":58,"props":1539,"children":1541},{"className":1540},[],[1542],{"type":49,"value":1103},{"type":49,"value":1544},", so plain\nreflection serialization throws ",{"type":43,"tag":58,"props":1546,"children":1548},{"className":1547},[],[1549],{"type":49,"value":867},{"type":49,"value":1551}," (",{"type":43,"tag":58,"props":1553,"children":1555},{"className":1554},[],[1556],{"type":49,"value":875},{"type":49,"value":1558},"). Set an\nexplicit ",{"type":43,"tag":58,"props":1560,"children":1562},{"className":1561},[],[1563],{"type":49,"value":437},{"type":49,"value":1565}," on the options (as below),\nor use a source-generated ",{"type":43,"tag":58,"props":1567,"children":1569},{"className":1568},[],[1570],{"type":49,"value":898},{"type":49,"value":1572},". A regular project does ",{"type":43,"tag":67,"props":1574,"children":1575},{},[1576],{"type":49,"value":71},{"type":49,"value":1578}," need this.",{"type":43,"tag":617,"props":1580,"children":1582},{"className":619,"code":1581,"language":14,"meta":621,"style":621},"\u002F\u002F File-based app (run: dotnet run app.cs). In a .csproj project, remove this line and\n\u002F\u002F set \u003CTargetFramework>net11.0\u003C\u002FTargetFramework> in the project file instead.\n#:property TargetFramework=net11.0\n\nusing System.Text.Json;\nusing System.Text.Json.Serialization.Metadata;\n\nvar options = new JsonSerializerOptions\n{\n    PropertyNamingPolicy = JsonNamingPolicy.PascalCase,\n    TypeInfoResolver = new DefaultJsonTypeInfoResolver()\n};\nConsole.WriteLine(JsonSerializer.Serialize(new { name = \"Jane\", age = 30 }, options));\n\u002F\u002F {\"Name\":\"Jane\",\"Age\":30}\n",[1583],{"type":43,"tag":58,"props":1584,"children":1585},{"__ignoreMap":621},[1586,1593,1600,1607,1614,1621,1628,1635,1642,1649,1657,1664,1671,1678],{"type":43,"tag":627,"props":1587,"children":1588},{"class":629,"line":630},[1589],{"type":43,"tag":627,"props":1590,"children":1591},{},[1592],{"type":49,"value":915},{"type":43,"tag":627,"props":1594,"children":1595},{"class":629,"line":639},[1596],{"type":43,"tag":627,"props":1597,"children":1598},{},[1599],{"type":49,"value":923},{"type":43,"tag":627,"props":1601,"children":1602},{"class":629,"line":648},[1603],{"type":43,"tag":627,"props":1604,"children":1605},{},[1606],{"type":49,"value":931},{"type":43,"tag":627,"props":1608,"children":1609},{"class":629,"line":657},[1610],{"type":43,"tag":627,"props":1611,"children":1612},{"emptyLinePlaceholder":670},[1613],{"type":49,"value":673},{"type":43,"tag":627,"props":1615,"children":1616},{"class":629,"line":666},[1617],{"type":43,"tag":627,"props":1618,"children":1619},{},[1620],{"type":49,"value":663},{"type":43,"tag":627,"props":1622,"children":1623},{"class":629,"line":676},[1624],{"type":43,"tag":627,"props":1625,"children":1626},{},[1627],{"type":49,"value":953},{"type":43,"tag":627,"props":1629,"children":1630},{"class":629,"line":685},[1631],{"type":43,"tag":627,"props":1632,"children":1633},{"emptyLinePlaceholder":670},[1634],{"type":49,"value":673},{"type":43,"tag":627,"props":1636,"children":1637},{"class":629,"line":694},[1638],{"type":43,"tag":627,"props":1639,"children":1640},{},[1641],{"type":49,"value":682},{"type":43,"tag":627,"props":1643,"children":1644},{"class":629,"line":703},[1645],{"type":43,"tag":627,"props":1646,"children":1647},{},[1648],{"type":49,"value":691},{"type":43,"tag":627,"props":1650,"children":1651},{"class":629,"line":712},[1652],{"type":43,"tag":627,"props":1653,"children":1654},{},[1655],{"type":49,"value":1656},"    PropertyNamingPolicy = JsonNamingPolicy.PascalCase,\n",{"type":43,"tag":627,"props":1658,"children":1659},{"class":629,"line":721},[1660],{"type":43,"tag":627,"props":1661,"children":1662},{},[1663],{"type":49,"value":982},{"type":43,"tag":627,"props":1665,"children":1666},{"class":629,"line":730},[1667],{"type":43,"tag":627,"props":1668,"children":1669},{},[1670],{"type":49,"value":709},{"type":43,"tag":627,"props":1672,"children":1673},{"class":629,"line":999},[1674],{"type":43,"tag":627,"props":1675,"children":1676},{},[1677],{"type":49,"value":1476},{"type":43,"tag":627,"props":1679,"children":1680},{"class":629,"line":1008},[1681],{"type":43,"tag":627,"props":1682,"children":1683},{},[1684],{"type":49,"value":736},{"type":43,"tag":208,"props":1686,"children":1688},{"id":1687},"worked-example-serialize-with-typed-metadata-pascalcase",[1689],{"type":49,"value":1690},"Worked example — serialize with typed metadata + PascalCase",{"type":43,"tag":52,"props":1692,"children":1693},{},[1694],{"type":49,"value":1695},"The record below uses lowercase member names on purpose, so the PascalCase policy\nvisibly rewrites them in the output:",{"type":43,"tag":617,"props":1697,"children":1699},{"className":619,"code":1698,"language":14,"meta":621,"style":621},"\u002F\u002F File-based app (run: dotnet run app.cs). In a .csproj project, remove this line and\n\u002F\u002F set \u003CTargetFramework>net11.0\u003C\u002FTargetFramework> in the project file instead.\n#:property TargetFramework=net11.0\n\nusing System.Text.Json;\nusing System.Text.Json.Serialization.Metadata;\n\nvar options = new JsonSerializerOptions\n{\n    PropertyNamingPolicy = JsonNamingPolicy.PascalCase,\n    TypeInfoResolver = new DefaultJsonTypeInfoResolver()\n};\n\nJsonTypeInfo\u003CPerson> typeInfo = options.GetTypeInfo\u003CPerson>();\nstring json = JsonSerializer.Serialize(new Person(\"Jane\", 30), typeInfo);\nConsole.WriteLine(json);\n\u002F\u002F {\"Name\":\"Jane\",\"Age\":30}\n\nrecord Person(string name, int age);\n",[1700],{"type":43,"tag":58,"props":1701,"children":1702},{"__ignoreMap":621},[1703,1710,1717,1724,1731,1738,1745,1752,1759,1766,1773,1780,1787,1794,1801,1809,1816,1823,1830],{"type":43,"tag":627,"props":1704,"children":1705},{"class":629,"line":630},[1706],{"type":43,"tag":627,"props":1707,"children":1708},{},[1709],{"type":49,"value":915},{"type":43,"tag":627,"props":1711,"children":1712},{"class":629,"line":639},[1713],{"type":43,"tag":627,"props":1714,"children":1715},{},[1716],{"type":49,"value":923},{"type":43,"tag":627,"props":1718,"children":1719},{"class":629,"line":648},[1720],{"type":43,"tag":627,"props":1721,"children":1722},{},[1723],{"type":49,"value":931},{"type":43,"tag":627,"props":1725,"children":1726},{"class":629,"line":657},[1727],{"type":43,"tag":627,"props":1728,"children":1729},{"emptyLinePlaceholder":670},[1730],{"type":49,"value":673},{"type":43,"tag":627,"props":1732,"children":1733},{"class":629,"line":666},[1734],{"type":43,"tag":627,"props":1735,"children":1736},{},[1737],{"type":49,"value":663},{"type":43,"tag":627,"props":1739,"children":1740},{"class":629,"line":676},[1741],{"type":43,"tag":627,"props":1742,"children":1743},{},[1744],{"type":49,"value":953},{"type":43,"tag":627,"props":1746,"children":1747},{"class":629,"line":685},[1748],{"type":43,"tag":627,"props":1749,"children":1750},{"emptyLinePlaceholder":670},[1751],{"type":49,"value":673},{"type":43,"tag":627,"props":1753,"children":1754},{"class":629,"line":694},[1755],{"type":43,"tag":627,"props":1756,"children":1757},{},[1758],{"type":49,"value":682},{"type":43,"tag":627,"props":1760,"children":1761},{"class":629,"line":703},[1762],{"type":43,"tag":627,"props":1763,"children":1764},{},[1765],{"type":49,"value":691},{"type":43,"tag":627,"props":1767,"children":1768},{"class":629,"line":712},[1769],{"type":43,"tag":627,"props":1770,"children":1771},{},[1772],{"type":49,"value":1656},{"type":43,"tag":627,"props":1774,"children":1775},{"class":629,"line":721},[1776],{"type":43,"tag":627,"props":1777,"children":1778},{},[1779],{"type":49,"value":982},{"type":43,"tag":627,"props":1781,"children":1782},{"class":629,"line":730},[1783],{"type":43,"tag":627,"props":1784,"children":1785},{},[1786],{"type":49,"value":709},{"type":43,"tag":627,"props":1788,"children":1789},{"class":629,"line":999},[1790],{"type":43,"tag":627,"props":1791,"children":1792},{"emptyLinePlaceholder":670},[1793],{"type":49,"value":673},{"type":43,"tag":627,"props":1795,"children":1796},{"class":629,"line":1008},[1797],{"type":43,"tag":627,"props":1798,"children":1799},{},[1800],{"type":49,"value":1005},{"type":43,"tag":627,"props":1802,"children":1803},{"class":629,"line":1017},[1804],{"type":43,"tag":627,"props":1805,"children":1806},{},[1807],{"type":49,"value":1808},"string json = JsonSerializer.Serialize(new Person(\"Jane\", 30), typeInfo);\n",{"type":43,"tag":627,"props":1810,"children":1811},{"class":629,"line":1025},[1812],{"type":43,"tag":627,"props":1813,"children":1814},{},[1815],{"type":49,"value":727},{"type":43,"tag":627,"props":1817,"children":1818},{"class":629,"line":1283},[1819],{"type":43,"tag":627,"props":1820,"children":1821},{},[1822],{"type":49,"value":736},{"type":43,"tag":627,"props":1824,"children":1825},{"class":629,"line":1292},[1826],{"type":43,"tag":627,"props":1827,"children":1828},{"emptyLinePlaceholder":670},[1829],{"type":49,"value":673},{"type":43,"tag":627,"props":1831,"children":1832},{"class":629,"line":1300},[1833],{"type":43,"tag":627,"props":1834,"children":1835},{},[1836],{"type":49,"value":1837},"record Person(string name, int age);\n",{"type":43,"tag":208,"props":1839,"children":1841},{"id":1840},"validation-checklist",[1842],{"type":49,"value":1843},"Validation checklist",{"type":43,"tag":52,"props":1845,"children":1846},{},[1847],{"type":49,"value":1848},"Before reporting success, confirm every applicable box:",{"type":43,"tag":1850,"props":1851,"children":1854},"ul",{"className":1852},[1853],"contains-task-list",[1855,1889,1919,1963,1999,2028],{"type":43,"tag":224,"props":1856,"children":1859},{"className":1857},[1858],"task-list-item",[1860,1865,1867,1872,1874,1879,1881,1887],{"type":43,"tag":1861,"props":1862,"children":1864},"input",{"disabled":670,"type":1863},"checkbox",[],{"type":49,"value":1866}," The project or file-based app targets ",{"type":43,"tag":58,"props":1868,"children":1870},{"className":1869},[],[1871],{"type":49,"value":242},{"type":49,"value":1873}," (visible in the ",{"type":43,"tag":58,"props":1875,"children":1877},{"className":1876},[],[1878],{"type":49,"value":1413},{"type":49,"value":1880}," or the\n",{"type":43,"tag":58,"props":1882,"children":1884},{"className":1883},[],[1885],{"type":49,"value":1886},"#:property TargetFramework=net11.0",{"type":49,"value":1888}," directive).",{"type":43,"tag":224,"props":1890,"children":1892},{"className":1891},[1858],[1893,1896,1898,1903,1905,1910,1912,1917],{"type":43,"tag":1861,"props":1894,"children":1895},{"disabled":670,"type":1863},[],{"type":49,"value":1897}," PascalCase requests use ",{"type":43,"tag":58,"props":1899,"children":1901},{"className":1900},[],[1902],{"type":49,"value":113},{"type":49,"value":1904}," — no custom ",{"type":43,"tag":58,"props":1906,"children":1908},{"className":1907},[],[1909],{"type":49,"value":126},{"type":49,"value":1911},"\nsubclass and no per-member ",{"type":43,"tag":58,"props":1913,"children":1915},{"className":1914},[],[1916],{"type":49,"value":134},{"type":49,"value":1918}," attributes just to change casing.",{"type":43,"tag":224,"props":1920,"children":1922},{"className":1921},[1858],[1923,1926,1928,1933,1935,1940,1942,1947,1949,1955,1957,1962],{"type":43,"tag":1861,"props":1924,"children":1925},{"disabled":670,"type":1863},[],{"type":49,"value":1927}," Typed-metadata requests use the generic ",{"type":43,"tag":58,"props":1929,"children":1931},{"className":1930},[],[1932],{"type":49,"value":859},{"type":49,"value":1934}," — no cast of a\nnon-generic ",{"type":43,"tag":58,"props":1936,"children":1938},{"className":1937},[],[1939],{"type":49,"value":769},{"type":49,"value":1941}," — and the options set a ",{"type":43,"tag":58,"props":1943,"children":1945},{"className":1944},[],[1946],{"type":49,"value":883},{"type":49,"value":1948}," (e.g.\n",{"type":43,"tag":58,"props":1950,"children":1952},{"className":1951},[],[1953],{"type":49,"value":1954},"DefaultJsonTypeInfoResolver",{"type":49,"value":1956},") so the call doesn't throw ",{"type":43,"tag":58,"props":1958,"children":1960},{"className":1959},[],[1961],{"type":49,"value":875},{"type":49,"value":565},{"type":43,"tag":224,"props":1964,"children":1966},{"className":1965},[1858],[1967,1970,1972,1978,1980,1985,1986,1991,1993,1998],{"type":43,"tag":1861,"props":1968,"children":1969},{"disabled":670,"type":1863},[],{"type":49,"value":1971}," Probing requests use ",{"type":43,"tag":58,"props":1973,"children":1975},{"className":1974},[],[1976],{"type":49,"value":1977},"TryGetTypeInfo\u003CT>(out …)",{"type":49,"value":1979}," — no ",{"type":43,"tag":58,"props":1981,"children":1983},{"className":1982},[],[1984],{"type":49,"value":196},{"type":49,"value":198},{"type":43,"tag":58,"props":1987,"children":1989},{"className":1988},[],[1990],{"type":49,"value":204},{"type":49,"value":1992}," around\n",{"type":43,"tag":58,"props":1994,"children":1996},{"className":1995},[],[1997],{"type":49,"value":188},{"type":49,"value":565},{"type":43,"tag":224,"props":2000,"children":2002},{"className":2001},[1858],[2003,2006,2008,2014,2016,2021,2022,2027],{"type":43,"tag":1861,"props":2004,"children":2005},{"disabled":670,"type":1863},[],{"type":49,"value":2007}," The program was actually run (",{"type":43,"tag":58,"props":2009,"children":2011},{"className":2010},[],[2012],{"type":49,"value":2013},"dotnet run …",{"type":49,"value":2015},"), exited 0, and its printed JSON shows\nthe expected property names (e.g. ",{"type":43,"tag":58,"props":2017,"children":2019},{"className":2018},[],[2020],{"type":49,"value":405},{"type":49,"value":407},{"type":43,"tag":58,"props":2023,"children":2025},{"className":2024},[],[2026],{"type":49,"value":413},{"type":49,"value":821},{"type":43,"tag":224,"props":2029,"children":2031},{"className":2030},[1858],[2032,2035,2037,2042,2043,2048,2050,2055,2057,2062,2064,2069],{"type":43,"tag":1861,"props":2033,"children":2034},{"disabled":670,"type":1863},[],{"type":49,"value":2036}," If a ",{"type":43,"tag":67,"props":2038,"children":2039},{},[2040],{"type":49,"value":2041},"file-based app",{"type":49,"value":1551},{"type":43,"tag":58,"props":2044,"children":2046},{"className":2045},[],[2047],{"type":49,"value":1507},{"type":49,"value":2049},") is used, every ",{"type":43,"tag":58,"props":2051,"children":2053},{"className":2052},[],[2054],{"type":49,"value":555},{"type":49,"value":2056},"\nsets a ",{"type":43,"tag":58,"props":2058,"children":2060},{"className":2059},[],[2061],{"type":49,"value":883},{"type":49,"value":2063}," — file-based apps disable reflection so plain serialization\nthrows ",{"type":43,"tag":58,"props":2065,"children":2067},{"className":2066},[],[2068],{"type":49,"value":875},{"type":49,"value":2070}," without one.",{"type":43,"tag":208,"props":2072,"children":2074},{"id":2073},"common-pitfalls",[2075],{"type":49,"value":2076},"Common pitfalls",{"type":43,"tag":75,"props":2078,"children":2079},{},[2080,2096],{"type":43,"tag":79,"props":2081,"children":2082},{},[2083],{"type":43,"tag":83,"props":2084,"children":2085},{},[2086,2091],{"type":43,"tag":87,"props":2087,"children":2088},{},[2089],{"type":49,"value":2090},"Pitfall",{"type":43,"tag":87,"props":2092,"children":2093},{},[2094],{"type":49,"value":2095},"Fix",{"type":43,"tag":98,"props":2097,"children":2098},{},[2099,2126,2147,2172,2197,2241,2281,2301],{"type":43,"tag":83,"props":2100,"children":2101},{},[2102,2115],{"type":43,"tag":105,"props":2103,"children":2104},{},[2105,2107,2113],{"type":49,"value":2106},"Hand-rolling a ",{"type":43,"tag":58,"props":2108,"children":2110},{"className":2109},[],[2111],{"type":49,"value":2112},"class … : JsonNamingPolicy",{"type":49,"value":2114}," for PascalCase",{"type":43,"tag":105,"props":2116,"children":2117},{},[2118,2120,2125],{"type":49,"value":2119},"Delete it; set ",{"type":43,"tag":58,"props":2121,"children":2123},{"className":2122},[],[2124],{"type":49,"value":563},{"type":49,"value":565},{"type":43,"tag":83,"props":2127,"children":2128},{},[2129,2142],{"type":43,"tag":105,"props":2130,"children":2131},{},[2132,2134,2140],{"type":49,"value":2133},"Adding ",{"type":43,"tag":58,"props":2135,"children":2137},{"className":2136},[],[2138],{"type":49,"value":2139},"[JsonPropertyName(\"Name\")]",{"type":49,"value":2141}," to every member to force casing",{"type":43,"tag":105,"props":2143,"children":2144},{},[2145],{"type":49,"value":2146},"Remove the attributes; the naming policy handles all members at once.",{"type":43,"tag":83,"props":2148,"children":2149},{},[2150,2160],{"type":43,"tag":105,"props":2151,"children":2152},{},[2153,2155],{"type":49,"value":2154},"Casting ",{"type":43,"tag":58,"props":2156,"children":2158},{"className":2157},[],[2159],{"type":49,"value":454},{"type":43,"tag":105,"props":2161,"children":2162},{},[2163,2165,2170],{"type":49,"value":2164},"Call the generic ",{"type":43,"tag":58,"props":2166,"children":2168},{"className":2167},[],[2169],{"type":49,"value":785},{"type":49,"value":2171},"; no cast needed.",{"type":43,"tag":83,"props":2173,"children":2174},{},[2175,2185],{"type":43,"tag":105,"props":2176,"children":2177},{},[2178,2183],{"type":43,"tag":58,"props":2179,"children":2181},{"className":2180},[],[2182],{"type":49,"value":492},{"type":49,"value":2184}," to test availability",{"type":43,"tag":105,"props":2186,"children":2187},{},[2188,2190,2196],{"type":49,"value":2189},"Replace with ",{"type":43,"tag":58,"props":2191,"children":2193},{"className":2192},[],[2194],{"type":49,"value":2195},"if (options.TryGetTypeInfo\u003CT>(out var info)) { … }",{"type":49,"value":565},{"type":43,"tag":83,"props":2198,"children":2199},{},[2200,2222],{"type":43,"tag":105,"props":2201,"children":2202},{},[2203,2208,2210,2215,2217],{"type":43,"tag":58,"props":2204,"children":2206},{"className":2205},[],[2207],{"type":49,"value":867},{"type":49,"value":2209}," \u002F ",{"type":43,"tag":58,"props":2211,"children":2213},{"className":2212},[],[2214],{"type":49,"value":875},{"type":49,"value":2216}," from ",{"type":43,"tag":58,"props":2218,"children":2220},{"className":2219},[],[2221],{"type":49,"value":859},{"type":43,"tag":105,"props":2223,"children":2224},{},[2225,2227,2232,2234,2239],{"type":49,"value":2226},"The options have no resolver. Set ",{"type":43,"tag":58,"props":2228,"children":2230},{"className":2229},[],[2231],{"type":49,"value":437},{"type":49,"value":2233}," (reflection) or a source-generated ",{"type":43,"tag":58,"props":2235,"children":2237},{"className":2236},[],[2238],{"type":49,"value":898},{"type":49,"value":2240}," (trim\u002FAOT).",{"type":43,"tag":83,"props":2242,"children":2243},{},[2244,2269],{"type":43,"tag":105,"props":2245,"children":2246},{},[2247,2252,2254,2260,2262,2267],{"type":43,"tag":58,"props":2248,"children":2250},{"className":2249},[],[2251],{"type":49,"value":875},{"type":49,"value":2253}," even for a plain ",{"type":43,"tag":58,"props":2255,"children":2257},{"className":2256},[],[2258],{"type":49,"value":2259},"Serialize",{"type":49,"value":2261}," in a ",{"type":43,"tag":58,"props":2263,"children":2265},{"className":2264},[],[2266],{"type":49,"value":1507},{"type":49,"value":2268}," file-based app",{"type":43,"tag":105,"props":2270,"children":2271},{},[2272,2274,2279],{"type":49,"value":2273},"File-based apps disable STJ reflection. Add ",{"type":43,"tag":58,"props":2275,"children":2277},{"className":2276},[],[2278],{"type":49,"value":437},{"type":49,"value":2280},", or run it as a normal project instead.",{"type":43,"tag":83,"props":2282,"children":2283},{},[2284,2289],{"type":43,"tag":105,"props":2285,"children":2286},{},[2287],{"type":49,"value":2288},"Leaving the app on the SDK's default TFM",{"type":43,"tag":105,"props":2290,"children":2291},{},[2292,2294,2299],{"type":49,"value":2293},"Pin ",{"type":43,"tag":58,"props":2295,"children":2297},{"className":2296},[],[2298],{"type":49,"value":242},{"type":49,"value":2300}," explicitly so the .NET 11 APIs resolve and the output shows the target.",{"type":43,"tag":83,"props":2302,"children":2303},{},[2304,2309],{"type":43,"tag":105,"props":2305,"children":2306},{},[2307],{"type":49,"value":2308},"Claiming success without running",{"type":43,"tag":105,"props":2310,"children":2311},{},[2312,2313,2318],{"type":49,"value":228},{"type":43,"tag":58,"props":2314,"children":2316},{"className":2315},[],[2317],{"type":49,"value":1437},{"type":49,"value":2319}," and paste the actual JSON output; the target is a working, executed program.",{"type":43,"tag":208,"props":2321,"children":2323},{"id":2322},"more-info",[2324],{"type":49,"value":2325},"More info",{"type":43,"tag":1850,"props":2327,"children":2328},{},[2329,2349,2361,2372,2395],{"type":43,"tag":224,"props":2330,"children":2331},{},[2332,2341,2343],{"type":43,"tag":2333,"props":2334,"children":2338},"a",{"href":2335,"rel":2336},"https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fapi\u002Fsystem.text.json.jsonnamingpolicy",[2337],"nofollow",[2339],{"type":49,"value":2340},"JsonNamingPolicy class",{"type":49,"value":2342}," — built-in naming policies including ",{"type":43,"tag":58,"props":2344,"children":2346},{"className":2345},[],[2347],{"type":49,"value":2348},"PascalCase",{"type":43,"tag":224,"props":2350,"children":2351},{},[2352,2359],{"type":43,"tag":2333,"props":2353,"children":2356},{"href":2354,"rel":2355},"https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fapi\u002Fsystem.text.json.jsonserializeroptions.gettypeinfo",[2337],[2357],{"type":49,"value":2358},"JsonSerializerOptions.GetTypeInfo",{"type":49,"value":2360}," — typed and non-typed metadata access",{"type":43,"tag":224,"props":2362,"children":2363},{},[2364,2370],{"type":43,"tag":2333,"props":2365,"children":2368},{"href":2366,"rel":2367},"https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fapi\u002Fsystem.text.json.serialization.metadata.jsontypeinfo-1",[2337],[2369],{"type":49,"value":165},{"type":49,"value":2371}," — strongly-typed serialization metadata",{"type":43,"tag":224,"props":2373,"children":2374},{},[2375,2381,2383,2388,2389],{"type":43,"tag":2333,"props":2376,"children":2379},{"href":2377,"rel":2378},"https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fapi\u002Fsystem.text.json.serialization.metadata.defaultjsontypeinforesolver",[2337],[2380],{"type":49,"value":1954},{"type":49,"value":2382}," — reflection-based resolver required by ",{"type":43,"tag":58,"props":2384,"children":2386},{"className":2385},[],[2387],{"type":49,"value":188},{"type":49,"value":198},{"type":43,"tag":58,"props":2390,"children":2392},{"className":2391},[],[2393],{"type":49,"value":2394},"TryGetTypeInfo",{"type":43,"tag":224,"props":2396,"children":2397},{},[2398,2405,2407,2412,2414,2420],{"type":43,"tag":2333,"props":2399,"children":2402},{"href":2400,"rel":2401},"https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fcore\u002Fsdk\u002Ffile-based-apps",[2337],[2403],{"type":49,"value":2404},"File-based apps",{"type":49,"value":2406}," — ",{"type":43,"tag":58,"props":2408,"children":2410},{"className":2409},[],[2411],{"type":49,"value":1507},{"type":49,"value":2413}," and the ",{"type":43,"tag":58,"props":2415,"children":2417},{"className":2416},[],[2418],{"type":49,"value":2419},"#:property",{"type":49,"value":2421}," directive",{"type":43,"tag":2423,"props":2424,"children":2425},"style",{},[2426],{"type":49,"value":2427},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":2429,"total":2592},[2430,2446,2461,2476,2494,2508,2526,2536,2548,2558,2571,2582],{"slug":2431,"name":2431,"fn":2432,"description":2433,"org":2434,"tags":2435,"stars":2443,"repoUrl":2444,"updatedAt":2445},"multithreaded-task-migration","migrate MSBuild tasks to multithreaded mode","Guide for migrating MSBuild tasks to multithreaded mode support, including compatibility red-team review. Use this when converting tasks to thread-safe versions, implementing IMultiThreadableTask, adding TaskEnvironment support, or auditing migrations for behavioral compatibility.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2436,2437,2440],{"name":17,"slug":18,"type":15},{"name":2438,"slug":2439,"type":15},"Engineering","engineering",{"name":2441,"slug":2442,"type":15},"Performance","performance",5535,"https:\u002F\u002Fgithub.com\u002Fdotnet\u002Fmsbuild","2026-07-22T05:37:33.965588",{"slug":2447,"name":2447,"fn":2448,"description":2449,"org":2450,"tags":2451,"stars":25,"repoUrl":26,"updatedAt":2460},"analyzing-dotnet-performance","analyze .NET code for performance anti-patterns","Scans .NET code for ~50 performance anti-patterns across async, memory, strings, collections, LINQ, regex, serialization, and I\u002FO with tiered severity classification. Use when analyzing .NET code for optimization opportunities, reviewing hot paths, or auditing allocation-heavy patterns.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2452,2453,2456,2459],{"name":17,"slug":18,"type":15},{"name":2454,"slug":2455,"type":15},"Code Analysis","code-analysis",{"name":2457,"slug":2458,"type":15},"Debugging","debugging",{"name":2441,"slug":2442,"type":15},"2026-07-12T08:23:25.400375",{"slug":2462,"name":2462,"fn":2463,"description":2464,"org":2465,"tags":2466,"stars":25,"repoUrl":26,"updatedAt":2475},"android-tombstone-symbolication","symbolicate .NET runtime frames in Android tombstones","Symbolicate the .NET runtime frames in an Android tombstone file. Extracts BuildIds and PC offsets from the native backtrace, downloads debug symbols from the Microsoft symbol server, and runs llvm-symbolizer to produce function names with source file and line numbers. USE FOR triaging a .NET MAUI or Mono Android app crash from a tombstone, resolving native backtrace frames in libmonosgen-2.0.so or libcoreclr.so to .NET runtime source code, or investigating SIGABRT, SIGSEGV, or other native signals originating from the .NET runtime on Android. DO NOT USE FOR pure Java\u002FKotlin crashes, managed .NET exceptions that are already captured in logcat, or iOS crash logs. INVOKES Symbolicate-Tombstone.ps1 script, llvm-symbolizer, Microsoft symbol server.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2467,2468,2471,2472],{"name":17,"slug":18,"type":15},{"name":2469,"slug":2470,"type":15},"Android","android",{"name":2457,"slug":2458,"type":15},{"name":2473,"slug":2474,"type":15},"Microsoft","microsoft","2026-07-12T08:23:21.595572",{"slug":2477,"name":2477,"fn":2478,"description":2479,"org":2480,"tags":2481,"stars":25,"repoUrl":26,"updatedAt":2493},"apple-crash-symbolication","symbolicate .NET runtime frames in crash logs","Symbolicate .NET runtime frames in Apple platform .ips crash logs (iOS, tvOS, Mac Catalyst, macOS). Extracts UUIDs and addresses from the native backtrace, locates dSYM debug symbols, and runs atos to produce function names with source file and line numbers. Automatically downloads .dwarf symbols from the Microsoft symbol server using Mach-O UUIDs. USE FOR triaging a .NET MAUI or Mono app crash from an .ips file on any Apple platform, resolving native backtrace frames in libcoreclr or libmonosgen-2.0 to .NET runtime source code, retrieving .ips crash logs from a connected iOS device or iPhone, or investigating EXC_CRASH, EXC_BAD_ACCESS, SIGABRT, or SIGSEGV originating from the .NET runtime. DO NOT USE FOR pure Swift\u002FObjective-C crashes with no .NET components, or Android tombstone files. INVOKES Symbolicate-Crash.ps1 script, atos, dwarfdump, idevicecrashreport.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2482,2483,2484,2487,2490],{"name":17,"slug":18,"type":15},{"name":2457,"slug":2458,"type":15},{"name":2485,"slug":2486,"type":15},"iOS","ios",{"name":2488,"slug":2489,"type":15},"macOS","macos",{"name":2491,"slug":2492,"type":15},"Observability","observability","2026-07-12T08:23:20.369986",{"slug":2495,"name":2495,"fn":2496,"description":2497,"org":2498,"tags":2499,"stars":25,"repoUrl":26,"updatedAt":2507},"assertion-quality","evaluate assertion quality in test suites","Analyzes the variety and depth of assertions across test suites in any language. Use when the user asks to evaluate assertion quality, find shallow tests, identify assertion-free tests (no assertions or only trivial ones like Assert.IsNotNull \u002F toBeTruthy()), flag self-referential or tautological assertions, measure assertion diversity, or audit whether tests verify different facets of behavior. Polyglot: .NET, Python, TS\u002FJS, Java, Go, Ruby, Rust, Swift, Kotlin, PowerShell, C++. DO NOT USE FOR: writing new tests (use code-testing-agent \u002F writing-mstest-tests), mutation reasoning about whether tests would catch a bug (use test-gap-analysis), or a general severity-ranked anti-pattern audit (use test-anti-patterns), fixing or rewriting assertions, or writing, fixing, or modernizing MSTest tests, assertions, or attributes (use writing-mstest-tests).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2500,2501,2504],{"name":2454,"slug":2455,"type":15},{"name":2502,"slug":2503,"type":15},"QA","qa",{"name":2505,"slug":2506,"type":15},"Testing","testing","2026-07-12T08:23:51.277743",{"slug":2509,"name":2509,"fn":2510,"description":2511,"org":2512,"tags":2513,"stars":25,"repoUrl":26,"updatedAt":2525},"author-component","create and review Blazor components","Create or review Blazor components (.razor files) with correct architecture. USE FOR: writing new Blazor components that do NOT involve JavaScript interop, implementing parameters and EventCallback, RenderFragment slots, component lifecycle (OnInitializedAsync, OnParametersSet), async patterns, IAsyncDisposable, CancellationToken, CSS isolation, code-behind. DO NOT USE FOR: creating new projects (use create-blazor-project), JavaScript interop or calling browser APIs from Blazor (use use-js-interop), forms and validation (use collect-user-input), prerendering issues (use support-prerendering), HTTP data fetching patterns (use fetch-and-send-data), coordinating state between unrelated components (use coordinate-components).\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2514,2515,2518,2519,2522],{"name":17,"slug":18,"type":15},{"name":2516,"slug":2517,"type":15},"Blazor","blazor",{"name":13,"slug":14,"type":15},{"name":2520,"slug":2521,"type":15},"UI Components","ui-components",{"name":2523,"slug":2524,"type":15},"Web Development","web-development","2026-07-15T06:03:29.216359",{"slug":2527,"name":2527,"fn":2528,"description":2529,"org":2530,"tags":2531,"stars":25,"repoUrl":26,"updatedAt":2535},"binlog-failure-analysis","analyze MSBuild binary logs","Analyze MSBuild binary logs to diagnose build failures. USE FOR: build errors that are unclear from console output, diagnosing cascading failures across multi-project builds, tracing MSBuild target execution order, and generally any MSBuild build issues. Requires an existing .binlog file. DO NOT USE FOR: generating binlogs (use binlog-generation), non-MSBuild build systems.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2532,2533,2534],{"name":2454,"slug":2455,"type":15},{"name":2457,"slug":2458,"type":15},{"name":2473,"slug":2474,"type":15},"2026-07-12T08:21:34.637923",{"slug":2537,"name":2537,"fn":2538,"description":2539,"org":2540,"tags":2541,"stars":25,"repoUrl":26,"updatedAt":2547},"binlog-generation","generate MSBuild binary logs for diagnostics","Generate MSBuild binary logs (binlogs) for build diagnostics and analysis. USE FOR: adding \u002Fbl:{} to any dotnet build, test, pack, publish, or restore command to capture a full build execution trace, prerequisite for binlog-failure-analysis and build-perf-diagnostics skills, enabling post-build investigation of errors or performance. Requires MSBuild 17.8+ \u002F .NET 8 SDK+ for {} placeholder; PowerShell needs -bl:{{}}. DO NOT USE FOR: non-MSBuild build systems (npm, Maven, CMake), analyzing an existing binlog (use binlog-failure-analysis instead).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2542,2545,2546],{"name":2543,"slug":2544,"type":15},"Build","build",{"name":2457,"slug":2458,"type":15},{"name":2438,"slug":2439,"type":15},"2026-07-19T05:38:19.340791",{"slug":2549,"name":2549,"fn":2550,"description":2551,"org":2552,"tags":2553,"stars":25,"repoUrl":26,"updatedAt":2557},"build-parallelism","optimize MSBuild build parallelism","Diagnose and fix under-parallelized MSBuild builds. USE WHEN a multi-project solution build is slower than expected, doesn't speed up when you add cores, pegs a single core while others idle, or you want to know why `-m` isn't helping. Note: `\u002Fmaxcpucount` default is 1 (sequential) — always pass `-m` for parallel builds. Covers finding the critical path (longest serial ProjectReference chain), graph build (`\u002Fgraph`), BuildInParallel, and solution filters (`.slnf`). DO NOT USE FOR: single-project builds, incremental issues (use incremental-build), compilation slowness inside one project (use build-perf-diagnostics), non-MSBuild build systems.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2554,2555,2556],{"name":17,"slug":18,"type":15},{"name":2438,"slug":2439,"type":15},{"name":2441,"slug":2442,"type":15},"2026-07-19T05:38:18.364937",{"slug":2559,"name":2559,"fn":2560,"description":2561,"org":2562,"tags":2563,"stars":25,"repoUrl":26,"updatedAt":2570},"build-perf-baseline","establish and optimize build performance baselines","Establish build performance baselines and apply systematic optimization techniques. USE FOR: diagnosing slow builds, establishing before\u002Fafter measurements (cold, warm, no-op scenarios), applying optimization strategies like MSBuild Server, static graph builds, artifacts output, and dependency graph trimming. Start here before diving into build-perf-diagnostics, incremental-build, or build-parallelism. DO NOT USE FOR: non-MSBuild build systems, detailed bottleneck analysis (use build-perf-diagnostics after baselining).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2564,2565,2568,2569],{"name":2438,"slug":2439,"type":15},{"name":2566,"slug":2567,"type":15},"Monitoring","monitoring",{"name":2441,"slug":2442,"type":15},{"name":2505,"slug":2506,"type":15},"2026-07-12T08:21:35.865649",{"slug":2572,"name":2572,"fn":2573,"description":2574,"org":2575,"tags":2576,"stars":25,"repoUrl":26,"updatedAt":2581},"build-perf-diagnostics","diagnose MSBuild build performance bottlenecks","Diagnose MSBuild build performance bottlenecks using binary log analysis. USE FOR: identifying why builds are slow by analyzing binlog performance summaries, detecting ResolveAssemblyReference (RAR) taking >5s, Roslyn analyzers consuming >30% of Csc time, single targets dominating >50% of build time, node utilization below 80%, excessive Copy tasks, NuGet restore running every build. Covers timeline analysis, Target\u002FTask Performance Summary interpretation, and 7 common bottleneck categories. Use after build-perf-baseline has established measurements. DO NOT USE FOR: establishing initial baselines (use build-perf-baseline first), fixing incremental build issues (use incremental-build), parallelism tuning (use build-parallelism), non-MSBuild build systems.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2577,2578,2579,2580],{"name":17,"slug":18,"type":15},{"name":2457,"slug":2458,"type":15},{"name":2438,"slug":2439,"type":15},{"name":2441,"slug":2442,"type":15},"2026-07-12T08:21:40.961722",{"slug":2583,"name":2583,"fn":2584,"description":2585,"org":2586,"tags":2587,"stars":25,"repoUrl":26,"updatedAt":2591},"check-bin-obj-clash","detect MSBuild output path conflicts","Detects MSBuild projects with conflicting OutputPath or IntermediateOutputPath. USE FOR: builds failing with 'Cannot create a file when that file already exists', 'The process cannot access the file because it is being used by another process', intermittent build failures that succeed on retry, or missing\u002Foverwritten outputs in multi-project or multi-targeting builds where bin\u002Fobj (or project.assets.json) collide. Common causes: shared OutputPath, missing AppendTargetFrameworkToOutputPath, extra global properties (e.g. PublishReadyToRun), or SetTargetFramework on a ProjectReference to a single-targeting project. DO NOT USE FOR: file access errors unrelated to MSBuild (OS-level locking), single-project single-TFM builds, non-MSBuild build systems.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2588,2589,2590],{"name":2457,"slug":2458,"type":15},{"name":2438,"slug":2439,"type":15},{"name":2502,"slug":2503,"type":15},"2026-07-19T05:38:14.336279",144,{"items":2594,"total":2643},[2595,2602,2609,2617,2623,2631,2637],{"slug":2447,"name":2447,"fn":2448,"description":2449,"org":2596,"tags":2597,"stars":25,"repoUrl":26,"updatedAt":2460},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2598,2599,2600,2601],{"name":17,"slug":18,"type":15},{"name":2454,"slug":2455,"type":15},{"name":2457,"slug":2458,"type":15},{"name":2441,"slug":2442,"type":15},{"slug":2462,"name":2462,"fn":2463,"description":2464,"org":2603,"tags":2604,"stars":25,"repoUrl":26,"updatedAt":2475},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2605,2606,2607,2608],{"name":17,"slug":18,"type":15},{"name":2469,"slug":2470,"type":15},{"name":2457,"slug":2458,"type":15},{"name":2473,"slug":2474,"type":15},{"slug":2477,"name":2477,"fn":2478,"description":2479,"org":2610,"tags":2611,"stars":25,"repoUrl":26,"updatedAt":2493},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2612,2613,2614,2615,2616],{"name":17,"slug":18,"type":15},{"name":2457,"slug":2458,"type":15},{"name":2485,"slug":2486,"type":15},{"name":2488,"slug":2489,"type":15},{"name":2491,"slug":2492,"type":15},{"slug":2495,"name":2495,"fn":2496,"description":2497,"org":2618,"tags":2619,"stars":25,"repoUrl":26,"updatedAt":2507},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2620,2621,2622],{"name":2454,"slug":2455,"type":15},{"name":2502,"slug":2503,"type":15},{"name":2505,"slug":2506,"type":15},{"slug":2509,"name":2509,"fn":2510,"description":2511,"org":2624,"tags":2625,"stars":25,"repoUrl":26,"updatedAt":2525},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2626,2627,2628,2629,2630],{"name":17,"slug":18,"type":15},{"name":2516,"slug":2517,"type":15},{"name":13,"slug":14,"type":15},{"name":2520,"slug":2521,"type":15},{"name":2523,"slug":2524,"type":15},{"slug":2527,"name":2527,"fn":2528,"description":2529,"org":2632,"tags":2633,"stars":25,"repoUrl":26,"updatedAt":2535},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2634,2635,2636],{"name":2454,"slug":2455,"type":15},{"name":2457,"slug":2458,"type":15},{"name":2473,"slug":2474,"type":15},{"slug":2537,"name":2537,"fn":2538,"description":2539,"org":2638,"tags":2639,"stars":25,"repoUrl":26,"updatedAt":2547},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2640,2641,2642],{"name":2543,"slug":2544,"type":15},{"name":2457,"slug":2458,"type":15},{"name":2438,"slug":2439,"type":15},96]