diff --git a/src/Tasks/Common/DiagnosticMessageSeverity.cs b/src/Tasks/Common/DiagnosticMessageSeverity.cs
deleted file mode 100644
index b127b4c9d591..000000000000
--- a/src/Tasks/Common/DiagnosticMessageSeverity.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-namespace Microsoft.NET.Build.Tasks
-{
- ///
- /// Specifies the severity of Diagnostic Messages
- ///
- internal enum DiagnosticMessageSeverity
- {
- Info,
- Warning,
- Error,
- }
-}
diff --git a/src/Tasks/Common/DiagnosticsHelper.cs b/src/Tasks/Common/DiagnosticsHelper.cs
deleted file mode 100644
index 58518655beeb..000000000000
--- a/src/Tasks/Common/DiagnosticsHelper.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using Microsoft.Build.Framework;
-using Microsoft.Build.Utilities;
-using System.Collections.Generic;
-
-namespace Microsoft.NET.Build.Tasks
-{
- ///
- /// Writes diagnostic messages to the task log and creates diagnostic task items
- /// that can be returned from a task
- ///
- internal sealed class DiagnosticsHelper
- {
- private readonly List _diagnosticMessages = new List();
-
- public ITaskItem[] GetDiagnosticMessages() => _diagnosticMessages.ToArray();
-
- public ITaskItem Add(
- string diagnosticCode,
- string message,
- string filePath,
- DiagnosticMessageSeverity severity,
- int startLine,
- int startColumn,
- int endLine,
- int endColumn,
- string targetFrameworkMoniker,
- string packageId)
- {
- string itemspec =
- (string.IsNullOrEmpty(targetFrameworkMoniker) ? string.Empty : $"{targetFrameworkMoniker}/") +
- (string.IsNullOrEmpty(packageId) ? string.Empty : $"{packageId}/") +
- diagnosticCode;
-
- var diagnostic = new TaskItem(itemspec, new Dictionary
- {
- { MetadataKeys.DiagnosticCode, diagnosticCode },
- { MetadataKeys.Message, message },
- { MetadataKeys.FilePath, filePath ?? string.Empty },
- { MetadataKeys.Severity, severity.ToString() },
-
- { MetadataKeys.StartLine, startLine.ToString() },
- { MetadataKeys.StartColumn, startColumn.ToString() },
- { MetadataKeys.EndLine, endLine.ToString() },
- { MetadataKeys.EndColumn, endColumn.ToString() },
-
- { MetadataKeys.ParentTarget, targetFrameworkMoniker ?? string.Empty },
- { MetadataKeys.ParentPackage, packageId ?? string.Empty },
- });
-
- _diagnosticMessages.Add(diagnostic);
-
- return diagnostic;
- }
- }
-}
diff --git a/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/GivenAResolvePackageDependenciesTask.cs b/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/GivenAResolvePackageDependenciesTask.cs
index d214c0741022..e972844b2b52 100644
--- a/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/GivenAResolvePackageDependenciesTask.cs
+++ b/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/GivenAResolvePackageDependenciesTask.cs
@@ -20,9 +20,9 @@ public class GivenAResolvePackageDependenciesTask
[Theory]
[MemberData(nameof(ItemCounts))]
- public void ItRaisesLockFileToMSBuildItems(string projectName, int [] counts)
+ public void ItRaisesLockFileToMSBuildItems(string projectName, int[] counts, bool emitLegacyAssetsFileItems)
{
- var task = GetExecutedTaskFromPrefix(projectName);
+ var task = GetExecutedTaskFromPrefix(projectName, out _, emitLegacyAssetsFileItems);
task.PackageDefinitions .Count().Should().Be(counts[0]);
task.FileDefinitions .Count().Should().Be(counts[1]);
@@ -39,22 +39,42 @@ public static IEnumerable