[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7D0DR92NKMCB2DED1HB69KT":3,"skill-same:01M7D0DR92NKMCB2DED1HB69KT":44},{"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":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M7D0DR92NKMCB2DED1HB69KT","extension-points",null,"Guide for MSBuild extensibility: CustomBefore\u002FCustomAfter hooks, wildcard imports with alphabetic ordering, import gating with control properties, NuGet package build extension layout (build\u002FbuildTransitive), and the MicrosoftCommonPropsHasBeenImported guard. USE FOR: diagnosing and fixing MSBuild import and hook patterns, reviewing and fixing extension point anti-patterns in Directory.Build files, fixing missing Exists() guards on imports that break fresh clones, fixing NuGet package hooks being silently dropped instead of appended, making build targets extensible for other projects, injecting custom logic into the build pipeline, creating NuGet packages that extend the build, conditionally disabling imports. DO NOT USE FOR: target authoring patterns (use target-authoring), props vs targets placement (use directory-build-organization), general anti-patterns (use msbuild-antipatterns), non-MSBuild build systems.","itsmejay18\u002FAI-Skills-for-My-Development-Stack","itsmejay18","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F167779943?v=4","01M7CZRFC6DDZA5V2CX8WDSZED","Jay Jemino Ababon ","01M7CZRFCVRNW1SFHSQXEJ3CQN",0,"MIT","https:\u002F\u002Fgithub.com\u002Fitsmejay18\u002FAI-Skills-for-My-Development-Stack\u002Fblob\u002Fmain\u002F02-CSharp-WPF-Desktop-Development\u002Fextension-points\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: extension-points\ndescription: \"Guide for MSBuild extensibility: CustomBefore\u002FCustomAfter hooks, wildcard imports with alphabetic ordering, import gating with control properties, NuGet package build extension layout (build\u002FbuildTransitive), and the MicrosoftCommonPropsHasBeenImported guard. USE FOR: diagnosing and fixing MSBuild import and hook patterns, reviewing and fixing extension point anti-patterns in Directory.Build files, fixing missing Exists() guards on imports that break fresh clones, fixing NuGet package hooks being silently dropped instead of appended, making build targets extensible for other projects, injecting custom logic into the build pipeline, creating NuGet packages that extend the build, conditionally disabling imports. DO NOT USE FOR: target authoring patterns (use target-authoring), props vs targets placement (use directory-build-organization), general anti-patterns (use msbuild-antipatterns), non-MSBuild build 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","30954af1dcd1a74b63f05deb2e2c41e5ecae4a82","02-CSharp-WPF-Desktop-Development\u002Fextension-points","https:\u002F\u002Fgithub.com\u002Fitsmejay18\u002FAI-Skills-for-My-Development-Stack","https:\u002F\u002Fgithub.com\u002Fitsmejay18","2026-09-18 16:06:36",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add itsmejay18\u002FAI-Skills-for-My-Development-Stack --skill extension-points",{"tool":36,"command":37},"bunx","bunx skills add itsmejay18\u002FAI-Skills-for-My-Development-Stack --skill extension-points",{"tool":39,"command":40},"pnpm","pnpm dlx skills add itsmejay18\u002FAI-Skills-for-My-Development-Stack --skill extension-points","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fitsmejay18\u002FAI-Skills-for-My-Development-Stack\u002Fblob\u002Fmain\u002F02-CSharp-WPF-Desktop-Development\u002Fextension-points\u002FSKILL.md",true,[],[45,52,59,66,73,80],{"skillNo":46,"name":47,"nameZh":6,"description":48,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":49,"categories":50,"keywords":51,"publishedAt":19},"01M7D2RKBHPZ3E1RNN5DWHT550","vectorization","Design, implement, optimize, and review SIMD code in .NET. USE FOR: vectorizing scalar loops with TensorPrimitives, Vector64\u002F128\u002F256\u002F512, or platform hardware intrinsics; reviewing existing SIMD code, including Vector\u003CT>, for contract equivalence, tail handling, memory safety, portability, fallbacks, and measured performance. DO NOT USE FOR: performance work unrelated to SIMD or vectorization.","https:\u002F\u002Fgithub.com\u002Fitsmejay18\u002FAI-Skills-for-My-Development-Stack\u002Fblob\u002Fmain\u002F20-Performance-Optimization\u002Fvectorization\u002FSKILL.md",[],[],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":19},"01M7D2RDJ7RN3QK8GJR0QTER1D","resolve-project-references","Guide for interpreting ResolveProjectReferences time in MSBuild performance summaries. Activate when ResolveProjectReferences appears as the most expensive target and developers are trying to optimize it directly. Explains that the reported time includes wait time for dependent project builds and is misleading. Guides users to focus on task self-time instead. Do not activate for general build performance -- use build-perf-diagnostics instead.","https:\u002F\u002Fgithub.com\u002Fitsmejay18\u002FAI-Skills-for-My-Development-Stack\u002Fblob\u002Fmain\u002F20-Performance-Optimization\u002Fresolve-project-references\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M7D2R1H2GTNZYHG9YRX3JDQW","optimizing-ef-core-queries","Optimize and improve the performance of slow Entity Framework Core (EF Core) queries: make them generate less SQL, make fewer database round-trips, and return results faster. Use whenever an EF Core or DbContext query or data-access path is slow or should be made faster — whether or not EF Core owns the database schema. For EF Core, not Dapper or raw ADO.NET.","https:\u002F\u002Fgithub.com\u002Fitsmejay18\u002FAI-Skills-for-My-Development-Stack\u002Fblob\u002Fmain\u002F20-Performance-Optimization\u002Foptimizing-ef-core-queries\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M7D2QREG04W1YT0NEBHEW5C9","microbenchmarking","Activate this skill when BenchmarkDotNet (BDN) is involved in the task — creating, running, configuring, or reviewing BDN benchmarks. Also activate when microbenchmarking .NET code would be useful and BenchmarkDotNet is the likely tool. Consider activating when answering a .NET performance question requires measurement and BenchmarkDotNet may be needed. Covers microbenchmark design, BDN configuration and project setup, how to run BDN microbenchmarks efficiently and effectively, and using BDN for side-by-side performance comparisons. Do NOT use for profiling\u002Ftracing .NET code (dotnet-trace, PerfView), production telemetry, or load\u002Fstress testing (Crank, k6).","https:\u002F\u002Fgithub.com\u002Fitsmejay18\u002FAI-Skills-for-My-Development-Stack\u002Fblob\u002Fmain\u002F20-Performance-Optimization\u002Fmicrobenchmarking\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M7D2QGE175XWPZVACVH2868Z","incremental-build","Guide for optimizing MSBuild incremental builds. USE FOR: builds slower than expected on subsequent runs, 'nothing changed but it rebuilds anyway', diagnosing why targets re-execute unnecessarily, fixing broken no-op builds. Covers 8 common causes: missing Inputs\u002FOutputs on custom targets, volatile properties in output paths (timestamps\u002FGUIDs), file writes outside tracked Outputs, missing FileWrites registration, glob changes, Visual Studio Fast Up-to-Date Check (FUTDC) issues. Key diagnostic: look for 'Building target completely' vs 'Skipping target' in binlog. DO NOT USE FOR: first-time build slowness (use build-perf-baseline), parallelism issues (use build-parallelism), evaluation-phase slowness (use eval-performance), non-MSBuild build systems.","https:\u002F\u002Fgithub.com\u002Fitsmejay18\u002FAI-Skills-for-My-Development-Stack\u002Fblob\u002Fmain\u002F20-Performance-Optimization\u002Fincremental-build\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M7D2Q1DQTC6K49R73WQTTPSB","eval-performance","Guide for diagnosing and improving MSBuild project evaluation performance. USE FOR: builds slow before any compilation starts, high evaluation time in binlog analysis, expensive glob patterns walking large directories (node_modules, .git, bin\u002Fobj), deep import chains (>20 levels), preprocessed output >10K lines indicating heavy evaluation, property functions with file I\u002FO ($([System.IO.File]::ReadAllText(...))), multiple evaluations per project. Covers the 5 MSBuild evaluation phases, glob optimization via DefaultItemExcludes, import chain analysis with \u002Fpp preprocessing. DO NOT USE FOR: compilation-time slowness (use build-perf-diagnostics), incremental build issues (use incremental-build), non-MSBuild build systems.","https:\u002F\u002Fgithub.com\u002Fitsmejay18\u002FAI-Skills-for-My-Development-Stack\u002Fblob\u002Fmain\u002F20-Performance-Optimization\u002Feval-performance\u002FSKILL.md",[],[]]