From 9a0ec238a1cb6d8e8dc4799c54b5a325f4359128 Mon Sep 17 00:00:00 2001 From: Daniel Plaisted Date: Wed, 26 Sep 2018 13:15:16 -0700 Subject: [PATCH 1/4] Insert updated SDK --- build/DependencyVersions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/DependencyVersions.props b/build/DependencyVersions.props index 96bacec45..5e10f41d5 100644 --- a/build/DependencyVersions.props +++ b/build/DependencyVersions.props @@ -26,7 +26,7 @@ $(MicrosoftCodeAnalysisCSharpPackageVersion) $(MicrosoftCodeAnalysisCSharpPackageVersion) $(MicrosoftCodeAnalysisCSharpPackageVersion) - 2.2.100-preview1-63215-01 + 2.2.100-preview3-63322-01 $(MicrosoftNETSdkPackageVersion) 2.1.1 2.2.100-preview3-20180918-2041430 From 2ed37b3f4930211cefeb216821c7b1afb774909d Mon Sep 17 00:00:00 2001 From: Daniel Plaisted Date: Wed, 26 Sep 2018 13:15:34 -0700 Subject: [PATCH 2/4] Fix multiline powershell invocations --- build/package/Installer.MSI.targets | 92 ++++++++++++++--------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/build/package/Installer.MSI.targets b/build/package/Installer.MSI.targets index 3c8f0f2f8..503e58889 100644 --- a/build/package/Installer.MSI.targets +++ b/build/package/Installer.MSI.targets @@ -102,17 +102,17 @@ Inputs="@(GenerateSdkMsiInputs)" Outputs="$(SdkInstallerFile)"> - @@ -122,15 +122,15 @@ Inputs="@(GenerateMSBuildExtensionsMsiInputs)" Outputs="$(MSBuildExtensionsInstallerFile)"> - @@ -144,21 +144,21 @@ $(SdkGenerateBundlePowershellScript)" Outputs="$(CombinedFrameworkSdkHostInstallerFile)"> - @@ -170,10 +170,10 @@ $(SdkGenerateNupkgPowershellScript)" Outputs="$(SdkInstallerNupkgFile)"> - @@ -185,10 +185,10 @@ $(SdkGenerateNupkgPowershellScript)" Outputs="$(SdkMSBuildExtensionsNupkgFile);$(SdkMSBuildExtensionsSwrFile)"> - - Date: Wed, 26 Sep 2018 18:52:51 -0700 Subject: [PATCH 3/4] Update latest patch versions for .NET Core 2.1 --- build/MSBuildExtensions.targets | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/MSBuildExtensions.targets b/build/MSBuildExtensions.targets index 1ab68623a..54bd45bfa 100644 --- a/build/MSBuildExtensions.targets +++ b/build/MSBuildExtensions.targets @@ -158,7 +158,7 @@ + LatestVersion="2.1.5" /> + LatestVersion="2.1.5"/> + LatestVersion="2.1.5"/> Date: Wed, 26 Sep 2018 18:54:17 -0700 Subject: [PATCH 4/4] Add and enable tests for roll-forward behavior --- .../GivenAspNetAppsResolveImplicitVersions.cs | 224 ------------------ test/EndToEnd/GivenFrameworkDependentApps.cs | 50 +++- .../GivenSelfContainedAppsRollForward.cs | 99 ++++++-- test/EndToEnd/SupportedNetCoreAppVersions.cs | 22 +- 4 files changed, 142 insertions(+), 253 deletions(-) delete mode 100644 test/EndToEnd/GivenAspNetAppsResolveImplicitVersions.cs diff --git a/test/EndToEnd/GivenAspNetAppsResolveImplicitVersions.cs b/test/EndToEnd/GivenAspNetAppsResolveImplicitVersions.cs deleted file mode 100644 index 0ace5344e..000000000 --- a/test/EndToEnd/GivenAspNetAppsResolveImplicitVersions.cs +++ /dev/null @@ -1,224 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Xml.Linq; -using FluentAssertions; -using Microsoft.DotNet.TestFramework; -using Microsoft.DotNet.Tools.Test.Utilities; -using NuGet.ProjectModel; -using NuGet.Versioning; -using Xunit; - -namespace EndToEnd -{ - public class GivenAspNetAppsResolveImplicitVersions : TestBase - { - private const string AspNetTestProject = "TestWebAppSimple"; - - private const string PinnedAspNetCoreImplicitVersion = "2.1.1"; - - [Fact(Skip="https://github.com/dotnet/cli/issues/9687")] - public void PortablePublishWithLatestTFMUsesPinnedDownAspNetCoreAppVersion() - { - var _testInstance = TestAssets.Get(AspNetTestProject) - .CreateInstance(identifier: LatestSupportedAspNetCoreAppVersion) - .WithSourceFiles(); - - string projectDirectory = _testInstance.Root.FullName; - string projectPath = Path.Combine(projectDirectory, $"{AspNetTestProject}.csproj"); - - var project = XDocument.Load(projectPath); - var ns = project.Root.Name.Namespace; - - // Update TargetFramework to the right version of .NET Core - project.Root.Element(ns + "PropertyGroup") - .Element(ns + "TargetFramework") - .Value = "netcoreapp" + LatestSupportedAspNetCoreAppVersion; - - project.Save(projectPath); - - // Get the implicit version - new RestoreCommand() - .WithWorkingDirectory(projectDirectory) - .Execute() - .Should().Pass(); - - var assetsFilePath = Path.Combine(projectDirectory, "obj", "project.assets.json"); - var assetsFile = new LockFileFormat().Read(assetsFilePath); - - var restoredVersion = GetAspNetCoreAppVersion(assetsFile, portable: true); - restoredVersion.Should().NotBeNull(); - - var bundledVersionPath = Path.Combine(projectDirectory, ".DefaultPatchVersionForAspNetCoreApp2_1"); - var bundledVersion = File.ReadAllText(bundledVersionPath).Trim(); - - restoredVersion.ToNormalizedString().Should().BeEquivalentTo(bundledVersion, - "The bundled aspnetcore versions set in Microsoft.NETCoreSdk.BundledVersions.props should be identical to the versions generated." + - "Please update MSBuildExtensions.targets in this repo so these versions match."); - } - - [Fact] - public void StandalonePublishWithLatestTFMUsesBundledAspNetCoreAppVersion() - { - var _testInstance = TestAssets.Get(AspNetTestProject) - .CreateInstance(identifier: LatestSupportedAspNetCoreAppVersion) - .WithSourceFiles(); - - string projectDirectory = _testInstance.Root.FullName; - string projectPath = Path.Combine(projectDirectory, $"{AspNetTestProject}.csproj"); - - var project = XDocument.Load(projectPath); - var ns = project.Root.Name.Namespace; - - // Update TargetFramework to the right version of .NET Core - project.Root.Element(ns + "PropertyGroup") - .Element(ns + "TargetFramework") - .Value = "netcoreapp" + LatestSupportedAspNetCoreAppVersion; - - var rid = Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment.GetRuntimeIdentifier(); - - // Set RuntimeIdentifier to simulate standalone publish - project.Root.Element(ns + "PropertyGroup") - .Add(new XElement(ns + "RuntimeIdentifier", rid)); - - project.Save(projectPath); - - // Get the implicit version - new RestoreCommand() - .WithWorkingDirectory(projectDirectory) - .Execute() - .Should().Pass(); - - var assetsFilePath = Path.Combine(projectDirectory, "obj", "project.assets.json"); - var assetsFile = new LockFileFormat().Read(assetsFilePath); - - var restoredVersion = GetAspNetCoreAppVersion(assetsFile); - restoredVersion.Should().NotBeNull(); - - var bundledVersionPath = Path.Combine(projectDirectory, ".BundledAspNetCoreVersion"); - var bundledVersion = File.ReadAllText(bundledVersionPath).Trim(); - - restoredVersion.ToNormalizedString().Should().BeEquivalentTo(bundledVersion, - "The bundled aspnetcore versions set in Microsoft.NETCoreSdk.BundledVersions.props should be identical to the versions set in DependencyVersions.props." + - "Please update MSBuildExtensions.targets in this repo so these versions match."); - } - - [Theory] - [MemberData(nameof(SupportedAspNetCoreAppVersions))] - public void ItRollsForwardToTheLatestVersion(string minorVersion) - { - var _testInstance = TestAssets.Get(AspNetTestProject) - .CreateInstance(identifier: minorVersion) - .WithSourceFiles(); - - string projectDirectory = _testInstance.Root.FullName; - - string projectPath = Path.Combine(projectDirectory, $"{AspNetTestProject}.csproj"); - - var project = XDocument.Load(projectPath); - var ns = project.Root.Name.Namespace; - - // Update TargetFramework to the right version of .NET Core - project.Root.Element(ns + "PropertyGroup") - .Element(ns + "TargetFramework") - .Value = "netcoreapp" + minorVersion; - - var rid = Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment.GetRuntimeIdentifier(); - - // Set RuntimeIdentifier to opt in to roll-forward behavior - project.Root.Element(ns + "PropertyGroup") - .Add(new XElement(ns + "RuntimeIdentifier", rid)); - - project.Save(projectPath); - - // Get the version rolled forward to - new RestoreCommand() - .WithWorkingDirectory(projectDirectory) - .Execute() - .Should().Pass(); - - string assetsFilePath = Path.Combine(projectDirectory, "obj", "project.assets.json"); - var assetsFile = new LockFileFormat().Read(assetsFilePath); - - var rolledForwardVersion = GetAspNetCoreAppVersion(assetsFile); - rolledForwardVersion.Should().NotBeNull(); - - if (rolledForwardVersion.IsPrerelease) - { - // If this version of .NET Core is still prerelease, then: - // - Floating the patch by adding ".*" to the major.minor version won't work, but - // - There aren't any patches to roll-forward to, so we skip testing this until the version - // leaves prerelease. - return; - } - - // Float the RuntimeFrameworkVersion to get the latest version of the runtime available from feeds - Directory.Delete(Path.Combine(projectDirectory, "obj"), true); - project.Root.Element(ns + "PropertyGroup") - .Add(new XElement(ns + "RuntimeFrameworkVersion", $"{minorVersion}.*")); - project.Save(projectPath); - - new RestoreCommand() - .WithWorkingDirectory(projectDirectory) - .Execute() - .Should().Pass(); - - var floatedAssetsFile = new LockFileFormat().Read(assetsFilePath); - - var floatedVersion = GetAspNetCoreAppVersion(floatedAssetsFile); - floatedVersion.Should().NotBeNull(); - - rolledForwardVersion.ToNormalizedString().Should().BeEquivalentTo(floatedVersion.ToNormalizedString(), - "the latest patch version properties in Microsoft.NETCoreSdk.BundledVersions.props need to be updated " + - "(see MSBuildExtensions.targets in this repo)"); - } - - [Fact] - public void WeCoverLatestAspNetCoreAppRollForward() - { - // Run "dotnet new web", get TargetFramework property, and make sure it's covered in SupportedAspNetCoreAppVersions - using (DisposableDirectory directory = Temp.CreateDirectory()) - { - string projectDirectory = directory.Path; - - new NewCommandShim() - .WithWorkingDirectory(projectDirectory) - .Execute("web --no-restore") - .Should().Pass(); - - string projectPath = Path.Combine(projectDirectory, Path.GetFileName(projectDirectory) + ".csproj"); - - var project = XDocument.Load(projectPath); - var ns = project.Root.Name.Namespace; - - string targetFramework = project.Root.Element(ns + "PropertyGroup") - .Element(ns + "TargetFramework") - .Value; - - SupportedAspNetCoreAppVersions.Select(v => $"netcoreapp{v[0]}") - .Should().Contain(targetFramework, $"the {nameof(SupportedAspNetCoreAppVersions)} property should include the default version " + - "of Microsoft.AspNetCore.App used by the templates created by \"dotnet new web\""); - - } - } - - private NuGetVersion GetAspNetCoreAppVersion(LockFile lockFile, bool portable = false) - { - return lockFile?.Targets?.SingleOrDefault(t => portable || t.RuntimeIdentifier != null) - ?.Libraries?.SingleOrDefault(l => - string.Compare(l.Name, "Microsoft.AspNetCore.App", StringComparison.CurrentCultureIgnoreCase) == 0) - ?.Version; - } - - public static string LatestSupportedAspNetCoreAppVersion = "2.2"; - - public static IEnumerable SupportedAspNetCoreAppVersions - { - get - { - yield return new object[] { LatestSupportedAspNetCoreAppVersion }; - } - } - } -} diff --git a/test/EndToEnd/GivenFrameworkDependentApps.cs b/test/EndToEnd/GivenFrameworkDependentApps.cs index 605e22bd2..44b8b7ad1 100644 --- a/test/EndToEnd/GivenFrameworkDependentApps.cs +++ b/test/EndToEnd/GivenFrameworkDependentApps.cs @@ -17,10 +17,29 @@ namespace EndToEnd { [Theory] [ClassData(typeof(SupportedNetCoreAppVersions))] - public void ItDoesNotRollForwardToTheLatestVersion(string minorVersion) + public void ItDoesNotRollForwardToTheLatestVersionOfNetCore(string minorVersion) + { + ItDoesNotRollForwardToTheLatestVersion(GivenSelfContainedAppsRollForward.NETCorePackageName, minorVersion); + } + + [Theory] + [ClassData(typeof(SupportedAspNetCoreVersions))] + public void ItDoesNotRollForwardToTheLatestVersionOfAspNetCoreApp(string minorVersion) + { + ItDoesNotRollForwardToTheLatestVersion(GivenSelfContainedAppsRollForward.AspNetCoreAppPackageName, minorVersion); + } + + [Theory] + [ClassData(typeof(SupportedAspNetCoreVersions))] + public void ItDoesNotRollForwardToTheLatestVersionOfAspNetCoreAll(string minorVersion) + { + ItDoesNotRollForwardToTheLatestVersion(GivenSelfContainedAppsRollForward.AspNetCoreAllPackageName, minorVersion); + } + + public void ItDoesNotRollForwardToTheLatestVersion(string packageName, string minorVersion) { var _testInstance = TestAssets.Get("TestAppSimple") - .CreateInstance(identifier: minorVersion) + .CreateInstance(identifier: packageName + "_" + minorVersion) // scope the feed to only dotnet-core feed to avoid flaky when different feed has a newer / lower version .WithNuGetConfig(new RepoDirectoriesProvider().TestPackages) .WithSourceFiles(); @@ -37,6 +56,13 @@ namespace EndToEnd .Element(ns + "TargetFramework") .Value = "netcoreapp" + minorVersion; + if (packageName != GivenSelfContainedAppsRollForward.NETCorePackageName) + { + // Add implicit ASP.NET reference + project.Root.Add(new XElement(ns + "ItemGroup", + new XElement(ns + "PackageReference", new XAttribute("Include", packageName)))); + } + project.Save(projectPath); // Get the resolved version of .NET Core @@ -48,7 +74,7 @@ namespace EndToEnd string assetsFilePath = Path.Combine(projectDirectory, "obj", "project.assets.json"); var assetsFile = new LockFileFormat().Read(assetsFilePath); - var versionInAssertsJson = GetNetCoreAppVersion(assetsFile); + var versionInAssertsJson = GetPackageVersion(assetsFile, packageName); versionInAssertsJson.Should().NotBeNull(); if (versionInAssertsJson.IsPrerelease && versionInAssertsJson.Patch == 0) @@ -59,18 +85,18 @@ namespace EndToEnd return; } - versionInAssertsJson.ToNormalizedString().Should().BeEquivalentTo(GetExpectedVersion(minorVersion)); + versionInAssertsJson.ToNormalizedString().Should().BeEquivalentTo(GetExpectedVersion(packageName, minorVersion)); } - private NuGetVersion GetNetCoreAppVersion(LockFile lockFile) + private static NuGetVersion GetPackageVersion(LockFile lockFile, string packageName) { return lockFile?.Targets?.SingleOrDefault(t => t.RuntimeIdentifier == null) ?.Libraries?.SingleOrDefault(l => - string.Compare(l.Name, "Microsoft.NETCore.App", StringComparison.CurrentCultureIgnoreCase) == 0) + string.Compare(l.Name, packageName, StringComparison.CurrentCultureIgnoreCase) == 0) ?.Version; } - public string GetExpectedVersion(string minorVersion) + public string GetExpectedVersion(string packageName, string minorVersion) { if (minorVersion.StartsWith("1.0")) { @@ -82,6 +108,16 @@ namespace EndToEnd } else { + // ASP.NET 2.1.0 packages had exact version dependencies, which was problematic, + // so the default version for 2.1 apps is 2.1.1. + if (packageName == GivenSelfContainedAppsRollForward.AspNetCoreAppPackageName || + packageName == GivenSelfContainedAppsRollForward.AspNetCoreAllPackageName) + { + if (minorVersion == "2.1") + { + return "2.1.1"; + } + } var parsed = NuGetVersion.Parse(minorVersion); return new NuGetVersion(parsed.Major, parsed.Minor, 0).ToNormalizedString(); } diff --git a/test/EndToEnd/GivenSelfContainedAppsRollForward.cs b/test/EndToEnd/GivenSelfContainedAppsRollForward.cs index 07959845b..e9464ee06 100644 --- a/test/EndToEnd/GivenSelfContainedAppsRollForward.cs +++ b/test/EndToEnd/GivenSelfContainedAppsRollForward.cs @@ -14,23 +14,37 @@ namespace EndToEnd { public partial class GivenSelfContainedAppsRollForward : TestBase { + public const string NETCorePackageName = "Microsoft.NETCore.App"; + public const string AspNetCoreAppPackageName = "Microsoft.AspNetCore.App"; + public const string AspNetCoreAllPackageName = "Microsoft.AspNetCore.All"; [Theory] // MemberData is used instead of InlineData here so we can access it in another test to // verify that we are covering the latest release of .NET Core [ClassData(typeof(SupportedNetCoreAppVersions))] - public void ItRollsForwardToTheLatestVersion(string minorVersion) + public void ItRollsForwardToTheLatestNetCoreVersion(string minorVersion) { - // https://github.com/dotnet/cli/issues/9661 - // https://github.com/dotnet/sdk/issues/2446 - // dotnet/sdk is missing handling for 2.1 when it isn't the latest runtime - if (minorVersion == "2.1") - { - return; - } + ItRollsForwardToTheLatestVersion(NETCorePackageName, minorVersion); + } + [Theory] + [ClassData(typeof(SupportedAspNetCoreVersions))] + public void ItRollsForwardToTheLatestAspNetCoreAppVersion(string minorVersion) + { + ItRollsForwardToTheLatestVersion(AspNetCoreAppPackageName, minorVersion); + } + + [Theory] + [ClassData(typeof(SupportedAspNetCoreVersions))] + public void ItRollsForwardToTheLatestAspNetCoreAllVersion(string minorVersion) + { + ItRollsForwardToTheLatestVersion(AspNetCoreAllPackageName, minorVersion); + } + + public void ItRollsForwardToTheLatestVersion(string packageName, string minorVersion) + { var _testInstance = TestAssets.Get("TestAppSimple") - .CreateInstance(identifier: minorVersion) + .CreateInstance(identifier: packageName + "_" + minorVersion) .WithSourceFiles(); string projectDirectory = _testInstance.Root.FullName; @@ -51,6 +65,13 @@ namespace EndToEnd project.Root.Element(ns + "PropertyGroup") .Add(new XElement(ns + "RuntimeIdentifier", rid)); + if (packageName != NETCorePackageName) + { + // Add implicit ASP.NET reference + project.Root.Add(new XElement(ns + "ItemGroup", + new XElement(ns + "PackageReference", new XAttribute("Include", packageName)))); + } + project.Save(projectPath); // Get the version rolled forward to @@ -62,7 +83,7 @@ namespace EndToEnd string assetsFilePath = Path.Combine(projectDirectory, "obj", "project.assets.json"); var assetsFile = new LockFileFormat().Read(assetsFilePath); - var rolledForwardVersion = GetNetCoreAppVersion(assetsFile); + var rolledForwardVersion = GetPackageVersion(assetsFile, packageName); rolledForwardVersion.Should().NotBeNull(); if (rolledForwardVersion.IsPrerelease) @@ -74,10 +95,21 @@ namespace EndToEnd return; } - // Float the RuntimeFrameworkVersion to get the latest version of the runtime available from feeds Directory.Delete(Path.Combine(projectDirectory, "obj"), true); - project.Root.Element(ns + "PropertyGroup") - .Add(new XElement(ns + "RuntimeFrameworkVersion", $"{minorVersion}.*")); + if (packageName == NETCorePackageName) + { + // Float the RuntimeFrameworkVersion to get the latest version of the runtime available from feeds + project.Root.Element(ns + "PropertyGroup") + .Add(new XElement(ns + "RuntimeFrameworkVersion", $"{minorVersion}.*")); + } + else + { + project.Root.Element(ns + "ItemGroup") + .Element(ns + "PackageReference") + .Add(new XAttribute("Version", $"{minorVersion}.*"), + new XAttribute("AllowExplicitVersion", "true")); + } + project.Save(projectPath); new RestoreCommand() @@ -87,19 +119,19 @@ namespace EndToEnd var floatedAssetsFile = new LockFileFormat().Read(assetsFilePath); - var floatedVersion = GetNetCoreAppVersion(floatedAssetsFile); + var floatedVersion = GetPackageVersion(floatedAssetsFile, packageName); floatedVersion.Should().NotBeNull(); rolledForwardVersion.ToNormalizedString().Should().BeEquivalentTo(floatedVersion.ToNormalizedString(), - "the latest patch version properties in Microsoft.NETCoreSdk.BundledVersions.props need to be updated " + - "(see MSBuildExtensions.targets in this repo)"); + $"the latest patch version for {packageName} {minorVersion} in Microsoft.NETCoreSdk.BundledVersions.props " + + "needs to be updated (see the ImplicitPackageVariable items in MSBuildExtensions.targets in this repo)"); } - private NuGetVersion GetNetCoreAppVersion(LockFile lockFile) + private static NuGetVersion GetPackageVersion(LockFile lockFile, string packageName) { return lockFile?.Targets?.SingleOrDefault(t => t.RuntimeIdentifier != null) ?.Libraries?.SingleOrDefault(l => - string.Compare(l.Name, "Microsoft.NETCore.App", StringComparison.CurrentCultureIgnoreCase) == 0) + string.Compare(l.Name, packageName, StringComparison.CurrentCultureIgnoreCase) == 0) ?.Version; } @@ -125,11 +157,40 @@ namespace EndToEnd .Element(ns + "TargetFramework") .Value; - SupportedNetCoreAppVersions.Versions.Select(v => $"netcoreapp{v[0]}") + SupportedNetCoreAppVersions.Versions.Select(v => $"netcoreapp{v}") .Should().Contain(targetFramework, $"the {nameof(SupportedNetCoreAppVersions)}.{nameof(SupportedNetCoreAppVersions.Versions)} property should include the default version " + "of .NET Core created by \"dotnet new\""); } } + + [Fact] + public void WeCoverLatestAspNetCoreAppRollForward() + { + // Run "dotnet new web", get TargetFramework property, and make sure it's covered in SupportedAspNetCoreAppVersions + using (DisposableDirectory directory = Temp.CreateDirectory()) + { + string projectDirectory = directory.Path; + + new NewCommandShim() + .WithWorkingDirectory(projectDirectory) + .Execute("web --no-restore") + .Should().Pass(); + + string projectPath = Path.Combine(projectDirectory, Path.GetFileName(projectDirectory) + ".csproj"); + + var project = XDocument.Load(projectPath); + var ns = project.Root.Name.Namespace; + + string targetFramework = project.Root.Element(ns + "PropertyGroup") + .Element(ns + "TargetFramework") + .Value; + + SupportedAspNetCoreVersions.Versions.Select(v => $"netcoreapp{v}") + .Should().Contain(targetFramework, $"the {nameof(SupportedAspNetCoreVersions)} should include the default version " + + "of Microsoft.AspNetCore.App used by the templates created by \"dotnet new web\""); + + } + } } } diff --git a/test/EndToEnd/SupportedNetCoreAppVersions.cs b/test/EndToEnd/SupportedNetCoreAppVersions.cs index 97e8262b9..38d08f0a3 100644 --- a/test/EndToEnd/SupportedNetCoreAppVersions.cs +++ b/test/EndToEnd/SupportedNetCoreAppVersions.cs @@ -7,9 +7,9 @@ namespace EndToEnd { public class SupportedNetCoreAppVersions : IEnumerable { - public IEnumerator GetEnumerator() => Versions.GetEnumerator(); + public IEnumerator GetEnumerator() => Versions.Select(version => new object[] { version }).GetEnumerator(); IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); - public static IEnumerable Versions + public static IEnumerable Versions { get { @@ -20,7 +20,23 @@ namespace EndToEnd "2.0", "2.1", "2.2" - }.Select(version => new object[] { version }); + }; + } + } + + + } + + public class SupportedAspNetCoreVersions : IEnumerable + { + public IEnumerator GetEnumerator() => Versions.Select(version => new object[] { version }).GetEnumerator(); + IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); + + public static IEnumerable Versions + { + get + { + return SupportedNetCoreAppVersions.Versions.Except(new List() { "1.0", "1.1", "2.0" }); } } }