[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6DZ5X29DR7D34MQ1R3NHCTW":3,"skill-same:01M6DZ5X29DR7D34MQ1R3NHCTW":94},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":45,"linkOnly":46,"markdownContent":47,"markdownBody":48,"frontMatter":49,"refName":50,"commitSha":51,"skillDirectory":52,"forksCount":53,"repositoryHtmlUrl":54,"repositoryHomepageUrl":55,"ownerHtmlUrl":56,"ownerBlogUrl":57,"ownerDescription":58,"updatedAt":59,"install":60,"resources":73},"01M6DZ5X29DR7D34MQ1R3NHCTW","extension-points",null,"Own MSBuild import and hook discovery. USE FOR: CustomBefore\u002FCustomAfter hooks, ordered wildcard and NuGet auto-imports, control properties, build\u002FbuildTransitive packed layout, package ID and file-name matching, per-TFM forwarders, and tracing why assets or hooks are missing, broken, or replaced. An import guard remains in scope when it is one defect in a broader hook\u002Fimport flow. DO NOT USE for a focused safety verdict on whether one specific Import needs Exists or is an intentionally unguarded package contract; use msbuild-antipatterns. NEVER INVOKE when imports and hook placement already work and the request is only target Inputs\u002FOutputs, incremental skipping, or FileWrites clean tracking; use incremental-build or target-authoring. Exclude props-versus-targets placement and non-MSBuild systems.","managedcode\u002Fdotnet-skills","managedcode","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F78253589?v=4","01M6DYDJR3EG8KB5G4PC65XCTT","Managed Code","01M6DYDJX0ZT432N04NYJW89DN",515,"MIT","https:\u002F\u002Fgithub.com\u002Fmanagedcode\u002Fdotnet-skills\u002Fblob\u002Fmain\u002Fcatalog\u002FTools\u002FOfficial-DotNet-MSBuild\u002Fskills\u002Fextension-points\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],"extension","extension points","do","when","defect","invoke","request","imports","antipatterns","import","missing","scope","authoring","layout","clean","hooks","only","never","auto","broken","work","why","discovery","Safety","flow","tracing","2026-11-10 10:12:30",false,"---\nname: extension-points\ndescription: \"Own MSBuild import and hook discovery. USE FOR: CustomBefore\u002FCustomAfter hooks, ordered wildcard and NuGet auto-imports, control properties, build\u002FbuildTransitive packed layout, package ID and file-name matching, per-TFM forwarders, and tracing why assets or hooks are missing, broken, or replaced. An import guard remains in scope when it is one defect in a broader hook\u002Fimport flow. DO NOT USE for a focused safety verdict on whether one specific Import needs Exists or is an intentionally unguarded package contract; use msbuild-antipatterns. NEVER INVOKE when imports and hook placement already work and the request is only target Inputs\u002FOutputs, incremental skipping, or FileWrites clean tracking; use incremental-build or target-authoring. Exclude props-versus-targets placement and non-MSBuild systems.\"\nlicense: MIT\n---\n\n# MSBuild Extension Points\n\nHow the MSBuild pipeline provides hooks for SDKs, NuGet packages, repos, and users to inject custom logic.\n\n## CustomBefore \u002F CustomAfter Hooks\n\nEvery major `.targets` file defines import hooks:\n\n```xml\n\u003CPropertyGroup>\n  \u003CCustomBeforeMicrosoftCommonTargets Condition=\"'$(CustomBeforeMicrosoftCommonTargets)' == ''\">\n    $(MSBuildExtensionsPath)\\v$(MSBuildToolsVersion)\\Custom.Before.Microsoft.Common.targets\n  \u003C\u002FCustomBeforeMicrosoftCommonTargets>\n\u003C\u002FPropertyGroup>\n\n\u003CImport Project=\"$(CustomBeforeMicrosoftCommonTargets)\"\n    Condition=\"'$(CustomBeforeMicrosoftCommonTargets)' != '' and Exists('$(CustomBeforeMicrosoftCommonTargets)')\"\u002F>\n\u003C!-- ... core targets ... -->\n\u003CImport Project=\"$(CustomAfterMicrosoftCommonTargets)\"\n    Condition=\"'$(CustomAfterMicrosoftCommonTargets)' != '' and Exists('$(CustomAfterMicrosoftCommonTargets)')\"\u002F>\n```\n\n### Rules\n\n- Default path includes version (`v$(MSBuildToolsVersion)`) for side-by-side installations.\n- Always check `Exists()`. The file may not be present on every machine.\n- **Append** to the property (don't overwrite) to chain multiple hooks:\n\n```xml\n\u003CPropertyGroup>\n  \u003CCustomBeforeMicrosoftCommonTargets>\n    $(CustomBeforeMicrosoftCommonTargets);$(MSBuildThisFileDirectory)MyExtension.targets\n  \u003C\u002FCustomBeforeMicrosoftCommonTargets>\n\u003C\u002FPropertyGroup>\n```\n\n## Wildcard Import Directories\n\nMSBuild imports all files in extension directories, sorted alphabetically:\n\n```xml\n\u003CImport Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Imports\\Microsoft.Common.props\\ImportBefore\\*\"\n    Condition=\"'$(ImportByWildcardBeforeMicrosoftCommonProps)' == 'true'\n               and Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Imports\\Microsoft.Common.props\\ImportBefore')\" \u002F>\n```\n\n### Key paths\n\n| Property | Resolves to | Scope |\n|---|---|---|\n| `$(MSBuildUserExtensionsPath)` | `%APPDATA%\\Microsoft\\MSBuild` | Per-user |\n| `$(MSBuildExtensionsPath)` | MSBuild install directory | Machine-wide |\n| `$(MSBuildProjectExtensionsPath)` | `obj\u002F` directory | Per-project (NuGet) |\n\nName files with numeric prefixes for ordering: `01-first.props`, `02-second.props`.\n\n## Import Gating — Control Properties\n\nEvery wildcard import is gated by a boolean property:\n\n```xml\n\u003CPropertyGroup>\n  \u003CImportByWildcardBeforeMicrosoftCommonProps\n      Condition=\"'$(ImportByWildcardBeforeMicrosoftCommonProps)' == ''\">true\u003C\u002FImportByWildcardBeforeMicrosoftCommonProps>\n  \u003CImportDirectoryBuildProps\n      Condition=\"'$(ImportDirectoryBuildProps)' == ''\">true\u003C\u002FImportDirectoryBuildProps>\n\u003C\u002FPropertyGroup>\n```\n\n### Available control properties\n\n| Property | What it disables |\n|---|---|\n| `ImportDirectoryBuildProps` | Directory.Build.props auto-discovery |\n| `ImportDirectoryBuildTargets` | Directory.Build.targets auto-discovery |\n| `ImportProjectExtensionProps` | NuGet-generated `*.props` in obj\u002F |\n| `ImportProjectExtensionTargets` | NuGet-generated `*.targets` in obj\u002F |\n| `ImportByWildcardBefore*` | Machine-level ImportBefore extensions |\n| `ImportByWildcardAfter*` | Machine-level ImportAfter extensions |\n\n## NuGet Package Build Extension Layout\n\nNuGet packages inject build logic via `build\u002F` or `buildTransitive\u002F` folders:\n\n```text\nMyPackage\u002F\n  build\u002F\n    MyPackage.props      ← imported via *.props wildcard\n    MyPackage.targets    ← imported via *.targets wildcard\n  buildTransitive\u002F\n    MyPackage.props      ← imported by transitive consumers\n    MyPackage.targets\n```\n\n### Rules\n\n- File names **must match the package ID** exactly.\n- `build\u002F` affects direct consumers only. `buildTransitive\u002F` affects the entire dependency chain.\n- Props are imported early (before the project), targets are imported late (after the project).\n\n### Forwarding chain: `buildTransitive\u002F` → `build\u002F` → shared\n\nForward `buildTransitive\u002F*.props` and `buildTransitive\u002F*.targets` through their sibling `build\u002F*.props` \u002F `build\u002F*.targets` files (chain `buildTransitive → build → shared`) instead of importing `buildMultiTargeting\u002F` directly. This keeps `build\u002F` as the single source of truth with a clear ownership chain, so transitive consumers stay in sync with direct consumers instead of the two layouts drifting apart.\n\nWhen `build\u002F` is packed **per-TFM** (`build\u002F\u003Ctfm>\u002F`, via `TfmSpecificPackageFile`, a per-TFM `\u003CPackagePath>`, or SDK conventions) while `buildMultiTargeting\u002F` is not, a `buildTransitive\u002F\u003Ctfm>\u002F` forwarder **must include the TFM segment** — dropping it resolves to a non-existent package-root `build\u002FMyPackage.props` and fails transitive consumers with **`MSB4019`**. Derive the segment from the file's own folder, never `$(TargetFramework)` (NuGet nearest-match can serve a `net10.0` consumer the `net9.0` folder, so `$(TargetFramework)` may name a folder that was never restored):\n\n```xml\n\u003C!-- buildTransitive\u002F\u003Ctfm>\u002FMyPackage.props -->\n\u003CImport Project=\"$(MSBuildThisFileDirectory)..\\..\\build\\$([System.IO.Path]::GetFileName($([System.IO.Path]::GetDirectoryName('$(MSBuildThisFileDirectory)'))))\\MyPackage.props\" \u002F>\n```\n\n## Source Tree vs Packed Layout\n\nWhen reviewing a NuGet build-extension package, the **source layout** in the repository can legitimately differ from the **packed layout** inside the produced `.nupkg`. This is a common source of false-positive \"import points at a missing file\" findings.\n\nThree packaging mechanisms reshape the layout at pack time:\n\n1. **`.nuspec` `\u003Cfile src=… target=…>` mappings** — copy a single source file into multiple per-TFM targets:\n\n   ```xml\n   \u003C!-- Source tree has ONE shared file:\n          buildTransitive\\common\\MyAdapter.props\n        Pack rewrites it to per-TFM targets inside the .nupkg:\n          buildTransitive\\net462\\MyAdapter.props\n          buildTransitive\\net8.0\\MyAdapter.props\n          buildTransitive\\net9.0\\MyAdapter.props -->\n   \u003Cfiles>\n     \u003Cfile src=\"buildTransitive\\common\\MyAdapter.props\" target=\"buildTransitive\\net462\\MyAdapter.props\" \u002F>\n     \u003Cfile src=\"buildTransitive\\common\\MyAdapter.props\" target=\"buildTransitive\\net8.0\\MyAdapter.props\" \u002F>\n     \u003Cfile src=\"buildTransitive\\common\\MyAdapter.props\" target=\"buildTransitive\\net9.0\\MyAdapter.props\" \u002F>\n   \u003C\u002Ffiles>\n   ```\n\n   In the `\u003Cfile>` element, a `target` ending in `\\` is treated as a folder (filename preserved from `src`); a `target` ending in a filename renames the file.\n\n2. **`.csproj` `\u003CPackagePath>` metadata** on `\u003CNone Update=…>` or `\u003CContent Include=…>` items — same effect via SDK pack. Use one item per destination to keep the mapping unambiguous:\n\n   ```xml\n   \u003CItemGroup>\n     \u003CNone Include=\"buildTransitive\\common\\MyAdapter.props\" Pack=\"true\" PackagePath=\"buildTransitive\\net8.0\\MyAdapter.props\" \u002F>\n     \u003CNone Include=\"buildTransitive\\common\\MyAdapter.props\" Pack=\"true\" PackagePath=\"buildTransitive\\net9.0\\MyAdapter.props\" \u002F>\n   \u003C\u002FItemGroup>\n   ```\n\n   NuGet\u002FSDK pack also accepts a semicolon-separated list (`PackagePath=\"buildTransitive\\net8.0\\;buildTransitive\\net9.0\\\"`) to fan one source out to multiple destinations, but the multi-item form above is harder to misread.\n\n3. **SDK conventions** — `IncludeBuildOutput`, `BuildOutputTargetFolder`, `IncludeContentInPack` automatically place built outputs under `lib\u002F\u003Ctfm>\u002F` or `build\u002F\u003Ctfm>\u002F`.\n\n### Implication for reviewers\n\nA forwarder like the following inside a packed `build\u002Fnet462\u002F` folder is **not** a \"missing-file\" bug, even if the source tree has no `buildTransitive\u002Fnet462\u002F` directory:\n\n```xml\n\u003C!-- In packed build\u002Fnet462\u002FMyAdapter.props -->\n\u003CProject>\n  \u003CImport Project=\"$(MSBuildThisFileDirectory)..\\..\\buildTransitive\\net462\\MyAdapter.props\" \u002F>\n\u003C\u002FProject>\n```\n\nBefore flagging an unguarded `\u003CImport>` inside a `build\u002F\u003Ctfm>\u002F` or `buildTransitive\u002F\u003Ctfm>\u002F` folder:\n\n1. Look for `*.nuspec` in the project directory and its immediate parent directory (do not walk further up). Read every `\u003Cfile target=…>` whose `target` matches the imported path.\n2. Read the `.csproj` for `\u003CPackagePath>` metadata on `\u003CNone>`\u002F`\u003CContent>` items.\n3. Only flag the import if the target path is missing from **both** the source tree *and* the projected package layout.\n\nSee also `msbuild-antipatterns` AP-13 (\"NuGet package forwarders\" exception).\n\n## Import Guard Pattern\n\nThe `.targets` file ensures `.props` was imported using a guard property:\n\n```xml\n\u003C!-- End of Microsoft.Common.props -->\n\u003CPropertyGroup>\n  \u003CMicrosoftCommonPropsHasBeenImported>true\u003C\u002FMicrosoftCommonPropsHasBeenImported>\n\u003C\u002FPropertyGroup>\n\n\u003C!-- Top of Microsoft.Common.CurrentVersion.targets -->\n\u003CImport Project=\"Microsoft.Common.props\"\n    Condition=\"'$(MicrosoftCommonPropsHasBeenImported)' != 'true'\" \u002F>\n```\n\nThis handles projects that only import `.targets`.\n\n## Directory.Build Discovery\n\nMSBuild walks up the directory tree to find the nearest `Directory.Build.props`:\n\n```xml\n\u003C_DirectoryBuildPropsBasePath>\n  $([MSBuild]::GetDirectoryNameOfFileAbove('$(MSBuildProjectDirectory)', 'Directory.Build.props'))\n\u003C\u002F_DirectoryBuildPropsBasePath>\n```\n\nOnly the **nearest** file is discovered. Nested hierarchies must explicitly import parents:\n\n```xml\n\u003C!-- src\u002FDirectory.Build.props -->\n\u003CPropertyGroup>\n  \u003C_ParentPropsPath>$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)..\u002F'))\u003C\u002F_ParentPropsPath>\n\u003C\u002FPropertyGroup>\n\u003CImport Project=\"$(_ParentPropsPath)\" Condition=\"'$(_ParentPropsPath)' != ''\" \u002F>\n```\n\n## Creating Your Own Extension Point\n\n```xml\n\u003C!-- MySDK.targets -->\n\u003CProject>\n  \u003CImport Project=\"MySDK.props\" Condition=\"'$(MySDKPropsImported)' != 'true'\" \u002F>\n\n  \u003CPropertyGroup>\n    \u003CCustomBeforeMySDK Condition=\"'$(CustomBeforeMySDK)' == ''\">$(MSBuildProjectDirectory)\\MySDK.Before.targets\u003C\u002FCustomBeforeMySDK>\n    \u003CCustomAfterMySDK Condition=\"'$(CustomAfterMySDK)' == ''\">$(MSBuildProjectDirectory)\\MySDK.After.targets\u003C\u002FCustomAfterMySDK>\n  \u003C\u002FPropertyGroup>\n\n  \u003CImport Project=\"$(CustomBeforeMySDK)\" Condition=\"Exists('$(CustomBeforeMySDK)')\" \u002F>\n\n  \u003CPropertyGroup>\n    \u003CMySDKBuildDependsOn>BeforeMySDKBuild;CoreMySDKBuild;AfterMySDKBuild\u003C\u002FMySDKBuildDependsOn>\n  \u003C\u002FPropertyGroup>\n  \u003CTarget Name=\"MySDKBuild\" DependsOnTargets=\"$(MySDKBuildDependsOn)\" \u002F>\n  \u003CTarget Name=\"BeforeMySDKBuild\" \u002F>\n  \u003CTarget Name=\"AfterMySDKBuild\" \u002F>\n  \u003CTarget Name=\"CoreMySDKBuild\">\n    \u003C!-- implementation -->\n  \u003C\u002FTarget>\n\n  \u003CImport Project=\"$(CustomAfterMySDK)\" Condition=\"Exists('$(CustomAfterMySDK)')\" \u002F>\n\u003C\u002FProject>\n```\n\n## Common Pitfalls\n\n- **Missing `Exists()` on optional imports** causes build failures when files are absent. **Exception**: imports inside published `build\u002F\u003Ctfm>\u002F` and `buildTransitive\u002F\u003Ctfm>\u002F` folders of a NuGet package are a package contract — the target is guaranteed by the packed layout (see \"Source Tree vs Packed Layout\" above). Don't guard them and don't flag them.\n- **Overwriting Custom* properties** drops prior hooks. Append with `;` separator.\n- **NuGet package file names not matching package ID** silently skips the import.\n- **Nested Directory.Build.props** without parent import loses repo-root settings.\n","# MSBuild Extension Points\n\nHow the MSBuild pipeline provides hooks for SDKs, NuGet packages, repos, and users to inject custom logic.\n\n## CustomBefore \u002F CustomAfter Hooks\n\nEvery major `.targets` file defines import hooks:\n\n```xml\n\u003CPropertyGroup>\n  \u003CCustomBeforeMicrosoftCommonTargets Condition=\"'$(CustomBeforeMicrosoftCommonTargets)' == ''\">\n    $(MSBuildExtensionsPath)\\v$(MSBuildToolsVersion)\\Custom.Before.Microsoft.Common.targets\n  \u003C\u002FCustomBeforeMicrosoftCommonTargets>\n\u003C\u002FPropertyGroup>\n\n\u003CImport Project=\"$(CustomBeforeMicrosoftCommonTargets)\"\n    Condition=\"'$(CustomBeforeMicrosoftCommonTargets)' != '' and Exists('$(CustomBeforeMicrosoftCommonTargets)')\"\u002F>\n\u003C!-- ... core targets ... -->\n\u003CImport Project=\"$(CustomAfterMicrosoftCommonTargets)\"\n    Condition=\"'$(CustomAfterMicrosoftCommonTargets)' != '' and Exists('$(CustomAfterMicrosoftCommonTargets)')\"\u002F>\n```\n\n### Rules\n\n- Default path includes version (`v$(MSBuildToolsVersion)`) for side-by-side installations.\n- Always check `Exists()`. The file may not be present on every machine.\n- **Append** to the property (don't overwrite) to chain multiple hooks:\n\n```xml\n\u003CPropertyGroup>\n  \u003CCustomBeforeMicrosoftCommonTargets>\n    $(CustomBeforeMicrosoftCommonTargets);$(MSBuildThisFileDirectory)MyExtension.targets\n  \u003C\u002FCustomBeforeMicrosoftCommonTargets>\n\u003C\u002FPropertyGroup>\n```\n\n## Wildcard Import Directories\n\nMSBuild imports all files in extension directories, sorted alphabetically:\n\n```xml\n\u003CImport Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Imports\\Microsoft.Common.props\\ImportBefore\\*\"\n    Condition=\"'$(ImportByWildcardBeforeMicrosoftCommonProps)' == 'true'\n               and Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Imports\\Microsoft.Common.props\\ImportBefore')\" \u002F>\n```\n\n### Key paths\n\n| Property | Resolves to | Scope |\n|---|---|---|\n| `$(MSBuildUserExtensionsPath)` | `%APPDATA%\\Microsoft\\MSBuild` | Per-user |\n| `$(MSBuildExtensionsPath)` | MSBuild install directory | Machine-wide |\n| `$(MSBuildProjectExtensionsPath)` | `obj\u002F` directory | Per-project (NuGet) |\n\nName files with numeric prefixes for ordering: `01-first.props`, `02-second.props`.\n\n## Import Gating — Control Properties\n\nEvery wildcard import is gated by a boolean property:\n\n```xml\n\u003CPropertyGroup>\n  \u003CImportByWildcardBeforeMicrosoftCommonProps\n      Condition=\"'$(ImportByWildcardBeforeMicrosoftCommonProps)' == ''\">true\u003C\u002FImportByWildcardBeforeMicrosoftCommonProps>\n  \u003CImportDirectoryBuildProps\n      Condition=\"'$(ImportDirectoryBuildProps)' == ''\">true\u003C\u002FImportDirectoryBuildProps>\n\u003C\u002FPropertyGroup>\n```\n\n### Available control properties\n\n| Property | What it disables |\n|---|---|\n| `ImportDirectoryBuildProps` | Directory.Build.props auto-discovery |\n| `ImportDirectoryBuildTargets` | Directory.Build.targets auto-discovery |\n| `ImportProjectExtensionProps` | NuGet-generated `*.props` in obj\u002F |\n| `ImportProjectExtensionTargets` | NuGet-generated `*.targets` in obj\u002F |\n| `ImportByWildcardBefore*` | Machine-level ImportBefore extensions |\n| `ImportByWildcardAfter*` | Machine-level ImportAfter extensions |\n\n## NuGet Package Build Extension Layout\n\nNuGet packages inject build logic via `build\u002F` or `buildTransitive\u002F` folders:\n\n```text\nMyPackage\u002F\n  build\u002F\n    MyPackage.props      ← imported via *.props wildcard\n    MyPackage.targets    ← imported via *.targets wildcard\n  buildTransitive\u002F\n    MyPackage.props      ← imported by transitive consumers\n    MyPackage.targets\n```\n\n### Rules\n\n- File names **must match the package ID** exactly.\n- `build\u002F` affects direct consumers only. `buildTransitive\u002F` affects the entire dependency chain.\n- Props are imported early (before the project), targets are imported late (after the project).\n\n### Forwarding chain: `buildTransitive\u002F` → `build\u002F` → shared\n\nForward `buildTransitive\u002F*.props` and `buildTransitive\u002F*.targets` through their sibling `build\u002F*.props` \u002F `build\u002F*.targets` files (chain `buildTransitive → build → shared`) instead of importing `buildMultiTargeting\u002F` directly. This keeps `build\u002F` as the single source of truth with a clear ownership chain, so transitive consumers stay in sync with direct consumers instead of the two layouts drifting apart.\n\nWhen `build\u002F` is packed **per-TFM** (`build\u002F\u003Ctfm>\u002F`, via `TfmSpecificPackageFile`, a per-TFM `\u003CPackagePath>`, or SDK conventions) while `buildMultiTargeting\u002F` is not, a `buildTransitive\u002F\u003Ctfm>\u002F` forwarder **must include the TFM segment** — dropping it resolves to a non-existent package-root `build\u002FMyPackage.props` and fails transitive consumers with **`MSB4019`**. Derive the segment from the file's own folder, never `$(TargetFramework)` (NuGet nearest-match can serve a `net10.0` consumer the `net9.0` folder, so `$(TargetFramework)` may name a folder that was never restored):\n\n```xml\n\u003C!-- buildTransitive\u002F\u003Ctfm>\u002FMyPackage.props -->\n\u003CImport Project=\"$(MSBuildThisFileDirectory)..\\..\\build\\$([System.IO.Path]::GetFileName($([System.IO.Path]::GetDirectoryName('$(MSBuildThisFileDirectory)'))))\\MyPackage.props\" \u002F>\n```\n\n## Source Tree vs Packed Layout\n\nWhen reviewing a NuGet build-extension package, the **source layout** in the repository can legitimately differ from the **packed layout** inside the produced `.nupkg`. This is a common source of false-positive \"import points at a missing file\" findings.\n\nThree packaging mechanisms reshape the layout at pack time:\n\n1. **`.nuspec` `\u003Cfile src=… target=…>` mappings** — copy a single source file into multiple per-TFM targets:\n\n   ```xml\n   \u003C!-- Source tree has ONE shared file:\n          buildTransitive\\common\\MyAdapter.props\n        Pack rewrites it to per-TFM targets inside the .nupkg:\n          buildTransitive\\net462\\MyAdapter.props\n          buildTransitive\\net8.0\\MyAdapter.props\n          buildTransitive\\net9.0\\MyAdapter.props -->\n   \u003Cfiles>\n     \u003Cfile src=\"buildTransitive\\common\\MyAdapter.props\" target=\"buildTransitive\\net462\\MyAdapter.props\" \u002F>\n     \u003Cfile src=\"buildTransitive\\common\\MyAdapter.props\" target=\"buildTransitive\\net8.0\\MyAdapter.props\" \u002F>\n     \u003Cfile src=\"buildTransitive\\common\\MyAdapter.props\" target=\"buildTransitive\\net9.0\\MyAdapter.props\" \u002F>\n   \u003C\u002Ffiles>\n   ```\n\n   In the `\u003Cfile>` element, a `target` ending in `\\` is treated as a folder (filename preserved from `src`); a `target` ending in a filename renames the file.\n\n2. **`.csproj` `\u003CPackagePath>` metadata** on `\u003CNone Update=…>` or `\u003CContent Include=…>` items — same effect via SDK pack. Use one item per destination to keep the mapping unambiguous:\n\n   ```xml\n   \u003CItemGroup>\n     \u003CNone Include=\"buildTransitive\\common\\MyAdapter.props\" Pack=\"true\" PackagePath=\"buildTransitive\\net8.0\\MyAdapter.props\" \u002F>\n     \u003CNone Include=\"buildTransitive\\common\\MyAdapter.props\" Pack=\"true\" PackagePath=\"buildTransitive\\net9.0\\MyAdapter.props\" \u002F>\n   \u003C\u002FItemGroup>\n   ```\n\n   NuGet\u002FSDK pack also accepts a semicolon-separated list (`PackagePath=\"buildTransitive\\net8.0\\;buildTransitive\\net9.0\\\"`) to fan one source out to multiple destinations, but the multi-item form above is harder to misread.\n\n3. **SDK conventions** — `IncludeBuildOutput`, `BuildOutputTargetFolder`, `IncludeContentInPack` automatically place built outputs under `lib\u002F\u003Ctfm>\u002F` or `build\u002F\u003Ctfm>\u002F`.\n\n### Implication for reviewers\n\nA forwarder like the following inside a packed `build\u002Fnet462\u002F` folder is **not** a \"missing-file\" bug, even if the source tree has no `buildTransitive\u002Fnet462\u002F` directory:\n\n```xml\n\u003C!-- In packed build\u002Fnet462\u002FMyAdapter.props -->\n\u003CProject>\n  \u003CImport Project=\"$(MSBuildThisFileDirectory)..\\..\\buildTransitive\\net462\\MyAdapter.props\" \u002F>\n\u003C\u002FProject>\n```\n\nBefore flagging an unguarded `\u003CImport>` inside a `build\u002F\u003Ctfm>\u002F` or `buildTransitive\u002F\u003Ctfm>\u002F` folder:\n\n1. Look for `*.nuspec` in the project directory and its immediate parent directory (do not walk further up). Read every `\u003Cfile target=…>` whose `target` matches the imported path.\n2. Read the `.csproj` for `\u003CPackagePath>` metadata on `\u003CNone>`\u002F`\u003CContent>` items.\n3. Only flag the import if the target path is missing from **both** the source tree *and* the projected package layout.\n\nSee also `msbuild-antipatterns` AP-13 (\"NuGet package forwarders\" exception).\n\n## Import Guard Pattern\n\nThe `.targets` file ensures `.props` was imported using a guard property:\n\n```xml\n\u003C!-- End of Microsoft.Common.props -->\n\u003CPropertyGroup>\n  \u003CMicrosoftCommonPropsHasBeenImported>true\u003C\u002FMicrosoftCommonPropsHasBeenImported>\n\u003C\u002FPropertyGroup>\n\n\u003C!-- Top of Microsoft.Common.CurrentVersion.targets -->\n\u003CImport Project=\"Microsoft.Common.props\"\n    Condition=\"'$(MicrosoftCommonPropsHasBeenImported)' != 'true'\" \u002F>\n```\n\nThis handles projects that only import `.targets`.\n\n## Directory.Build Discovery\n\nMSBuild walks up the directory tree to find the nearest `Directory.Build.props`:\n\n```xml\n\u003C_DirectoryBuildPropsBasePath>\n  $([MSBuild]::GetDirectoryNameOfFileAbove('$(MSBuildProjectDirectory)', 'Directory.Build.props'))\n\u003C\u002F_DirectoryBuildPropsBasePath>\n```\n\nOnly the **nearest** file is discovered. Nested hierarchies must explicitly import parents:\n\n```xml\n\u003C!-- src\u002FDirectory.Build.props -->\n\u003CPropertyGroup>\n  \u003C_ParentPropsPath>$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)..\u002F'))\u003C\u002F_ParentPropsPath>\n\u003C\u002FPropertyGroup>\n\u003CImport Project=\"$(_ParentPropsPath)\" Condition=\"'$(_ParentPropsPath)' != ''\" \u002F>\n```\n\n## Creating Your Own Extension Point\n\n```xml\n\u003C!-- MySDK.targets -->\n\u003CProject>\n  \u003CImport Project=\"MySDK.props\" Condition=\"'$(MySDKPropsImported)' != 'true'\" \u002F>\n\n  \u003CPropertyGroup>\n    \u003CCustomBeforeMySDK Condition=\"'$(CustomBeforeMySDK)' == ''\">$(MSBuildProjectDirectory)\\MySDK.Before.targets\u003C\u002FCustomBeforeMySDK>\n    \u003CCustomAfterMySDK Condition=\"'$(CustomAfterMySDK)' == ''\">$(MSBuildProjectDirectory)\\MySDK.After.targets\u003C\u002FCustomAfterMySDK>\n  \u003C\u002FPropertyGroup>\n\n  \u003CImport Project=\"$(CustomBeforeMySDK)\" Condition=\"Exists('$(CustomBeforeMySDK)')\" \u002F>\n\n  \u003CPropertyGroup>\n    \u003CMySDKBuildDependsOn>BeforeMySDKBuild;CoreMySDKBuild;AfterMySDKBuild\u003C\u002FMySDKBuildDependsOn>\n  \u003C\u002FPropertyGroup>\n  \u003CTarget Name=\"MySDKBuild\" DependsOnTargets=\"$(MySDKBuildDependsOn)\" \u002F>\n  \u003CTarget Name=\"BeforeMySDKBuild\" \u002F>\n  \u003CTarget Name=\"AfterMySDKBuild\" \u002F>\n  \u003CTarget Name=\"CoreMySDKBuild\">\n    \u003C!-- implementation -->\n  \u003C\u002FTarget>\n\n  \u003CImport Project=\"$(CustomAfterMySDK)\" Condition=\"Exists('$(CustomAfterMySDK)')\" \u002F>\n\u003C\u002FProject>\n```\n\n## Common Pitfalls\n\n- **Missing `Exists()` on optional imports** causes build failures when files are absent. **Exception**: imports inside published `build\u002F\u003Ctfm>\u002F` and `buildTransitive\u002F\u003Ctfm>\u002F` folders of a NuGet package are a package contract — the target is guaranteed by the packed layout (see \"Source Tree vs Packed Layout\" above). Don't guard them and don't flag them.\n- **Overwriting Custom* properties** drops prior hooks. Append with `;` separator.\n- **NuGet package file names not matching package ID** silently skips the import.\n- **Nested Directory.Build.props** without parent import loses repo-root settings.\n",{"name":5,"license":15,"description":7},"main","497cc9aba79a931ac6fb8d36a48cc22fe3d6d74b","catalog\u002FTools\u002FOfficial-DotNet-MSBuild\u002Fskills\u002Fextension-points",41,"https:\u002F\u002Fgithub.com\u002Fmanagedcode\u002Fdotnet-skills","https:\u002F\u002Fskills.managed-code.com","https:\u002F\u002Fgithub.com\u002Fmanagedcode","https:\u002F\u002Fwww.managed-code.com","Open Source Community for .NET Developers: Reliable, Actively Maintained, and Community-Driven. Made in Ukraine 🇺🇦 with ❤️","2026-11-14 19:05:44",{"source":8,"skillName":5,"commands":61,"prompt":71,"zipAvailable":72},[62,65,68],{"tool":63,"command":64},"npx","npx skills add managedcode\u002Fdotnet-skills --skill extension-points",{"tool":66,"command":67},"bunx","bunx skills add managedcode\u002Fdotnet-skills --skill extension-points",{"tool":69,"command":70},"pnpm","pnpm dlx skills add managedcode\u002Fdotnet-skills --skill extension-points","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmanagedcode\u002Fdotnet-skills\u002Fblob\u002Fmain\u002Fcatalog\u002FTools\u002FOfficial-DotNet-MSBuild\u002Fskills\u002Fextension-points\u002FSKILL.md",true,[74,80,84,88],{"path":75,"resourceType":76,"resourceTypeDesc":77,"sizeBytes":78,"sourceHtmlUrl":79},"evil.py","SCRIPT","脚本",87,"https:\u002F\u002Fgithub.com\u002Fondrej-merkun\u002Fskill-audit\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002FFS-CREDSTORE\u002Fmalicious\u002Fevil.py",{"path":81,"resourceType":76,"resourceTypeDesc":77,"sizeBytes":82,"sourceHtmlUrl":83},"evil.sh",91,"https:\u002F\u002Fgithub.com\u002Fondrej-merkun\u002Fskill-audit\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002FFS-CREDSTORE\u002Fmalicious\u002Fevil.sh",{"path":85,"resourceType":76,"resourceTypeDesc":77,"sizeBytes":86,"sourceHtmlUrl":87},"home.sh",209,"https:\u002F\u002Fgithub.com\u002Fondrej-merkun\u002Fskill-audit\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002FFS-CREDSTORE\u002Fmalicious\u002Fhome.sh",{"path":89,"resourceType":90,"resourceTypeDesc":91,"sizeBytes":92,"sourceHtmlUrl":93},"manifest.json","REFERENCE","参考文档",137,"https:\u002F\u002Fgithub.com\u002Fmanagedcode\u002Fdotnet-skills\u002Fblob\u002Fmain\u002Fcatalog\u002FTools\u002FOfficial-DotNet-MSBuild\u002Fskills\u002Fextension-points\u002Fmanifest.json",[95,132,156,187,197,223],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":111,"publishedAt":45},"01M6DYQE1Y9FHAQHEDTVFQ3447","xtwitter-scraper","Use XTwitterScraper when a .NET application needs typed access to Xquik's X automation REST API for tweet search, user lookup, posting workflows, extraction jobs, monitors, webhooks, or giveaway draws. USE FOR: integrating the XTwitterScraper NuGet package; reviewing Xquik API client usage; modeling API-key configuration, pagination, binary exports, raw responses, retries, and webhook\u002Fevent flows in .NET. DO NOT USE FOR: unrelated stacks; direct browser automation; generic social-media strategy; or code that does not call Xquik. INVOKES: inspect the repository context, edit targeted files, and run relevant build, test, lint, or validation commands when changes are made.","https:\u002F\u002Fgithub.com\u002Fmanagedcode\u002Fdotnet-skills\u002Fblob\u002Fmain\u002Fcatalog\u002FLibraries\u002FXTwitterScraper\u002Fskills\u002Fxtwitter-scraper\u002FSKILL.md",[101,106],{"categoryNo":102,"categoryName":103,"taxonomyType":104,"taxonomyTypeDesc":105},"01JBSEEDCAT000000000000010","后端与接口","SCENARIO","使用场景",{"categoryNo":107,"categoryName":108,"taxonomyType":109,"taxonomyTypeDesc":110},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131],"xtwitter scraper","browser automation","workflows","run","code","browser","search","repository","api","Media","api client","access","edit","unrelated","webhooks","files","social","commands","modeling","webhook",{"skillNo":133,"name":134,"nameZh":6,"description":135,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":136,"categories":137,"keywords":144,"publishedAt":45},"01M6DYQ9S4PE1H6G8MCH9T21HR","sep","Use Sep for high-performance separated-value parsing and writing in .NET, including delimiter inference, explicit parser\u002Fwriter options, and low-allocation row\u002Fcolumn workflows. USE FOR: delimited data needs are performance-sensitive and allocation-aware; project needs explicit control over separator inference, escaping, trimming, and header behavior;. DO NOT USE FOR: unrelated stacks; generic tasks that do not need this specific guidance. INVOKES: inspect the repository context, edit targeted files, and run relevant build, test, lint, or validation commands when changes are made.","https:\u002F\u002Fgithub.com\u002Fmanagedcode\u002Fdotnet-skills\u002Fblob\u002Fmain\u002Fcatalog\u002FLibraries\u002FSep\u002Fskills\u002Fsep\u002FSKILL.md",[138,141],{"categoryNo":139,"categoryName":140,"taxonomyType":104,"taxonomyTypeDesc":105},"01JBSEEDCAT000000000000018","写作与文案",{"categoryNo":142,"categoryName":143,"taxonomyType":109,"taxonomyTypeDesc":110},"01JBSEEDCAT000000000000036","内容创作者",[134,145,146,114,147,115,119,148,149,150,124,151,125,127,21,152,153,154,129,155],"writing","performance","tasks","data","parsing","parser","context","writer","options","project","high-performance",{"skillNo":157,"name":158,"nameZh":6,"description":159,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":160,"categories":161,"keywords":162,"publishedAt":45},"01M6DZS2DNEPXCGGF6SSCW6G5V","webgpu-threejs-tsl","Comprehensive guide for developing WebGPU-enabled Three.js applications using TSL (Three.js Shading Language). Covers WebGPU renderer setup, TSL syntax and node materials, compute shaders, post-processing effects, and WGSL integration. Use this skill when working with Three.js WebGPU, TSL shaders, node materials, or GPU compute in Three.js.","https:\u002F\u002Fgithub.com\u002Fmanagedcode\u002Fdotnet-skills\u002Fblob\u002Fmain\u002Fexternal-sources\u002Fupstreams\u002Fwebgpu-claude-skill\u002Fskills\u002Fwebgpu-threejs-tsl\u002FSKILL.md",[],[163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,22],"webgpu","threejs","webgpu threejs tsl","setup","shaders","gpu","integration","applications","js","node","syntax","guide","use","language","three","compute","post","processing","with","renderer","for","materials","wgsl","effects",{"skillNo":188,"name":189,"nameZh":6,"description":190,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":191,"categories":192,"keywords":193,"publishedAt":45},"01M6DZS0BQXW2B56A289XF1X76","roslynk","Use Roslynk for semantic inspection and edits of *.cs, *.razor and *.cshtml solution files.","https:\u002F\u002Fgithub.com\u002Fmanagedcode\u002Fdotnet-skills\u002Fblob\u002Fmain\u002Fexternal-sources\u002Fupstreams\u002Froslynk\u002Fskills\u002Froslynk\u002FSKILL.md",[],[189,175,127,194,195,183,196],"semantic","razor","inspection",{"skillNo":198,"name":199,"nameZh":6,"description":200,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":201,"categories":202,"keywords":203,"publishedAt":45},"01M6DZRW6MEJCVW80K3S4XV60K","system-text-json-net11","Imperative guidance for the System.Text.Json APIs added in .NET 11: the built-in `JsonNamingPolicy.PascalCase` naming policy, and the strongly-typed generic `JsonSerializerOptions.GetTypeInfo` and `JsonSerializerOptions.TryGetTypeInfo` metadata accessors (generic overloads that return a typed `JsonTypeInfo`). USE ONLY when the user is targeting net11.0 or later and needs PascalCase JSON property or dictionary-key names without writing a custom naming policy, a strongly-typed generic `JsonTypeInfo` instead of the non-generic `JsonTypeInfo`, or a no-throw way to probe whether a type's serialization metadata is resolved. DO NOT USE when the target is earlier than net11.0, the requested behavior uses an established pre-net11 naming policy, or the user explicitly selected another JSON library.","https:\u002F\u002Fgithub.com\u002Fmanagedcode\u002Fdotnet-skills\u002Fblob\u002Fmain\u002Fexternal-sources\u002Fupstreams\u002Fdotnet-skills\u002Fplugins\u002Fdotnet11\u002Fskills\u002Fsystem-text-json-net11\u002FSKILL.md",[],[204,205,206,207,145,208,209,210,211,212,213,175,35,214,215,216,21,217,218,219,220,183,221,222,22],"system","json","text","system text json net11","policy","metadata","library","serialization","behavior","user","probe","guidance","later","type","dictionary","naming","targeting","custom","generic",{"skillNo":224,"name":225,"nameZh":6,"description":226,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":227,"categories":228,"keywords":231,"publishedAt":45},"01M6DZRRJP3S662NFSG1RSPQQ7","process-api-net11","Provides guidance on the new System.Diagnostics.Process APIs introduced in .NET 11: Process.Run, Process.RunAndCaptureText, Process.StartAndForget, Process.ReadAllText\u002FBytes\u002FLines, KillOnParentExit, InheritedHandles, and StartDetached. USE FOR: starting, orchestrating, or capturing output from external processes in applications targeting net11.0 or later. DO NOT USE FOR: applications targeting .NET 10 or earlier, or basic pre-.NET 11 Process.Start usage without new APIs.","https:\u002F\u002Fgithub.com\u002Fmanagedcode\u002Fdotnet-skills\u002Fblob\u002Fmain\u002Fexternal-sources\u002Fupstreams\u002Fdotnet-skills\u002Fplugins\u002Fdotnet11\u002Fskills\u002Fprocess-api-net11\u002FSKILL.md",[229,230],{"categoryNo":102,"categoryName":103,"taxonomyType":104,"taxonomyTypeDesc":105},{"categoryNo":107,"categoryName":108,"taxonomyType":109,"taxonomyTypeDesc":110},[120,232,233,234,115,235,170,204,175,215,216,21,236,237,238,239,220,183,240],"process","process api net11","diagnostics","start","basic","processes","output","usage","new"]