[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-dotnet-target-authoring":3,"mdc--xv7xky-key":34,"related-repo-dotnet-target-authoring":1416,"related-org-dotnet-target-authoring":1523},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":22,"repoUrl":23,"updatedAt":24,"license":25,"forks":26,"topics":27,"repo":29,"sourceUrl":32,"mdContent":33},"target-authoring","author and review custom MSBuild targets","Canonical patterns for writing custom MSBuild targets. USE FOR: diagnosing and fixing custom target authoring anti-patterns; broken SDK target chains across files (e.g., Directory.Build.targets silently redefining SDK targets); targets that replace CompileDependsOn instead of extending it with $(CompileDependsOn); query targets returning stale results from Outputs vs Returns misuse; missing Inputs\u002FOutputs causing unnecessary rebuilds; missing FileWrites registration. Covers DependsOnTargets vs BeforeTargets vs AfterTargets, the Build→CoreBuild three-level pattern, and the $(XxxDependsOn) chain-extension pattern. DO NOT USE FOR: incremental build tuning (use incremental-build), parallelization (use build-parallelism), general anti-patterns (use msbuild-antipatterns), non-MSBuild build systems.",{"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],{"name":13,"slug":14,"type":15},".NET","net","tag",{"name":17,"slug":18,"type":15},"Engineering","engineering",{"name":20,"slug":21,"type":15},"Code Analysis","code-analysis",4576,"https:\u002F\u002Fgithub.com\u002Fdotnet\u002Fskills","2026-07-19T05:38:13.321313","MIT",332,[28],"agent-skills",{"repoUrl":23,"stars":22,"forks":26,"topics":30,"description":31},[28],"Repository for skills to assist AI coding agents with .NET and C#","https:\u002F\u002Fgithub.com\u002Fdotnet\u002Fskills\u002Ftree\u002FHEAD\u002Fplugins\u002Fdotnet-msbuild\u002Fskills\u002Ftarget-authoring","---\nname: target-authoring\ndescription: \"Canonical patterns for writing custom MSBuild targets. USE FOR: diagnosing and fixing custom target authoring anti-patterns; broken SDK target chains across files (e.g., Directory.Build.targets silently redefining SDK targets); targets that replace CompileDependsOn instead of extending it with $(CompileDependsOn); query targets returning stale results from Outputs vs Returns misuse; missing Inputs\u002FOutputs causing unnecessary rebuilds; missing FileWrites registration. Covers DependsOnTargets vs BeforeTargets vs AfterTargets, the Build→CoreBuild three-level pattern, and the $(XxxDependsOn) chain-extension pattern. DO NOT USE FOR: incremental build tuning (use incremental-build), parallelization (use build-parallelism), general anti-patterns (use msbuild-antipatterns), non-MSBuild build systems.\"\nlicense: MIT\n---\n\n# Custom Target Authoring Patterns\n\nCanonical patterns from `Microsoft.Common.CurrentVersion.targets` in the MSBuild repository.\n\n## The Three-Level Target Chain\n\nEvery major entry point (Build, Rebuild, Clean) delegates to a **property** listing its dependencies, which chains through Before → Core → After:\n\n```xml\n\u003CPropertyGroup>\n  \u003CBuildDependsOn>\n    BeforeBuild;\n    CoreBuild;\n    AfterBuild\n  \u003C\u002FBuildDependsOn>\n\u003C\u002FPropertyGroup>\n\n\u003CTarget Name=\"Build\"\n    Condition=\" '$(_InvalidConfigurationWarning)' != 'true' \"\n    DependsOnTargets=\"$(BuildDependsOn)\"\n    Returns=\"@(TargetPathWithTargetPlatformMoniker)\" \u002F>\n\n\u003C!-- Empty extensibility targets — users override these -->\n\u003CTarget Name=\"BeforeBuild\" \u002F>\n\u003CTarget Name=\"AfterBuild\" \u002F>\n```\n\n`CoreBuild` delegates to `$(CoreBuildDependsOn)` and includes error handlers:\n\n```xml\n\u003CTarget Name=\"CoreBuild\" DependsOnTargets=\"$(CoreBuildDependsOn)\">\n  \u003COnError ExecuteTargets=\"_TimeStampAfterCompile;PostBuildEvent\"\n      Condition=\"'$(RunPostBuildEvent)' == 'Always'\" \u002F>\n  \u003COnError ExecuteTargets=\"_CleanRecordFileWrites\" \u002F>\n\u003C\u002FTarget>\n```\n\n### Rules\n\n- Delegate to a property (`DependsOnTargets=\"$(MyTargetDependsOn)\"`), not hardcoded targets.\n- `OnError` goes inside the orchestrating target to ensure cleanup runs even on failure.\n- Empty Before\u002FAfter targets are extensibility points. Users override them; SDKs never put logic in them.\n\n## Chain Extension — Append, Never Overwrite\n\nWhen adding a custom target to an existing chain, **append** to the `DependsOn` property:\n\n```xml\n\u003C!-- GOOD: Append to existing chain -->\n\u003CPropertyGroup>\n  \u003CCompileDependsOn>$(CompileDependsOn);MyCodeGenTarget\u003C\u002FCompileDependsOn>\n\u003C\u002FPropertyGroup>\n\n\u003C!-- BAD: Overwrites the entire chain, dropping SDK targets -->\n\u003CPropertyGroup>\n  \u003CCompileDependsOn>MyCodeGenTarget\u003C\u002FCompileDependsOn>\n\u003C\u002FPropertyGroup>\n```\n\n## DependsOnTargets vs BeforeTargets vs AfterTargets\n\n| Mechanism | Defined in | Best for |\n|---|---|---|\n| `DependsOnTargets` | The target that needs deps | Target explicitly requires others |\n| `BeforeTargets` | The injecting target | Insert before a target you don't own |\n| `AfterTargets` | The injecting target | Insert after a target you don't own |\n\nValidation targets use `BeforeTargets` to intercept all entry points:\n\n```xml\n\u003CTarget Name=\"_CheckForInvalidConfigurationAndPlatform\"\n    BeforeTargets=\"$(BuildDependsOn);Build;$(RebuildDependsOn);Rebuild;$(CleanDependsOn);Clean\">\n\u003C\u002FTarget>\n```\n\n**Rules:**\n\n- Use `DependsOnTargets` when your target needs specific prerequisites.\n- Use `BeforeTargets`\u002F`AfterTargets` when injecting into a pipeline you don't own.\n- Prefer `BeforeTargets=\"CoreCompile\"` over modifying `$(CompileDependsOn)` when you don't control the targets file.\n\n## Returns vs Outputs\n\n```xml\n\u003C!-- Build returns items for consumption by referencing projects -->\n\u003CTarget Name=\"Build\"\n    DependsOnTargets=\"$(BuildDependsOn)\"\n    Returns=\"@(TargetPathWithTargetPlatformMoniker)\" \u002F>\n\n\u003C!-- GetTargetPath is a lightweight query target -->\n\u003CTarget Name=\"GetTargetPath\" Returns=\"@(TargetPathWithTargetPlatformMoniker)\" \u002F>\n```\n\n- **`Returns`** specifies what the MSBuild task receives when calling this project. Use for inter-project communication.\n- **`Outputs`** on inner targets is for incrementality (timestamp checks). Use for up-to-date detection.\n- Never mix the two purposes. Query targets (`GetTargetPath`, `GetTargetFrameworks`) should use `Returns`, not `Outputs`.\n\n## Target Naming Conventions\n\n| Pattern | Meaning | Example |\n|---|---|---|\n| `_PrefixedName` | Internal\u002Fprivate target | `_TimeStampBeforeCompile` |\n| `CoreXxx` | The actual implementation | `CoreBuild`, `CoreCompile` |\n| `BeforeXxx` \u002F `AfterXxx` | Empty extensibility hooks | `BeforeBuild`, `AfterCompile` |\n| `PrepareXxx` | Setup\u002Fvalidation phase | `PrepareForBuild` |\n| `ResolveXxx` | Discovery\u002Fresolution phase | `ResolveReferences` |\n| `GetXxx` | Lightweight query (no side effects) | `GetTargetPath` |\n\n## Complete Custom Target Template\n\n```xml\n\u003C!-- 1. Define the DependsOn chain for extensibility -->\n\u003CPropertyGroup>\n  \u003CMyFeatureDependsOn>\n    _ValidateMyFeatureInputs;\n    BeforeMyFeature;\n    CoreMyFeature;\n    AfterMyFeature\n  \u003C\u002FMyFeatureDependsOn>\n\u003C\u002FPropertyGroup>\n\n\u003C!-- 2. Outer target with Returns for inter-project communication -->\n\u003CTarget Name=\"MyFeature\"\n    DependsOnTargets=\"$(MyFeatureDependsOn)\"\n    Returns=\"@(MyFeatureOutput)\" \u002F>\n\n\u003C!-- 3. Empty extensibility points -->\n\u003CTarget Name=\"BeforeMyFeature\" \u002F>\n\u003CTarget Name=\"AfterMyFeature\" \u002F>\n\n\u003C!-- 4. Core implementation with Inputs\u002FOutputs for incrementality -->\n\u003CTarget Name=\"CoreMyFeature\"\n    Inputs=\"$(MSBuildAllProjects);@(MyFeatureInput)\"\n    Outputs=\"$(IntermediateOutputPath)myfeature.generated.cs\">\n  \u003CExec Command=\"my-tool.exe -o $(IntermediateOutputPath)myfeature.generated.cs\" \u002F>\n  \u003C!-- 5. Register outputs for clean tracking -->\n  \u003CItemGroup>\n    \u003CCompile Include=\"$(IntermediateOutputPath)myfeature.generated.cs\" \u002F>\n    \u003CFileWrites Include=\"$(IntermediateOutputPath)myfeature.generated.cs\" \u002F>\n  \u003C\u002FItemGroup>\n\u003C\u002FTarget>\n\n\u003C!-- 6. Validation target runs first in the dependency chain -->\n\u003CTarget Name=\"_ValidateMyFeatureInputs\">\n  \u003CError Text=\"MyFeatureInput items are required.\"\n         Condition=\"'@(MyFeatureInput)' == ''\" \u002F>\n\u003C\u002FTarget>\n```\n\n## Common Pitfalls\n\n- **Overwriting `DependsOn` properties** drops SDK targets silently. Always include `$(ExistingProperty)` when appending.\n- **Using `Outputs` on query targets** causes MSBuild to skip them when \"up to date,\" returning stale data. Use `Returns`.\n- **Defining targets in `.props`** means `BeforeTargets` on SDK targets have nothing to hook into yet. Move targets to `.targets`.\n- **Forgetting `OnError`** in orchestrating targets means file tracking fails on build errors, breaking subsequent incremental builds.\n",{"data":35,"body":36},{"name":4,"description":6,"license":25},{"type":37,"children":38},"root",[39,48,63,70,83,240,259,306,313,347,353,373,447,453,551,563,593,601,655,661,720,786,792,995,1001,1308,1314,1410],{"type":40,"tag":41,"props":42,"children":44},"element","h1",{"id":43},"custom-target-authoring-patterns",[45],{"type":46,"value":47},"text","Custom Target Authoring Patterns",{"type":40,"tag":49,"props":50,"children":51},"p",{},[52,54,61],{"type":46,"value":53},"Canonical patterns from ",{"type":40,"tag":55,"props":56,"children":58},"code",{"className":57},[],[59],{"type":46,"value":60},"Microsoft.Common.CurrentVersion.targets",{"type":46,"value":62}," in the MSBuild repository.",{"type":40,"tag":64,"props":65,"children":67},"h2",{"id":66},"the-three-level-target-chain",[68],{"type":46,"value":69},"The Three-Level Target Chain",{"type":40,"tag":49,"props":71,"children":72},{},[73,75,81],{"type":46,"value":74},"Every major entry point (Build, Rebuild, Clean) delegates to a ",{"type":40,"tag":76,"props":77,"children":78},"strong",{},[79],{"type":46,"value":80},"property",{"type":46,"value":82}," listing its dependencies, which chains through Before → Core → After:",{"type":40,"tag":84,"props":85,"children":90},"pre",{"className":86,"code":87,"language":88,"meta":89,"style":89},"language-xml shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u003CPropertyGroup>\n  \u003CBuildDependsOn>\n    BeforeBuild;\n    CoreBuild;\n    AfterBuild\n  \u003C\u002FBuildDependsOn>\n\u003C\u002FPropertyGroup>\n\n\u003CTarget Name=\"Build\"\n    Condition=\" '$(_InvalidConfigurationWarning)' != 'true' \"\n    DependsOnTargets=\"$(BuildDependsOn)\"\n    Returns=\"@(TargetPathWithTargetPlatformMoniker)\" \u002F>\n\n\u003C!-- Empty extensibility targets — users override these -->\n\u003CTarget Name=\"BeforeBuild\" \u002F>\n\u003CTarget Name=\"AfterBuild\" \u002F>\n","xml","",[91],{"type":40,"tag":55,"props":92,"children":93},{"__ignoreMap":89},[94,105,114,123,132,141,150,159,169,178,187,196,205,213,222,231],{"type":40,"tag":95,"props":96,"children":99},"span",{"class":97,"line":98},"line",1,[100],{"type":40,"tag":95,"props":101,"children":102},{},[103],{"type":46,"value":104},"\u003CPropertyGroup>\n",{"type":40,"tag":95,"props":106,"children":108},{"class":97,"line":107},2,[109],{"type":40,"tag":95,"props":110,"children":111},{},[112],{"type":46,"value":113},"  \u003CBuildDependsOn>\n",{"type":40,"tag":95,"props":115,"children":117},{"class":97,"line":116},3,[118],{"type":40,"tag":95,"props":119,"children":120},{},[121],{"type":46,"value":122},"    BeforeBuild;\n",{"type":40,"tag":95,"props":124,"children":126},{"class":97,"line":125},4,[127],{"type":40,"tag":95,"props":128,"children":129},{},[130],{"type":46,"value":131},"    CoreBuild;\n",{"type":40,"tag":95,"props":133,"children":135},{"class":97,"line":134},5,[136],{"type":40,"tag":95,"props":137,"children":138},{},[139],{"type":46,"value":140},"    AfterBuild\n",{"type":40,"tag":95,"props":142,"children":144},{"class":97,"line":143},6,[145],{"type":40,"tag":95,"props":146,"children":147},{},[148],{"type":46,"value":149},"  \u003C\u002FBuildDependsOn>\n",{"type":40,"tag":95,"props":151,"children":153},{"class":97,"line":152},7,[154],{"type":40,"tag":95,"props":155,"children":156},{},[157],{"type":46,"value":158},"\u003C\u002FPropertyGroup>\n",{"type":40,"tag":95,"props":160,"children":162},{"class":97,"line":161},8,[163],{"type":40,"tag":95,"props":164,"children":166},{"emptyLinePlaceholder":165},true,[167],{"type":46,"value":168},"\n",{"type":40,"tag":95,"props":170,"children":172},{"class":97,"line":171},9,[173],{"type":40,"tag":95,"props":174,"children":175},{},[176],{"type":46,"value":177},"\u003CTarget Name=\"Build\"\n",{"type":40,"tag":95,"props":179,"children":181},{"class":97,"line":180},10,[182],{"type":40,"tag":95,"props":183,"children":184},{},[185],{"type":46,"value":186},"    Condition=\" '$(_InvalidConfigurationWarning)' != 'true' \"\n",{"type":40,"tag":95,"props":188,"children":190},{"class":97,"line":189},11,[191],{"type":40,"tag":95,"props":192,"children":193},{},[194],{"type":46,"value":195},"    DependsOnTargets=\"$(BuildDependsOn)\"\n",{"type":40,"tag":95,"props":197,"children":199},{"class":97,"line":198},12,[200],{"type":40,"tag":95,"props":201,"children":202},{},[203],{"type":46,"value":204},"    Returns=\"@(TargetPathWithTargetPlatformMoniker)\" \u002F>\n",{"type":40,"tag":95,"props":206,"children":208},{"class":97,"line":207},13,[209],{"type":40,"tag":95,"props":210,"children":211},{"emptyLinePlaceholder":165},[212],{"type":46,"value":168},{"type":40,"tag":95,"props":214,"children":216},{"class":97,"line":215},14,[217],{"type":40,"tag":95,"props":218,"children":219},{},[220],{"type":46,"value":221},"\u003C!-- Empty extensibility targets — users override these -->\n",{"type":40,"tag":95,"props":223,"children":225},{"class":97,"line":224},15,[226],{"type":40,"tag":95,"props":227,"children":228},{},[229],{"type":46,"value":230},"\u003CTarget Name=\"BeforeBuild\" \u002F>\n",{"type":40,"tag":95,"props":232,"children":234},{"class":97,"line":233},16,[235],{"type":40,"tag":95,"props":236,"children":237},{},[238],{"type":46,"value":239},"\u003CTarget Name=\"AfterBuild\" \u002F>\n",{"type":40,"tag":49,"props":241,"children":242},{},[243,249,251,257],{"type":40,"tag":55,"props":244,"children":246},{"className":245},[],[247],{"type":46,"value":248},"CoreBuild",{"type":46,"value":250}," delegates to ",{"type":40,"tag":55,"props":252,"children":254},{"className":253},[],[255],{"type":46,"value":256},"$(CoreBuildDependsOn)",{"type":46,"value":258}," and includes error handlers:",{"type":40,"tag":84,"props":260,"children":262},{"className":86,"code":261,"language":88,"meta":89,"style":89},"\u003CTarget Name=\"CoreBuild\" DependsOnTargets=\"$(CoreBuildDependsOn)\">\n  \u003COnError ExecuteTargets=\"_TimeStampAfterCompile;PostBuildEvent\"\n      Condition=\"'$(RunPostBuildEvent)' == 'Always'\" \u002F>\n  \u003COnError ExecuteTargets=\"_CleanRecordFileWrites\" \u002F>\n\u003C\u002FTarget>\n",[263],{"type":40,"tag":55,"props":264,"children":265},{"__ignoreMap":89},[266,274,282,290,298],{"type":40,"tag":95,"props":267,"children":268},{"class":97,"line":98},[269],{"type":40,"tag":95,"props":270,"children":271},{},[272],{"type":46,"value":273},"\u003CTarget Name=\"CoreBuild\" DependsOnTargets=\"$(CoreBuildDependsOn)\">\n",{"type":40,"tag":95,"props":275,"children":276},{"class":97,"line":107},[277],{"type":40,"tag":95,"props":278,"children":279},{},[280],{"type":46,"value":281},"  \u003COnError ExecuteTargets=\"_TimeStampAfterCompile;PostBuildEvent\"\n",{"type":40,"tag":95,"props":283,"children":284},{"class":97,"line":116},[285],{"type":40,"tag":95,"props":286,"children":287},{},[288],{"type":46,"value":289},"      Condition=\"'$(RunPostBuildEvent)' == 'Always'\" \u002F>\n",{"type":40,"tag":95,"props":291,"children":292},{"class":97,"line":125},[293],{"type":40,"tag":95,"props":294,"children":295},{},[296],{"type":46,"value":297},"  \u003COnError ExecuteTargets=\"_CleanRecordFileWrites\" \u002F>\n",{"type":40,"tag":95,"props":299,"children":300},{"class":97,"line":134},[301],{"type":40,"tag":95,"props":302,"children":303},{},[304],{"type":46,"value":305},"\u003C\u002FTarget>\n",{"type":40,"tag":307,"props":308,"children":310},"h3",{"id":309},"rules",[311],{"type":46,"value":312},"Rules",{"type":40,"tag":314,"props":315,"children":316},"ul",{},[317,331,342],{"type":40,"tag":318,"props":319,"children":320},"li",{},[321,323,329],{"type":46,"value":322},"Delegate to a property (",{"type":40,"tag":55,"props":324,"children":326},{"className":325},[],[327],{"type":46,"value":328},"DependsOnTargets=\"$(MyTargetDependsOn)\"",{"type":46,"value":330},"), not hardcoded targets.",{"type":40,"tag":318,"props":332,"children":333},{},[334,340],{"type":40,"tag":55,"props":335,"children":337},{"className":336},[],[338],{"type":46,"value":339},"OnError",{"type":46,"value":341}," goes inside the orchestrating target to ensure cleanup runs even on failure.",{"type":40,"tag":318,"props":343,"children":344},{},[345],{"type":46,"value":346},"Empty Before\u002FAfter targets are extensibility points. Users override them; SDKs never put logic in them.",{"type":40,"tag":64,"props":348,"children":350},{"id":349},"chain-extension-append-never-overwrite",[351],{"type":46,"value":352},"Chain Extension — Append, Never Overwrite",{"type":40,"tag":49,"props":354,"children":355},{},[356,358,363,365,371],{"type":46,"value":357},"When adding a custom target to an existing chain, ",{"type":40,"tag":76,"props":359,"children":360},{},[361],{"type":46,"value":362},"append",{"type":46,"value":364}," to the ",{"type":40,"tag":55,"props":366,"children":368},{"className":367},[],[369],{"type":46,"value":370},"DependsOn",{"type":46,"value":372}," property:",{"type":40,"tag":84,"props":374,"children":376},{"className":86,"code":375,"language":88,"meta":89,"style":89},"\u003C!-- GOOD: Append to existing chain -->\n\u003CPropertyGroup>\n  \u003CCompileDependsOn>$(CompileDependsOn);MyCodeGenTarget\u003C\u002FCompileDependsOn>\n\u003C\u002FPropertyGroup>\n\n\u003C!-- BAD: Overwrites the entire chain, dropping SDK targets -->\n\u003CPropertyGroup>\n  \u003CCompileDependsOn>MyCodeGenTarget\u003C\u002FCompileDependsOn>\n\u003C\u002FPropertyGroup>\n",[377],{"type":40,"tag":55,"props":378,"children":379},{"__ignoreMap":89},[380,388,395,403,410,417,425,432,440],{"type":40,"tag":95,"props":381,"children":382},{"class":97,"line":98},[383],{"type":40,"tag":95,"props":384,"children":385},{},[386],{"type":46,"value":387},"\u003C!-- GOOD: Append to existing chain -->\n",{"type":40,"tag":95,"props":389,"children":390},{"class":97,"line":107},[391],{"type":40,"tag":95,"props":392,"children":393},{},[394],{"type":46,"value":104},{"type":40,"tag":95,"props":396,"children":397},{"class":97,"line":116},[398],{"type":40,"tag":95,"props":399,"children":400},{},[401],{"type":46,"value":402},"  \u003CCompileDependsOn>$(CompileDependsOn);MyCodeGenTarget\u003C\u002FCompileDependsOn>\n",{"type":40,"tag":95,"props":404,"children":405},{"class":97,"line":125},[406],{"type":40,"tag":95,"props":407,"children":408},{},[409],{"type":46,"value":158},{"type":40,"tag":95,"props":411,"children":412},{"class":97,"line":134},[413],{"type":40,"tag":95,"props":414,"children":415},{"emptyLinePlaceholder":165},[416],{"type":46,"value":168},{"type":40,"tag":95,"props":418,"children":419},{"class":97,"line":143},[420],{"type":40,"tag":95,"props":421,"children":422},{},[423],{"type":46,"value":424},"\u003C!-- BAD: Overwrites the entire chain, dropping SDK targets -->\n",{"type":40,"tag":95,"props":426,"children":427},{"class":97,"line":152},[428],{"type":40,"tag":95,"props":429,"children":430},{},[431],{"type":46,"value":104},{"type":40,"tag":95,"props":433,"children":434},{"class":97,"line":161},[435],{"type":40,"tag":95,"props":436,"children":437},{},[438],{"type":46,"value":439},"  \u003CCompileDependsOn>MyCodeGenTarget\u003C\u002FCompileDependsOn>\n",{"type":40,"tag":95,"props":441,"children":442},{"class":97,"line":171},[443],{"type":40,"tag":95,"props":444,"children":445},{},[446],{"type":46,"value":158},{"type":40,"tag":64,"props":448,"children":450},{"id":449},"dependsontargets-vs-beforetargets-vs-aftertargets",[451],{"type":46,"value":452},"DependsOnTargets vs BeforeTargets vs AfterTargets",{"type":40,"tag":454,"props":455,"children":456},"table",{},[457,481],{"type":40,"tag":458,"props":459,"children":460},"thead",{},[461],{"type":40,"tag":462,"props":463,"children":464},"tr",{},[465,471,476],{"type":40,"tag":466,"props":467,"children":468},"th",{},[469],{"type":46,"value":470},"Mechanism",{"type":40,"tag":466,"props":472,"children":473},{},[474],{"type":46,"value":475},"Defined in",{"type":40,"tag":466,"props":477,"children":478},{},[479],{"type":46,"value":480},"Best for",{"type":40,"tag":482,"props":483,"children":484},"tbody",{},[485,508,530],{"type":40,"tag":462,"props":486,"children":487},{},[488,498,503],{"type":40,"tag":489,"props":490,"children":491},"td",{},[492],{"type":40,"tag":55,"props":493,"children":495},{"className":494},[],[496],{"type":46,"value":497},"DependsOnTargets",{"type":40,"tag":489,"props":499,"children":500},{},[501],{"type":46,"value":502},"The target that needs deps",{"type":40,"tag":489,"props":504,"children":505},{},[506],{"type":46,"value":507},"Target explicitly requires others",{"type":40,"tag":462,"props":509,"children":510},{},[511,520,525],{"type":40,"tag":489,"props":512,"children":513},{},[514],{"type":40,"tag":55,"props":515,"children":517},{"className":516},[],[518],{"type":46,"value":519},"BeforeTargets",{"type":40,"tag":489,"props":521,"children":522},{},[523],{"type":46,"value":524},"The injecting target",{"type":40,"tag":489,"props":526,"children":527},{},[528],{"type":46,"value":529},"Insert before a target you don't own",{"type":40,"tag":462,"props":531,"children":532},{},[533,542,546],{"type":40,"tag":489,"props":534,"children":535},{},[536],{"type":40,"tag":55,"props":537,"children":539},{"className":538},[],[540],{"type":46,"value":541},"AfterTargets",{"type":40,"tag":489,"props":543,"children":544},{},[545],{"type":46,"value":524},{"type":40,"tag":489,"props":547,"children":548},{},[549],{"type":46,"value":550},"Insert after a target you don't own",{"type":40,"tag":49,"props":552,"children":553},{},[554,556,561],{"type":46,"value":555},"Validation targets use ",{"type":40,"tag":55,"props":557,"children":559},{"className":558},[],[560],{"type":46,"value":519},{"type":46,"value":562}," to intercept all entry points:",{"type":40,"tag":84,"props":564,"children":566},{"className":86,"code":565,"language":88,"meta":89,"style":89},"\u003CTarget Name=\"_CheckForInvalidConfigurationAndPlatform\"\n    BeforeTargets=\"$(BuildDependsOn);Build;$(RebuildDependsOn);Rebuild;$(CleanDependsOn);Clean\">\n\u003C\u002FTarget>\n",[567],{"type":40,"tag":55,"props":568,"children":569},{"__ignoreMap":89},[570,578,586],{"type":40,"tag":95,"props":571,"children":572},{"class":97,"line":98},[573],{"type":40,"tag":95,"props":574,"children":575},{},[576],{"type":46,"value":577},"\u003CTarget Name=\"_CheckForInvalidConfigurationAndPlatform\"\n",{"type":40,"tag":95,"props":579,"children":580},{"class":97,"line":107},[581],{"type":40,"tag":95,"props":582,"children":583},{},[584],{"type":46,"value":585},"    BeforeTargets=\"$(BuildDependsOn);Build;$(RebuildDependsOn);Rebuild;$(CleanDependsOn);Clean\">\n",{"type":40,"tag":95,"props":587,"children":588},{"class":97,"line":116},[589],{"type":40,"tag":95,"props":590,"children":591},{},[592],{"type":46,"value":305},{"type":40,"tag":49,"props":594,"children":595},{},[596],{"type":40,"tag":76,"props":597,"children":598},{},[599],{"type":46,"value":600},"Rules:",{"type":40,"tag":314,"props":602,"children":603},{},[604,616,634],{"type":40,"tag":318,"props":605,"children":606},{},[607,609,614],{"type":46,"value":608},"Use ",{"type":40,"tag":55,"props":610,"children":612},{"className":611},[],[613],{"type":46,"value":497},{"type":46,"value":615}," when your target needs specific prerequisites.",{"type":40,"tag":318,"props":617,"children":618},{},[619,620,625,627,632],{"type":46,"value":608},{"type":40,"tag":55,"props":621,"children":623},{"className":622},[],[624],{"type":46,"value":519},{"type":46,"value":626},"\u002F",{"type":40,"tag":55,"props":628,"children":630},{"className":629},[],[631],{"type":46,"value":541},{"type":46,"value":633}," when injecting into a pipeline you don't own.",{"type":40,"tag":318,"props":635,"children":636},{},[637,639,645,647,653],{"type":46,"value":638},"Prefer ",{"type":40,"tag":55,"props":640,"children":642},{"className":641},[],[643],{"type":46,"value":644},"BeforeTargets=\"CoreCompile\"",{"type":46,"value":646}," over modifying ",{"type":40,"tag":55,"props":648,"children":650},{"className":649},[],[651],{"type":46,"value":652},"$(CompileDependsOn)",{"type":46,"value":654}," when you don't control the targets file.",{"type":40,"tag":64,"props":656,"children":658},{"id":657},"returns-vs-outputs",[659],{"type":46,"value":660},"Returns vs Outputs",{"type":40,"tag":84,"props":662,"children":664},{"className":86,"code":663,"language":88,"meta":89,"style":89},"\u003C!-- Build returns items for consumption by referencing projects -->\n\u003CTarget Name=\"Build\"\n    DependsOnTargets=\"$(BuildDependsOn)\"\n    Returns=\"@(TargetPathWithTargetPlatformMoniker)\" \u002F>\n\n\u003C!-- GetTargetPath is a lightweight query target -->\n\u003CTarget Name=\"GetTargetPath\" Returns=\"@(TargetPathWithTargetPlatformMoniker)\" \u002F>\n",[665],{"type":40,"tag":55,"props":666,"children":667},{"__ignoreMap":89},[668,676,683,690,697,704,712],{"type":40,"tag":95,"props":669,"children":670},{"class":97,"line":98},[671],{"type":40,"tag":95,"props":672,"children":673},{},[674],{"type":46,"value":675},"\u003C!-- Build returns items for consumption by referencing projects -->\n",{"type":40,"tag":95,"props":677,"children":678},{"class":97,"line":107},[679],{"type":40,"tag":95,"props":680,"children":681},{},[682],{"type":46,"value":177},{"type":40,"tag":95,"props":684,"children":685},{"class":97,"line":116},[686],{"type":40,"tag":95,"props":687,"children":688},{},[689],{"type":46,"value":195},{"type":40,"tag":95,"props":691,"children":692},{"class":97,"line":125},[693],{"type":40,"tag":95,"props":694,"children":695},{},[696],{"type":46,"value":204},{"type":40,"tag":95,"props":698,"children":699},{"class":97,"line":134},[700],{"type":40,"tag":95,"props":701,"children":702},{"emptyLinePlaceholder":165},[703],{"type":46,"value":168},{"type":40,"tag":95,"props":705,"children":706},{"class":97,"line":143},[707],{"type":40,"tag":95,"props":708,"children":709},{},[710],{"type":46,"value":711},"\u003C!-- GetTargetPath is a lightweight query target -->\n",{"type":40,"tag":95,"props":713,"children":714},{"class":97,"line":152},[715],{"type":40,"tag":95,"props":716,"children":717},{},[718],{"type":46,"value":719},"\u003CTarget Name=\"GetTargetPath\" Returns=\"@(TargetPathWithTargetPlatformMoniker)\" \u002F>\n",{"type":40,"tag":314,"props":721,"children":722},{},[723,737,751],{"type":40,"tag":318,"props":724,"children":725},{},[726,735],{"type":40,"tag":76,"props":727,"children":728},{},[729],{"type":40,"tag":55,"props":730,"children":732},{"className":731},[],[733],{"type":46,"value":734},"Returns",{"type":46,"value":736}," specifies what the MSBuild task receives when calling this project. Use for inter-project communication.",{"type":40,"tag":318,"props":738,"children":739},{},[740,749],{"type":40,"tag":76,"props":741,"children":742},{},[743],{"type":40,"tag":55,"props":744,"children":746},{"className":745},[],[747],{"type":46,"value":748},"Outputs",{"type":46,"value":750}," on inner targets is for incrementality (timestamp checks). Use for up-to-date detection.",{"type":40,"tag":318,"props":752,"children":753},{},[754,756,762,764,770,772,777,779,784],{"type":46,"value":755},"Never mix the two purposes. Query targets (",{"type":40,"tag":55,"props":757,"children":759},{"className":758},[],[760],{"type":46,"value":761},"GetTargetPath",{"type":46,"value":763},", ",{"type":40,"tag":55,"props":765,"children":767},{"className":766},[],[768],{"type":46,"value":769},"GetTargetFrameworks",{"type":46,"value":771},") should use ",{"type":40,"tag":55,"props":773,"children":775},{"className":774},[],[776],{"type":46,"value":734},{"type":46,"value":778},", not ",{"type":40,"tag":55,"props":780,"children":782},{"className":781},[],[783],{"type":46,"value":748},{"type":46,"value":785},".",{"type":40,"tag":64,"props":787,"children":789},{"id":788},"target-naming-conventions",[790],{"type":46,"value":791},"Target Naming Conventions",{"type":40,"tag":454,"props":793,"children":794},{},[795,816],{"type":40,"tag":458,"props":796,"children":797},{},[798],{"type":40,"tag":462,"props":799,"children":800},{},[801,806,811],{"type":40,"tag":466,"props":802,"children":803},{},[804],{"type":46,"value":805},"Pattern",{"type":40,"tag":466,"props":807,"children":808},{},[809],{"type":46,"value":810},"Meaning",{"type":40,"tag":466,"props":812,"children":813},{},[814],{"type":46,"value":815},"Example",{"type":40,"tag":482,"props":817,"children":818},{},[819,845,877,918,944,970],{"type":40,"tag":462,"props":820,"children":821},{},[822,831,836],{"type":40,"tag":489,"props":823,"children":824},{},[825],{"type":40,"tag":55,"props":826,"children":828},{"className":827},[],[829],{"type":46,"value":830},"_PrefixedName",{"type":40,"tag":489,"props":832,"children":833},{},[834],{"type":46,"value":835},"Internal\u002Fprivate target",{"type":40,"tag":489,"props":837,"children":838},{},[839],{"type":40,"tag":55,"props":840,"children":842},{"className":841},[],[843],{"type":46,"value":844},"_TimeStampBeforeCompile",{"type":40,"tag":462,"props":846,"children":847},{},[848,857,862],{"type":40,"tag":489,"props":849,"children":850},{},[851],{"type":40,"tag":55,"props":852,"children":854},{"className":853},[],[855],{"type":46,"value":856},"CoreXxx",{"type":40,"tag":489,"props":858,"children":859},{},[860],{"type":46,"value":861},"The actual implementation",{"type":40,"tag":489,"props":863,"children":864},{},[865,870,871],{"type":40,"tag":55,"props":866,"children":868},{"className":867},[],[869],{"type":46,"value":248},{"type":46,"value":763},{"type":40,"tag":55,"props":872,"children":874},{"className":873},[],[875],{"type":46,"value":876},"CoreCompile",{"type":40,"tag":462,"props":878,"children":879},{},[880,897,902],{"type":40,"tag":489,"props":881,"children":882},{},[883,889,891],{"type":40,"tag":55,"props":884,"children":886},{"className":885},[],[887],{"type":46,"value":888},"BeforeXxx",{"type":46,"value":890}," \u002F ",{"type":40,"tag":55,"props":892,"children":894},{"className":893},[],[895],{"type":46,"value":896},"AfterXxx",{"type":40,"tag":489,"props":898,"children":899},{},[900],{"type":46,"value":901},"Empty extensibility hooks",{"type":40,"tag":489,"props":903,"children":904},{},[905,911,912],{"type":40,"tag":55,"props":906,"children":908},{"className":907},[],[909],{"type":46,"value":910},"BeforeBuild",{"type":46,"value":763},{"type":40,"tag":55,"props":913,"children":915},{"className":914},[],[916],{"type":46,"value":917},"AfterCompile",{"type":40,"tag":462,"props":919,"children":920},{},[921,930,935],{"type":40,"tag":489,"props":922,"children":923},{},[924],{"type":40,"tag":55,"props":925,"children":927},{"className":926},[],[928],{"type":46,"value":929},"PrepareXxx",{"type":40,"tag":489,"props":931,"children":932},{},[933],{"type":46,"value":934},"Setup\u002Fvalidation phase",{"type":40,"tag":489,"props":936,"children":937},{},[938],{"type":40,"tag":55,"props":939,"children":941},{"className":940},[],[942],{"type":46,"value":943},"PrepareForBuild",{"type":40,"tag":462,"props":945,"children":946},{},[947,956,961],{"type":40,"tag":489,"props":948,"children":949},{},[950],{"type":40,"tag":55,"props":951,"children":953},{"className":952},[],[954],{"type":46,"value":955},"ResolveXxx",{"type":40,"tag":489,"props":957,"children":958},{},[959],{"type":46,"value":960},"Discovery\u002Fresolution phase",{"type":40,"tag":489,"props":962,"children":963},{},[964],{"type":40,"tag":55,"props":965,"children":967},{"className":966},[],[968],{"type":46,"value":969},"ResolveReferences",{"type":40,"tag":462,"props":971,"children":972},{},[973,982,987],{"type":40,"tag":489,"props":974,"children":975},{},[976],{"type":40,"tag":55,"props":977,"children":979},{"className":978},[],[980],{"type":46,"value":981},"GetXxx",{"type":40,"tag":489,"props":983,"children":984},{},[985],{"type":46,"value":986},"Lightweight query (no side effects)",{"type":40,"tag":489,"props":988,"children":989},{},[990],{"type":40,"tag":55,"props":991,"children":993},{"className":992},[],[994],{"type":46,"value":761},{"type":40,"tag":64,"props":996,"children":998},{"id":997},"complete-custom-target-template",[999],{"type":46,"value":1000},"Complete Custom Target Template",{"type":40,"tag":84,"props":1002,"children":1004},{"className":86,"code":1003,"language":88,"meta":89,"style":89},"\u003C!-- 1. Define the DependsOn chain for extensibility -->\n\u003CPropertyGroup>\n  \u003CMyFeatureDependsOn>\n    _ValidateMyFeatureInputs;\n    BeforeMyFeature;\n    CoreMyFeature;\n    AfterMyFeature\n  \u003C\u002FMyFeatureDependsOn>\n\u003C\u002FPropertyGroup>\n\n\u003C!-- 2. Outer target with Returns for inter-project communication -->\n\u003CTarget Name=\"MyFeature\"\n    DependsOnTargets=\"$(MyFeatureDependsOn)\"\n    Returns=\"@(MyFeatureOutput)\" \u002F>\n\n\u003C!-- 3. Empty extensibility points -->\n\u003CTarget Name=\"BeforeMyFeature\" \u002F>\n\u003CTarget Name=\"AfterMyFeature\" \u002F>\n\n\u003C!-- 4. Core implementation with Inputs\u002FOutputs for incrementality -->\n\u003CTarget Name=\"CoreMyFeature\"\n    Inputs=\"$(MSBuildAllProjects);@(MyFeatureInput)\"\n    Outputs=\"$(IntermediateOutputPath)myfeature.generated.cs\">\n  \u003CExec Command=\"my-tool.exe -o $(IntermediateOutputPath)myfeature.generated.cs\" \u002F>\n  \u003C!-- 5. Register outputs for clean tracking -->\n  \u003CItemGroup>\n    \u003CCompile Include=\"$(IntermediateOutputPath)myfeature.generated.cs\" \u002F>\n    \u003CFileWrites Include=\"$(IntermediateOutputPath)myfeature.generated.cs\" \u002F>\n  \u003C\u002FItemGroup>\n\u003C\u002FTarget>\n\n\u003C!-- 6. Validation target runs first in the dependency chain -->\n\u003CTarget Name=\"_ValidateMyFeatureInputs\">\n  \u003CError Text=\"MyFeatureInput items are required.\"\n         Condition=\"'@(MyFeatureInput)' == ''\" \u002F>\n\u003C\u002FTarget>\n",[1005],{"type":40,"tag":55,"props":1006,"children":1007},{"__ignoreMap":89},[1008,1016,1023,1031,1039,1047,1055,1063,1071,1078,1085,1093,1101,1109,1117,1124,1132,1141,1150,1158,1167,1176,1185,1194,1203,1212,1221,1230,1239,1248,1256,1264,1273,1282,1291,1300],{"type":40,"tag":95,"props":1009,"children":1010},{"class":97,"line":98},[1011],{"type":40,"tag":95,"props":1012,"children":1013},{},[1014],{"type":46,"value":1015},"\u003C!-- 1. Define the DependsOn chain for extensibility -->\n",{"type":40,"tag":95,"props":1017,"children":1018},{"class":97,"line":107},[1019],{"type":40,"tag":95,"props":1020,"children":1021},{},[1022],{"type":46,"value":104},{"type":40,"tag":95,"props":1024,"children":1025},{"class":97,"line":116},[1026],{"type":40,"tag":95,"props":1027,"children":1028},{},[1029],{"type":46,"value":1030},"  \u003CMyFeatureDependsOn>\n",{"type":40,"tag":95,"props":1032,"children":1033},{"class":97,"line":125},[1034],{"type":40,"tag":95,"props":1035,"children":1036},{},[1037],{"type":46,"value":1038},"    _ValidateMyFeatureInputs;\n",{"type":40,"tag":95,"props":1040,"children":1041},{"class":97,"line":134},[1042],{"type":40,"tag":95,"props":1043,"children":1044},{},[1045],{"type":46,"value":1046},"    BeforeMyFeature;\n",{"type":40,"tag":95,"props":1048,"children":1049},{"class":97,"line":143},[1050],{"type":40,"tag":95,"props":1051,"children":1052},{},[1053],{"type":46,"value":1054},"    CoreMyFeature;\n",{"type":40,"tag":95,"props":1056,"children":1057},{"class":97,"line":152},[1058],{"type":40,"tag":95,"props":1059,"children":1060},{},[1061],{"type":46,"value":1062},"    AfterMyFeature\n",{"type":40,"tag":95,"props":1064,"children":1065},{"class":97,"line":161},[1066],{"type":40,"tag":95,"props":1067,"children":1068},{},[1069],{"type":46,"value":1070},"  \u003C\u002FMyFeatureDependsOn>\n",{"type":40,"tag":95,"props":1072,"children":1073},{"class":97,"line":171},[1074],{"type":40,"tag":95,"props":1075,"children":1076},{},[1077],{"type":46,"value":158},{"type":40,"tag":95,"props":1079,"children":1080},{"class":97,"line":180},[1081],{"type":40,"tag":95,"props":1082,"children":1083},{"emptyLinePlaceholder":165},[1084],{"type":46,"value":168},{"type":40,"tag":95,"props":1086,"children":1087},{"class":97,"line":189},[1088],{"type":40,"tag":95,"props":1089,"children":1090},{},[1091],{"type":46,"value":1092},"\u003C!-- 2. Outer target with Returns for inter-project communication -->\n",{"type":40,"tag":95,"props":1094,"children":1095},{"class":97,"line":198},[1096],{"type":40,"tag":95,"props":1097,"children":1098},{},[1099],{"type":46,"value":1100},"\u003CTarget Name=\"MyFeature\"\n",{"type":40,"tag":95,"props":1102,"children":1103},{"class":97,"line":207},[1104],{"type":40,"tag":95,"props":1105,"children":1106},{},[1107],{"type":46,"value":1108},"    DependsOnTargets=\"$(MyFeatureDependsOn)\"\n",{"type":40,"tag":95,"props":1110,"children":1111},{"class":97,"line":215},[1112],{"type":40,"tag":95,"props":1113,"children":1114},{},[1115],{"type":46,"value":1116},"    Returns=\"@(MyFeatureOutput)\" \u002F>\n",{"type":40,"tag":95,"props":1118,"children":1119},{"class":97,"line":224},[1120],{"type":40,"tag":95,"props":1121,"children":1122},{"emptyLinePlaceholder":165},[1123],{"type":46,"value":168},{"type":40,"tag":95,"props":1125,"children":1126},{"class":97,"line":233},[1127],{"type":40,"tag":95,"props":1128,"children":1129},{},[1130],{"type":46,"value":1131},"\u003C!-- 3. Empty extensibility points -->\n",{"type":40,"tag":95,"props":1133,"children":1135},{"class":97,"line":1134},17,[1136],{"type":40,"tag":95,"props":1137,"children":1138},{},[1139],{"type":46,"value":1140},"\u003CTarget Name=\"BeforeMyFeature\" \u002F>\n",{"type":40,"tag":95,"props":1142,"children":1144},{"class":97,"line":1143},18,[1145],{"type":40,"tag":95,"props":1146,"children":1147},{},[1148],{"type":46,"value":1149},"\u003CTarget Name=\"AfterMyFeature\" \u002F>\n",{"type":40,"tag":95,"props":1151,"children":1153},{"class":97,"line":1152},19,[1154],{"type":40,"tag":95,"props":1155,"children":1156},{"emptyLinePlaceholder":165},[1157],{"type":46,"value":168},{"type":40,"tag":95,"props":1159,"children":1161},{"class":97,"line":1160},20,[1162],{"type":40,"tag":95,"props":1163,"children":1164},{},[1165],{"type":46,"value":1166},"\u003C!-- 4. Core implementation with Inputs\u002FOutputs for incrementality -->\n",{"type":40,"tag":95,"props":1168,"children":1170},{"class":97,"line":1169},21,[1171],{"type":40,"tag":95,"props":1172,"children":1173},{},[1174],{"type":46,"value":1175},"\u003CTarget Name=\"CoreMyFeature\"\n",{"type":40,"tag":95,"props":1177,"children":1179},{"class":97,"line":1178},22,[1180],{"type":40,"tag":95,"props":1181,"children":1182},{},[1183],{"type":46,"value":1184},"    Inputs=\"$(MSBuildAllProjects);@(MyFeatureInput)\"\n",{"type":40,"tag":95,"props":1186,"children":1188},{"class":97,"line":1187},23,[1189],{"type":40,"tag":95,"props":1190,"children":1191},{},[1192],{"type":46,"value":1193},"    Outputs=\"$(IntermediateOutputPath)myfeature.generated.cs\">\n",{"type":40,"tag":95,"props":1195,"children":1197},{"class":97,"line":1196},24,[1198],{"type":40,"tag":95,"props":1199,"children":1200},{},[1201],{"type":46,"value":1202},"  \u003CExec Command=\"my-tool.exe -o $(IntermediateOutputPath)myfeature.generated.cs\" \u002F>\n",{"type":40,"tag":95,"props":1204,"children":1206},{"class":97,"line":1205},25,[1207],{"type":40,"tag":95,"props":1208,"children":1209},{},[1210],{"type":46,"value":1211},"  \u003C!-- 5. Register outputs for clean tracking -->\n",{"type":40,"tag":95,"props":1213,"children":1215},{"class":97,"line":1214},26,[1216],{"type":40,"tag":95,"props":1217,"children":1218},{},[1219],{"type":46,"value":1220},"  \u003CItemGroup>\n",{"type":40,"tag":95,"props":1222,"children":1224},{"class":97,"line":1223},27,[1225],{"type":40,"tag":95,"props":1226,"children":1227},{},[1228],{"type":46,"value":1229},"    \u003CCompile Include=\"$(IntermediateOutputPath)myfeature.generated.cs\" \u002F>\n",{"type":40,"tag":95,"props":1231,"children":1233},{"class":97,"line":1232},28,[1234],{"type":40,"tag":95,"props":1235,"children":1236},{},[1237],{"type":46,"value":1238},"    \u003CFileWrites Include=\"$(IntermediateOutputPath)myfeature.generated.cs\" \u002F>\n",{"type":40,"tag":95,"props":1240,"children":1242},{"class":97,"line":1241},29,[1243],{"type":40,"tag":95,"props":1244,"children":1245},{},[1246],{"type":46,"value":1247},"  \u003C\u002FItemGroup>\n",{"type":40,"tag":95,"props":1249,"children":1251},{"class":97,"line":1250},30,[1252],{"type":40,"tag":95,"props":1253,"children":1254},{},[1255],{"type":46,"value":305},{"type":40,"tag":95,"props":1257,"children":1259},{"class":97,"line":1258},31,[1260],{"type":40,"tag":95,"props":1261,"children":1262},{"emptyLinePlaceholder":165},[1263],{"type":46,"value":168},{"type":40,"tag":95,"props":1265,"children":1267},{"class":97,"line":1266},32,[1268],{"type":40,"tag":95,"props":1269,"children":1270},{},[1271],{"type":46,"value":1272},"\u003C!-- 6. Validation target runs first in the dependency chain -->\n",{"type":40,"tag":95,"props":1274,"children":1276},{"class":97,"line":1275},33,[1277],{"type":40,"tag":95,"props":1278,"children":1279},{},[1280],{"type":46,"value":1281},"\u003CTarget Name=\"_ValidateMyFeatureInputs\">\n",{"type":40,"tag":95,"props":1283,"children":1285},{"class":97,"line":1284},34,[1286],{"type":40,"tag":95,"props":1287,"children":1288},{},[1289],{"type":46,"value":1290},"  \u003CError Text=\"MyFeatureInput items are required.\"\n",{"type":40,"tag":95,"props":1292,"children":1294},{"class":97,"line":1293},35,[1295],{"type":40,"tag":95,"props":1296,"children":1297},{},[1298],{"type":46,"value":1299},"         Condition=\"'@(MyFeatureInput)' == ''\" \u002F>\n",{"type":40,"tag":95,"props":1301,"children":1303},{"class":97,"line":1302},36,[1304],{"type":40,"tag":95,"props":1305,"children":1306},{},[1307],{"type":46,"value":305},{"type":40,"tag":64,"props":1309,"children":1311},{"id":1310},"common-pitfalls",[1312],{"type":46,"value":1313},"Common Pitfalls",{"type":40,"tag":314,"props":1315,"children":1316},{},[1317,1342,1365,1395],{"type":40,"tag":318,"props":1318,"children":1319},{},[1320,1332,1334,1340],{"type":40,"tag":76,"props":1321,"children":1322},{},[1323,1325,1330],{"type":46,"value":1324},"Overwriting ",{"type":40,"tag":55,"props":1326,"children":1328},{"className":1327},[],[1329],{"type":46,"value":370},{"type":46,"value":1331}," properties",{"type":46,"value":1333}," drops SDK targets silently. Always include ",{"type":40,"tag":55,"props":1335,"children":1337},{"className":1336},[],[1338],{"type":46,"value":1339},"$(ExistingProperty)",{"type":46,"value":1341}," when appending.",{"type":40,"tag":318,"props":1343,"children":1344},{},[1345,1357,1359,1364],{"type":40,"tag":76,"props":1346,"children":1347},{},[1348,1350,1355],{"type":46,"value":1349},"Using ",{"type":40,"tag":55,"props":1351,"children":1353},{"className":1352},[],[1354],{"type":46,"value":748},{"type":46,"value":1356}," on query targets",{"type":46,"value":1358}," causes MSBuild to skip them when \"up to date,\" returning stale data. Use ",{"type":40,"tag":55,"props":1360,"children":1362},{"className":1361},[],[1363],{"type":46,"value":734},{"type":46,"value":785},{"type":40,"tag":318,"props":1366,"children":1367},{},[1368,1379,1381,1386,1388,1394],{"type":40,"tag":76,"props":1369,"children":1370},{},[1371,1373],{"type":46,"value":1372},"Defining targets in ",{"type":40,"tag":55,"props":1374,"children":1376},{"className":1375},[],[1377],{"type":46,"value":1378},".props",{"type":46,"value":1380}," means ",{"type":40,"tag":55,"props":1382,"children":1384},{"className":1383},[],[1385],{"type":46,"value":519},{"type":46,"value":1387}," on SDK targets have nothing to hook into yet. Move targets to ",{"type":40,"tag":55,"props":1389,"children":1391},{"className":1390},[],[1392],{"type":46,"value":1393},".targets",{"type":46,"value":785},{"type":40,"tag":318,"props":1396,"children":1397},{},[1398,1408],{"type":40,"tag":76,"props":1399,"children":1400},{},[1401,1403],{"type":46,"value":1402},"Forgetting ",{"type":40,"tag":55,"props":1404,"children":1406},{"className":1405},[],[1407],{"type":46,"value":339},{"type":46,"value":1409}," in orchestrating targets means file tracking fails on build errors, breaking subsequent incremental builds.",{"type":40,"tag":1411,"props":1412,"children":1413},"style",{},[1414],{"type":46,"value":1415},"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":1417,"total":1522},[1418,1433,1448,1466,1480,1500,1510],{"slug":1419,"name":1419,"fn":1420,"description":1421,"org":1422,"tags":1423,"stars":22,"repoUrl":23,"updatedAt":1432},"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},[1424,1425,1426,1429],{"name":13,"slug":14,"type":15},{"name":20,"slug":21,"type":15},{"name":1427,"slug":1428,"type":15},"Debugging","debugging",{"name":1430,"slug":1431,"type":15},"Performance","performance","2026-07-12T08:23:25.400375",{"slug":1434,"name":1434,"fn":1435,"description":1436,"org":1437,"tags":1438,"stars":22,"repoUrl":23,"updatedAt":1447},"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},[1439,1440,1443,1444],{"name":13,"slug":14,"type":15},{"name":1441,"slug":1442,"type":15},"Android","android",{"name":1427,"slug":1428,"type":15},{"name":1445,"slug":1446,"type":15},"Microsoft","microsoft","2026-07-12T08:23:21.595572",{"slug":1449,"name":1449,"fn":1450,"description":1451,"org":1452,"tags":1453,"stars":22,"repoUrl":23,"updatedAt":1465},"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},[1454,1455,1456,1459,1462],{"name":13,"slug":14,"type":15},{"name":1427,"slug":1428,"type":15},{"name":1457,"slug":1458,"type":15},"iOS","ios",{"name":1460,"slug":1461,"type":15},"macOS","macos",{"name":1463,"slug":1464,"type":15},"Observability","observability","2026-07-12T08:23:20.369986",{"slug":1467,"name":1467,"fn":1468,"description":1469,"org":1470,"tags":1471,"stars":22,"repoUrl":23,"updatedAt":1479},"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},[1472,1473,1476],{"name":20,"slug":21,"type":15},{"name":1474,"slug":1475,"type":15},"QA","qa",{"name":1477,"slug":1478,"type":15},"Testing","testing","2026-07-12T08:23:51.277743",{"slug":1481,"name":1481,"fn":1482,"description":1483,"org":1484,"tags":1485,"stars":22,"repoUrl":23,"updatedAt":1499},"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},[1486,1487,1490,1493,1496],{"name":13,"slug":14,"type":15},{"name":1488,"slug":1489,"type":15},"Blazor","blazor",{"name":1491,"slug":1492,"type":15},"C#","csharp",{"name":1494,"slug":1495,"type":15},"UI Components","ui-components",{"name":1497,"slug":1498,"type":15},"Web Development","web-development","2026-07-15T06:03:29.216359",{"slug":1501,"name":1501,"fn":1502,"description":1503,"org":1504,"tags":1505,"stars":22,"repoUrl":23,"updatedAt":1509},"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},[1506,1507,1508],{"name":20,"slug":21,"type":15},{"name":1427,"slug":1428,"type":15},{"name":1445,"slug":1446,"type":15},"2026-07-12T08:21:34.637923",{"slug":1511,"name":1511,"fn":1512,"description":1513,"org":1514,"tags":1515,"stars":22,"repoUrl":23,"updatedAt":1521},"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},[1516,1519,1520],{"name":1517,"slug":1518,"type":15},"Build","build",{"name":1427,"slug":1428,"type":15},{"name":17,"slug":18,"type":15},"2026-07-19T05:38:19.340791",96,{"items":1524,"total":1629},[1525,1537,1544,1551,1559,1565,1573,1579,1585,1595,1608,1619],{"slug":1526,"name":1526,"fn":1527,"description":1528,"org":1529,"tags":1530,"stars":1534,"repoUrl":1535,"updatedAt":1536},"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},[1531,1532,1533],{"name":13,"slug":14,"type":15},{"name":17,"slug":18,"type":15},{"name":1430,"slug":1431,"type":15},5535,"https:\u002F\u002Fgithub.com\u002Fdotnet\u002Fmsbuild","2026-07-22T05:37:33.965588",{"slug":1419,"name":1419,"fn":1420,"description":1421,"org":1538,"tags":1539,"stars":22,"repoUrl":23,"updatedAt":1432},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1540,1541,1542,1543],{"name":13,"slug":14,"type":15},{"name":20,"slug":21,"type":15},{"name":1427,"slug":1428,"type":15},{"name":1430,"slug":1431,"type":15},{"slug":1434,"name":1434,"fn":1435,"description":1436,"org":1545,"tags":1546,"stars":22,"repoUrl":23,"updatedAt":1447},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1547,1548,1549,1550],{"name":13,"slug":14,"type":15},{"name":1441,"slug":1442,"type":15},{"name":1427,"slug":1428,"type":15},{"name":1445,"slug":1446,"type":15},{"slug":1449,"name":1449,"fn":1450,"description":1451,"org":1552,"tags":1553,"stars":22,"repoUrl":23,"updatedAt":1465},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1554,1555,1556,1557,1558],{"name":13,"slug":14,"type":15},{"name":1427,"slug":1428,"type":15},{"name":1457,"slug":1458,"type":15},{"name":1460,"slug":1461,"type":15},{"name":1463,"slug":1464,"type":15},{"slug":1467,"name":1467,"fn":1468,"description":1469,"org":1560,"tags":1561,"stars":22,"repoUrl":23,"updatedAt":1479},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1562,1563,1564],{"name":20,"slug":21,"type":15},{"name":1474,"slug":1475,"type":15},{"name":1477,"slug":1478,"type":15},{"slug":1481,"name":1481,"fn":1482,"description":1483,"org":1566,"tags":1567,"stars":22,"repoUrl":23,"updatedAt":1499},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1568,1569,1570,1571,1572],{"name":13,"slug":14,"type":15},{"name":1488,"slug":1489,"type":15},{"name":1491,"slug":1492,"type":15},{"name":1494,"slug":1495,"type":15},{"name":1497,"slug":1498,"type":15},{"slug":1501,"name":1501,"fn":1502,"description":1503,"org":1574,"tags":1575,"stars":22,"repoUrl":23,"updatedAt":1509},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1576,1577,1578],{"name":20,"slug":21,"type":15},{"name":1427,"slug":1428,"type":15},{"name":1445,"slug":1446,"type":15},{"slug":1511,"name":1511,"fn":1512,"description":1513,"org":1580,"tags":1581,"stars":22,"repoUrl":23,"updatedAt":1521},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1582,1583,1584],{"name":1517,"slug":1518,"type":15},{"name":1427,"slug":1428,"type":15},{"name":17,"slug":18,"type":15},{"slug":1586,"name":1586,"fn":1587,"description":1588,"org":1589,"tags":1590,"stars":22,"repoUrl":23,"updatedAt":1594},"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},[1591,1592,1593],{"name":13,"slug":14,"type":15},{"name":17,"slug":18,"type":15},{"name":1430,"slug":1431,"type":15},"2026-07-19T05:38:18.364937",{"slug":1596,"name":1596,"fn":1597,"description":1598,"org":1599,"tags":1600,"stars":22,"repoUrl":23,"updatedAt":1607},"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},[1601,1602,1605,1606],{"name":17,"slug":18,"type":15},{"name":1603,"slug":1604,"type":15},"Monitoring","monitoring",{"name":1430,"slug":1431,"type":15},{"name":1477,"slug":1478,"type":15},"2026-07-12T08:21:35.865649",{"slug":1609,"name":1609,"fn":1610,"description":1611,"org":1612,"tags":1613,"stars":22,"repoUrl":23,"updatedAt":1618},"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},[1614,1615,1616,1617],{"name":13,"slug":14,"type":15},{"name":1427,"slug":1428,"type":15},{"name":17,"slug":18,"type":15},{"name":1430,"slug":1431,"type":15},"2026-07-12T08:21:40.961722",{"slug":1620,"name":1620,"fn":1621,"description":1622,"org":1623,"tags":1624,"stars":22,"repoUrl":23,"updatedAt":1628},"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},[1625,1626,1627],{"name":1427,"slug":1428,"type":15},{"name":17,"slug":18,"type":15},{"name":1474,"slug":1475,"type":15},"2026-07-19T05:38:14.336279",144]