Repository navigation
Remove MSBuildImportedProject item from the XSD - #14659
ViktorHofer merged 2 commits into
Conversation
The MSBuildImportedProject item is synthesized by the engine solely for tooling to consume; it is never authored by users. Listing it in the schema surfaces it as an authorable item in IntelliSense, which is misleading. Remove the item element while keeping the MSBuildProvideImportedProjects property, matching the approach taken for MSBuildItemGlob in dotnet#14389. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f3ee76d3-fd79-448e-b0db-862dc5b46c3a
There was a problem hiding this comment.
Pull request overview
This PR updates the MSBuild IntelliSense schema (Microsoft.Build.CommonTypes.xsd) to stop advertising the synthesized MSBuildImportedProject item type as authorable XML, aligning it with the prior decision to omit the similarly synthesized MSBuildItemGlob item from the XSD.
Changes:
- Removed the
MSBuildImportedProject<xs:element>from the XSD so it no longer appears as an authorable item in IntelliSense. - Kept the
MSBuildProvideImportedProjectsproperty in the XSD (still user-settable and useful for discovery).
There was a problem hiding this comment.
MSBuild Expert Review
✅ 22/24 dimensions clean.
This is a well-targeted, focused change that removes the MSBuildImportedProject item element from the XSD schema, consistent with the approach taken for MSBuildItemGlob in #14389.
| # | Dimension | Verdict |
|---|---|---|
| 4 | Test Coverage | 🟡 1 NIT |
| 18 | Documentation Accuracy | 🟡 1 NIT |
✅ 22/24 dimensions clean.
Findings
[NIT] Test Coverage — There is no test asserting that MSBuildImportedProject is absent from the XSD file. The existing tests in ProjectInstance_ImportedProjectItems_Tests.cs verify the engine synthesizes the items correctly, but do not validate schema content. This is a very minor gap; schema tests are uncommon in this codebase and consistent with how MSBuildItemGlob (from #14389) was handled.
[NIT] Documentation Accuracy — documentation/Built-in-Properties.md documents MSBuildImportedProject thoroughly but does not mention that it is intentionally absent from the XSD schema (since it is engine-synthesized, not user-authored). Adding a sentence such as "Note: MSBuildImportedProject is not listed in the XSD schema because it is synthesized by the engine and not intended to be authored in project files." would make the design intent explicit for future contributors.
Summary
The change is correct, minimal, and follows established precedent. The MSBuildProvideImportedProjects property correctly remains in the XSD. No ChangeWave is needed — this is a schema/tooling change, not a behavioral engine change. No backwards compatibility concern: users cannot author MSBuildImportedProject items and the engine still synthesizes them at runtime.
- (Optional) Add note to
documentation/Built-in-Properties.mdthatMSBuildImportedProjectis excluded from XSD intentionally
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
patchdiff.githubusercontent.com
To allow these domains, add them to the network.allowed list in your workflow frontmatter:
network:
allowed:
- defaults
- "patchdiff.githubusercontent.com"See Network Configuration for more information.
Generated by Expert Code Review (on open) for #14659 · sonnet46 · 48.1 AIC · ⌖ 5.22 AIC · ⊞ 5.2K
Summary
Removes the
MSBuildImportedProjectitem element fromMicrosoft.Build.CommonTypes.xsd.MSBuildImportedProjectitems (added in #13681) are synthesized by the engine purely for tooling to consume whenMSBuildProvideImportedProjectsis set — they are never authored by users. Listing the item in the schema surfaces it in IntelliSense as though it were an authorable item, which is misleading.Context
This is a follow-on from #14389, where the equivalent synthesized
MSBuildItemGlobitem was deliberately kept out of the XSD (only the opt-inMSBuildProvideItemGlobsproperty is documented there). This change bringsMSBuildImportedProjectin line with that decision.Details
MSBuildImportedProjectitem element.MSBuildProvideImportedProjectsproperty, which is user-settable and belongs in IntelliSense (mirroring how Expose item glob patterns via MSBuildProvideItemGlobs #14389 keepsMSBuildProvideItemGlobs).