Skip to content

Commit 8d4990d

Browse files
danmoseleyCopilot
andcommitted
Skip PNSE doc-source P2P when local targeting pack is unavailable
When UseCompilerGeneratedDocXmlFile is true (the default) and a library is a PNSE assembly, intellisense.targets adds a self-referencing ProjectReference with SetTargetFramework=net11.0 to pull enriched XML docs from the non-PNSE sibling build. In the NET481 build leg the local targeting pack (FrameworkList.xml) is never produced, so the inner net11.0 build fails with: The shared framework must be built before the local targeting pack can be consumed. Guard the AddProjectReferenceToPNSEDocSource target with an Exists check on the same FrameworkList.xml sentinel that targetingpacks.targets already uses. When the file is absent the target is skipped and the PNSE assembly builds without doc enrichment, which is the expected behavior for partial-build configurations like the NET481 leg. Fixes #127007 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 81d6754 commit 8d4990d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

eng/intellisense.targets

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,14 @@
122122
</PropertyGroup>
123123
</Target>
124124

125+
<!-- Skip the PNSE doc-source self-reference when the local NetCoreApp ref pack hasn't been built
126+
(e.g. in NET481-only legs); doc enrichment from the sibling TFM is optional in that case. -->
125127
<Target Name="AddProjectReferenceToPNSEDocSource"
126128
DependsOnTargets="GetPNSEDocTargetFramework"
127129
BeforeTargets="PrepareForBuild"
128130
Condition="'$(IsPlatformNotSupportedAssembly)' == 'true' and
129-
'$(UseCompilerGeneratedDocXmlFile)' == 'true'">
131+
'$(UseCompilerGeneratedDocXmlFile)' == 'true' and
132+
Exists('$(MicrosoftNetCoreAppRefPackDataDir)FrameworkList.xml')">
130133

131134
<Error Condition="'$(PNSEDocTargetFramework)' == ''"
132135
Text="Could not find a compatible TargetFramework to use as the documentation source for this PNSE build. Set 'PNSEDocTargetFramework' to the desired target framework." />

0 commit comments

Comments
 (0)