From 8d4990d9f140fd5381443511a820b6e1f2a15dd2 Mon Sep 17 00:00:00 2001 From: Dan Moseley Date: Mon, 20 Apr 2026 21:10:13 -0600 Subject: [PATCH 1/6] 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> --- eng/intellisense.targets | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/eng/intellisense.targets b/eng/intellisense.targets index 9bb4a5387df06c..e97f673002d830 100644 --- a/eng/intellisense.targets +++ b/eng/intellisense.targets @@ -122,11 +122,14 @@ + + '$(UseCompilerGeneratedDocXmlFile)' == 'true' and + Exists('$(MicrosoftNetCoreAppRefPackDataDir)FrameworkList.xml')"> From 98b2a6cec9ba569a0c7f4ec519cfb965b6ba3d58 Mon Sep 17 00:00:00 2001 From: Dan Moseley Date: Mon, 20 Apr 2026 21:16:41 -0600 Subject: [PATCH 2/6] Also check bootstrap ref-pack location for FrameworkList.xml Address review feedback: when UseBootstrapLayout is true, the local targeting pack lives at BootstrapRefPackDir rather than MicrosoftNetCoreAppRefPackDir. Check both locations so the PNSE doc-source target fires correctly in bootstrap-layout builds. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/intellisense.targets | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/eng/intellisense.targets b/eng/intellisense.targets index e97f673002d830..1a679d15a3bb67 100644 --- a/eng/intellisense.targets +++ b/eng/intellisense.targets @@ -123,13 +123,16 @@ + (e.g. in NET481-only legs); doc enrichment from the sibling TFM is optional in that case. + Mirror the FrameworkList.xml sentinel from eng/targetingpacks.targets, checking both the + normal ref-pack location and the bootstrap layout location. --> + (Exists('$(MicrosoftNetCoreAppRefPackDataDir)FrameworkList.xml') or + ('$(UseBootstrapLayout)' == 'true' and Exists('$(BootstrapRefPackDir)\data\FrameworkList.xml')))"> From 5f85f6118e0acad650d07d846ae6c2bdc85a998d Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Tue, 21 Apr 2026 10:27:02 -0700 Subject: [PATCH 3/6] Apply suggestions from code review Co-authored-by: Eric StJohn --- eng/intellisense.targets | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/eng/intellisense.targets b/eng/intellisense.targets index 1a679d15a3bb67..1de45098a8fa0a 100644 --- a/eng/intellisense.targets +++ b/eng/intellisense.targets @@ -122,17 +122,13 @@ - + + ('$(BuildTargetFramework)' == '' or '$(TargetFrameworkIdentifier)' == '.NETCoreApp')"> From fce9c80452a85d10b0d70929225bb537692742a5 Mon Sep 17 00:00:00 2001 From: "Eric St. John" Date: Tue, 21 Apr 2026 11:50:32 -0700 Subject: [PATCH 4/6] Don't undefine BuildTargetFramework BuildTargetFramework is only ever read when filtering in outer builds and traversal projects, so it should have no impact on inner builds. Undefining global properties can be dangerous since it can result in breaking MSBuild's build cache. It's safer to leave properties alone don't pass new global properties, or undefine them. BuildTargetFramework should be set as global from the build entrypoint - leave it set throughout the build. In this case I need BuildTargetFramework to that I can see in an inner build that a project is building as part of a vertical and should not attempt to build a configuration that's not part of that vertical. --- eng/TraversalSdk.AfterTargets.targets | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/eng/TraversalSdk.AfterTargets.targets b/eng/TraversalSdk.AfterTargets.targets index 7ae0b789b9b5c7..34df3765df95d9 100644 --- a/eng/TraversalSdk.AfterTargets.targets +++ b/eng/TraversalSdk.AfterTargets.targets @@ -19,11 +19,9 @@ - + + SkipGetTargetFrameworkProperties="false" /> From 6b04c4c288606a6cce1397a94af5cb5ed6450be0 Mon Sep 17 00:00:00 2001 From: "Eric St. John" Date: Tue, 21 Apr 2026 11:51:06 -0700 Subject: [PATCH 5/6] Fix break in ErrObjectTests on netfx Introduced when build was broken. --- .../Microsoft.VisualBasic.Core/tests/ErrObjectTests.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libraries/Microsoft.VisualBasic.Core/tests/ErrObjectTests.cs b/src/libraries/Microsoft.VisualBasic.Core/tests/ErrObjectTests.cs index 3a7ae775ea5620..ead0e3a031148a 100644 --- a/src/libraries/Microsoft.VisualBasic.Core/tests/ErrObjectTests.cs +++ b/src/libraries/Microsoft.VisualBasic.Core/tests/ErrObjectTests.cs @@ -28,7 +28,9 @@ public void Clear() Assert.Equal(0, errObj.HelpContext); Assert.Equal("", errObj.HelpFile); Assert.Equal("", errObj.Source); +#if NET Marshal.SetLastPInvokeError(42); +#endif Assert.Equal(42, errObj.LastDllError); Assert.Equal(0, errObj.Number); Assert.Equal("", errObj.Description); From b66396e382c1fa5cf330895abbb104a7ffc88269 Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Tue, 21 Apr 2026 11:59:04 -0700 Subject: [PATCH 6/6] Apply suggestion from @jkotas --- .../Microsoft.VisualBasic.Core/tests/ErrObjectTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/Microsoft.VisualBasic.Core/tests/ErrObjectTests.cs b/src/libraries/Microsoft.VisualBasic.Core/tests/ErrObjectTests.cs index ead0e3a031148a..d04cfa38c504ca 100644 --- a/src/libraries/Microsoft.VisualBasic.Core/tests/ErrObjectTests.cs +++ b/src/libraries/Microsoft.VisualBasic.Core/tests/ErrObjectTests.cs @@ -30,8 +30,8 @@ public void Clear() Assert.Equal("", errObj.Source); #if NET Marshal.SetLastPInvokeError(42); -#endif Assert.Equal(42, errObj.LastDllError); +#endif Assert.Equal(0, errObj.Number); Assert.Equal("", errObj.Description); Assert.Null(errObj.GetException());