From 0072951c65907ff161b55ab0ca27717a34cf883b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 18 May 2026 18:27:17 +0000 Subject: [PATCH 1/3] Initial plan From 36874c065a25b18a41409001e30dae475b6b4ace Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 18 May 2026 18:39:29 +0000 Subject: [PATCH 2/3] Add type forwarders for relocated communication and XMake types Agent-Logs-Url: https://github.com/dotnet/msbuild/sessions/f3218ee8-4a20-4398-bd9c-47583a627d43 Co-authored-by: baronfel <573979+baronfel@users.noreply.github.com> --- .../BackEnd/TypeForwarding_Tests.cs | 38 +++++++++++++++++++ src/Build/AssemblyInfo.cs | 11 ++++++ 2 files changed, 49 insertions(+) create mode 100644 src/Build.UnitTests/BackEnd/TypeForwarding_Tests.cs diff --git a/src/Build.UnitTests/BackEnd/TypeForwarding_Tests.cs b/src/Build.UnitTests/BackEnd/TypeForwarding_Tests.cs new file mode 100644 index 00000000000..d4f4ee2fa6a --- /dev/null +++ b/src/Build.UnitTests/BackEnd/TypeForwarding_Tests.cs @@ -0,0 +1,38 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using Microsoft.Build.Execution; +using Shouldly; +using Xunit; + +namespace Microsoft.Build.Engine.UnitTests.BackEnd +{ + public class TypeForwarding_Tests + { + private static readonly HashSet s_forwardedTypeNames = typeof(BuildManager).Assembly + .GetForwardedTypes() + .Select(type => type.FullName!) + .ToHashSet(StringComparer.Ordinal); + + [Theory] + [InlineData("Microsoft.Build.Internal.Handshake")] + [InlineData("Microsoft.Build.Internal.HandshakeComponents")] + [InlineData("Microsoft.Build.Internal.HandshakeOptions")] + [InlineData("Microsoft.Build.Internal.HandshakeStatus")] + [InlineData("Microsoft.Build.Internal.ServerNodeHandshake")] + [InlineData("Microsoft.Build.BackEnd.INodePacket")] + [InlineData("Microsoft.Build.BackEnd.NodePacketType")] + [InlineData("Microsoft.Build.BackEnd.NodePacketTypeExtensions")] + [InlineData("Microsoft.Build.Internal.CommunicationsUtilities")] + [InlineData("Microsoft.Build.Shared.XMakeAttributes")] + [InlineData("Microsoft.Build.Shared.XMakeElements")] + public void BuildAssemblyContainsExpectedTypeForwarders(string typeName) + { + s_forwardedTypeNames.ShouldContain(typeName); + } + } +} diff --git a/src/Build/AssemblyInfo.cs b/src/Build/AssemblyInfo.cs index e273b398f06..7d15bd05726 100644 --- a/src/Build/AssemblyInfo.cs +++ b/src/Build/AssemblyInfo.cs @@ -41,3 +41,14 @@ [assembly: Dependency("BuildXL.Processes", LoadHint.Sometimes)] [assembly: TypeForwardedTo(typeof(Microsoft.Build.Execution.BuildRequestDataFlags))] +[assembly: TypeForwardedTo(typeof(Microsoft.Build.Internal.Handshake))] +[assembly: TypeForwardedTo(typeof(Microsoft.Build.Internal.HandshakeComponents))] +[assembly: TypeForwardedTo(typeof(Microsoft.Build.Internal.HandshakeOptions))] +[assembly: TypeForwardedTo(typeof(Microsoft.Build.Internal.HandshakeStatus))] +[assembly: TypeForwardedTo(typeof(Microsoft.Build.Internal.ServerNodeHandshake))] +[assembly: TypeForwardedTo(typeof(Microsoft.Build.BackEnd.INodePacket))] +[assembly: TypeForwardedTo(typeof(Microsoft.Build.BackEnd.NodePacketType))] +[assembly: TypeForwardedTo(typeof(Microsoft.Build.BackEnd.NodePacketTypeExtensions))] +[assembly: TypeForwardedTo(typeof(Microsoft.Build.Internal.CommunicationsUtilities))] +[assembly: TypeForwardedTo(typeof(Microsoft.Build.Shared.XMakeAttributes))] +[assembly: TypeForwardedTo(typeof(Microsoft.Build.Shared.XMakeElements))] From f33c57fd9dfb8abd039cbfd4478559d96df59278 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 18 May 2026 18:40:40 +0000 Subject: [PATCH 3/3] Refine type-forwarder test initialization Agent-Logs-Url: https://github.com/dotnet/msbuild/sessions/f3218ee8-4a20-4398-bd9c-47583a627d43 Co-authored-by: baronfel <573979+baronfel@users.noreply.github.com> --- src/Build.UnitTests/BackEnd/TypeForwarding_Tests.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Build.UnitTests/BackEnd/TypeForwarding_Tests.cs b/src/Build.UnitTests/BackEnd/TypeForwarding_Tests.cs index d4f4ee2fa6a..88a83589b3d 100644 --- a/src/Build.UnitTests/BackEnd/TypeForwarding_Tests.cs +++ b/src/Build.UnitTests/BackEnd/TypeForwarding_Tests.cs @@ -13,11 +13,6 @@ namespace Microsoft.Build.Engine.UnitTests.BackEnd { public class TypeForwarding_Tests { - private static readonly HashSet s_forwardedTypeNames = typeof(BuildManager).Assembly - .GetForwardedTypes() - .Select(type => type.FullName!) - .ToHashSet(StringComparer.Ordinal); - [Theory] [InlineData("Microsoft.Build.Internal.Handshake")] [InlineData("Microsoft.Build.Internal.HandshakeComponents")] @@ -32,7 +27,13 @@ public class TypeForwarding_Tests [InlineData("Microsoft.Build.Shared.XMakeElements")] public void BuildAssemblyContainsExpectedTypeForwarders(string typeName) { - s_forwardedTypeNames.ShouldContain(typeName); + GetForwardedTypeNames().ShouldContain(typeName); } + + private static HashSet GetForwardedTypeNames() + => typeof(BuildManager).Assembly + .GetForwardedTypes() + .Select(type => type.FullName!) + .ToHashSet(StringComparer.Ordinal); } }