Title: Compiler Options - code generation options - C# reference | Microsoft Learn
Open Graph Title: Compiler Options - code generation options - C# reference
Description: C# Compiler Options to control code generation. The options affect the code generated by the compiler for a given compilation.
Open Graph Description: C# Compiler Options to control code generation. The options affect the code generated by the compiler for a given compilation.
Opengraph URL: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/code-generation
Domain: learn.microsoft.com
| color-scheme | light dark |
| twitter:card | summary |
| og:type | website |
| og:image:alt | Compiler Options - code generation options - C# reference | Microsoft Learn |
| og:image | https://learn.microsoft.com/dotnet/media/logo_csharp.png |
| platform_id | d06420e6-2db4-5bdc-bef5-c38d370e70a0 |
| scope | .NET |
| locale | en-us |
| uhfHeaderId | MSDocsHeader-DotNetCSharp |
| page_type | conceptual |
| apiPlatform | dotnet |
| author | BillWagner |
| breadcrumb_path | /dotnet/breadcrumb/toc.json |
| feedback_system | OpenSource |
| feedback_product_url | https://aka.ms/feedback/report?space=61 |
| ms.author | wiwagn |
| ms.devlang | csharp |
| ms.service | dotnet-csharp |
| ms.topic | language-reference |
| show_latex | true |
| ms.subservice | lang-reference |
| ms.update-cycle | 1095-days |
| ms.date | 2021-03-12T00:00:00Z |
| document_id | 35131307-8d1c-2800-e84a-6179d740982f |
| document_version_independent_id | 7599b464-9928-88bc-fec1-704ce691b344 |
| updated_at | 2026-06-14T16:54:00Z |
| original_content_git_url | https://github.com/dotnet/docs/blob/live/docs/csharp/language-reference/compiler-options/code-generation.md |
| gitcommit | https://github.com/dotnet/docs/blob/82ad3e72f0bf180cc5045c4d345129951d466b6f/docs/csharp/language-reference/compiler-options/code-generation.md |
| git_commit_id | 82ad3e72f0bf180cc5045c4d345129951d466b6f |
| site_name | Docs |
| depot_name | VS.core-docs |
| schema | Conceptual |
| toc_rel | ../toc.json |
| pdf_url_template | https://learn.microsoft.com/pdfstore/en-us/VS.core-docs/{branchName}{pdfName} |
| search.mshattr.devlang | csharp |
| word_count | 1069 |
| asset_id | csharp/language-reference/compiler-options/code-generation |
| item_type | Content |
| source_path | docs/csharp/language-reference/compiler-options/code-generation.md |
| previous_tlsh_hash | FA6171E1941DA322FF815D06284ABFD942F48D8D6AB42ED4053576B6880D2DBA875548EBE722E24D7B31538301D3B66F63DB9B3EC12CA365642A407C814D6213F70D3FB2F6 |
| github_feedback_content_git_url | https://github.com/dotnet/docs/blob/main/docs/csharp/language-reference/compiler-options/code-generation.md |
| markdown_url | https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/code-generation?accept=text/markdown |
| cmProducts | https://authoring-docs-microsoft.poolparty.biz/devrel/bcbcbad5-4208-4783-8035-8481272c98b8 |
| spProducts | https://authoring-docs-microsoft.poolparty.biz/devrel/43b2e5aa-8a6d-4de2-a252-692232e5edc8 |
Links:
Viewport: width=device-width, initial-scale=1.0