diff --git a/src/libraries/System.Diagnostics.EventLog/tests/EventLogMessagesTests.cs b/src/libraries/System.Diagnostics.EventLog/tests/EventLogMessagesTests.cs
index 0585a690e103ed..ad1e0492508749 100644
--- a/src/libraries/System.Diagnostics.EventLog/tests/EventLogMessagesTests.cs
+++ b/src/libraries/System.Diagnostics.EventLog/tests/EventLogMessagesTests.cs
@@ -1,6 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+using System.Diagnostics.CodeAnalysis;
using System.Diagnostics.Eventing.Reader;
using System.IO;
using System.Reflection;
@@ -12,6 +13,7 @@ namespace System.Diagnostics.Tests
public class EventLogMessagesTests
{
[Fact]
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "The test asserts the assembly contains no types; trimming cannot make an empty assembly emptier.")]
public void EventLogMessagesContainsNoTypes()
{
Assembly messageAssembly = Assembly.Load("System.Diagnostics.EventLog.Messages");
diff --git a/src/libraries/System.Diagnostics.EventLog/tests/System.Diagnostics.EventLog.Tests.csproj b/src/libraries/System.Diagnostics.EventLog/tests/System.Diagnostics.EventLog.Tests.csproj
index d053b119d0e1f1..66b09a1a8ff65e 100644
--- a/src/libraries/System.Diagnostics.EventLog/tests/System.Diagnostics.EventLog.Tests.csproj
+++ b/src/libraries/System.Diagnostics.EventLog/tests/System.Diagnostics.EventLog.Tests.csproj
@@ -2,8 +2,6 @@
$(NetCoreAppCurrent)-windows;$(NetFrameworkCurrent)true
-
- false
diff --git a/src/libraries/System.Formats.Tar/tests/System.Formats.Tar.Tests.csproj b/src/libraries/System.Formats.Tar/tests/System.Formats.Tar.Tests.csproj
index 8c226e1a9895b0..edffca2836d086 100644
--- a/src/libraries/System.Formats.Tar/tests/System.Formats.Tar.Tests.csproj
+++ b/src/libraries/System.Formats.Tar/tests/System.Formats.Tar.Tests.csproj
@@ -4,8 +4,6 @@
true$(MSBuildProjectDirectory)\..\src\Resources\Strings.resxtrue
-
- false
diff --git a/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.cs b/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.cs
index 9f0dce0d70a47f..cde4fff57c5966 100644
--- a/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.cs
+++ b/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.cs
@@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
using System.ComponentModel;
+using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using System.Threading;
using Xunit;
@@ -17,7 +18,7 @@ public class TestSite : ISite
public bool DesignMode => designMode;
public IComponent Component => null;
public IContainer Container => null;
- public string Name { get; set; }
+ public string Name { get; [RequiresUnreferencedCode("The Type of components in the container cannot be statically discovered to validate the name.")] set; }
public object GetService(Type serviceType) => null;
}
diff --git a/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.unit.cs b/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.unit.cs
index 4314360f24d6e1..46ff00aa18374c 100644
--- a/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.unit.cs
+++ b/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.unit.cs
@@ -289,7 +289,7 @@ public void FileSystemWatcher_NotifyFilter()
FileSystemWatcher watcher = new FileSystemWatcher();
Assert.Equal(NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.DirectoryName, watcher.NotifyFilter);
- var notifyFilters = Enum.GetValues(typeof(NotifyFilters)).Cast();
+ var notifyFilters = Enum.GetValues();
foreach (NotifyFilters filterValue in notifyFilters)
{
watcher.NotifyFilter = filterValue;
diff --git a/src/libraries/System.IO.FileSystem.Watcher/tests/System.IO.FileSystem.Watcher.Tests.csproj b/src/libraries/System.IO.FileSystem.Watcher/tests/System.IO.FileSystem.Watcher.Tests.csproj
index 0fd33d637cee22..1e43fca4491b34 100644
--- a/src/libraries/System.IO.FileSystem.Watcher/tests/System.IO.FileSystem.Watcher.Tests.csproj
+++ b/src/libraries/System.IO.FileSystem.Watcher/tests/System.IO.FileSystem.Watcher.Tests.csproj
@@ -4,9 +4,6 @@
true$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-linux;$(NetCoreAppCurrent)-osx;$(NetCoreAppCurrent)-maccatalyst;$(NetCoreAppCurrent)-freebsdtrue
-
- false
- false
diff --git a/src/libraries/System.IO.FileSystem.Watcher/tests/Utility/FileSystemWatcherTest.cs b/src/libraries/System.IO.FileSystem.Watcher/tests/Utility/FileSystemWatcherTest.cs
index f56d2981f54f71..76998c32d01e39 100644
--- a/src/libraries/System.IO.FileSystem.Watcher/tests/Utility/FileSystemWatcherTest.cs
+++ b/src/libraries/System.IO.FileSystem.Watcher/tests/Utility/FileSystemWatcherTest.cs
@@ -465,7 +465,7 @@ public static bool TryErrorEvent(FileSystemWatcher watcher, Action action, Actio
public static IEnumerable