From d9521accdbe8d463544337c3e9069e5ee9596a69 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 10 Jan 2022 11:40:39 -0800 Subject: [PATCH] Don't exclude System.IO.Pipelines from TargetingPack version check (#39302) Co-authored-by: Will Godbe --- src/Framework/test/TargetingPackTests.cs | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/src/Framework/test/TargetingPackTests.cs b/src/Framework/test/TargetingPackTests.cs index fd244b466367..4d61b765af67 100644 --- a/src/Framework/test/TargetingPackTests.cs +++ b/src/Framework/test/TargetingPackTests.cs @@ -109,22 +109,17 @@ public void RefAssemblyReferencesHaveExpectedAssemblyVersions() Assert.All(dlls, path => { - // Skip netstandard2.0 System.IO.Pipelines assembly. References have old versions. - var filename = Path.GetFileName(path); - if (!string.Equals("System.IO.Pipelines.dll", filename, StringComparison.OrdinalIgnoreCase)) - { - using var fileStream = File.OpenRead(path); - using var peReader = new PEReader(fileStream, PEStreamOptions.Default); - var reader = peReader.GetMetadataReader(MetadataReaderOptions.Default); + using var fileStream = File.OpenRead(path); + using var peReader = new PEReader(fileStream, PEStreamOptions.Default); + var reader = peReader.GetMetadataReader(MetadataReaderOptions.Default); - Assert.All(reader.AssemblyReferences, handle => - { - var reference = reader.GetAssemblyReference(handle); - var result = 0 == reference.Version.Revision; + Assert.All(reader.AssemblyReferences, handle => + { + var reference = reader.GetAssemblyReference(handle); + var result = (0 == reference.Version.Revision && 0 == reference.Version.Build); - Assert.True(result, $"In {filename}, {reference.GetAssemblyName()} has unexpected version {reference.Version}."); - }); - } + Assert.True(result, $"In {Path.GetFileName(path)}, {reference.GetAssemblyName()} has unexpected version {reference.Version}."); + }); }); }