![dotnet-maestro[bot]](/assets/img/avatar_default.png)
* Update dependencies from https://github.com/aspnet/AspNetCore build 20190828.12 - Microsoft.AspNetCore.DeveloperCertificates.XPlat - 5.0.0-alpha1.19428.12 - Microsoft.AspNetCore.App.Runtime.win-x64 - 5.0.0-alpha1.19428.12 - Microsoft.AspNetCore.App.Ref - 5.0.0-alpha1.19428.12 - dotnet-watch - 5.0.0-alpha1.19428.12 - dotnet-user-secrets - 5.0.0-alpha1.19428.12 - dotnet-dev-certs - 5.0.0-alpha1.19428.12 * Update dependencies from https://github.com/aspnet/AspNetCore build 20190830.9 - Microsoft.AspNetCore.DeveloperCertificates.XPlat - 5.0.0-alpha1.19430.9 - Microsoft.AspNetCore.App.Runtime.win-x64 - 5.0.0-alpha1.19430.9 - Microsoft.AspNetCore.App.Ref - 5.0.0-alpha1.19430.9 - dotnet-watch - 5.0.0-alpha1.19430.9 - dotnet-user-secrets - 5.0.0-alpha1.19430.9 - dotnet-dev-certs - 5.0.0-alpha1.19430.9 * Update dependencies from https://github.com/aspnet/AspNetCore build 20190903.5 - Microsoft.AspNetCore.DeveloperCertificates.XPlat - 5.0.0-alpha1.19453.5 - Microsoft.AspNetCore.App.Runtime.win-x64 - 5.0.0-alpha1.19453.5 - Microsoft.AspNetCore.App.Ref - 5.0.0-alpha1.19453.5 - dotnet-watch - 5.0.0-alpha1.19453.5 - dotnet-user-secrets - 5.0.0-alpha1.19453.5 - dotnet-dev-certs - 5.0.0-alpha1.19453.5 * Update dependencies from https://github.com/aspnet/AspNetCore build 20190903.8 - Microsoft.AspNetCore.DeveloperCertificates.XPlat - 5.0.0-alpha1.19453.8 - Microsoft.AspNetCore.App.Runtime.win-x64 - 5.0.0-alpha1.19453.8 - Microsoft.AspNetCore.App.Ref - 5.0.0-alpha1.19453.8 - dotnet-watch - 5.0.0-alpha1.19453.8 - dotnet-user-secrets - 5.0.0-alpha1.19453.8 - dotnet-dev-certs - 5.0.0-alpha1.19453.8 * Update dependencies from https://github.com/aspnet/AspNetCore build 20190904.6 - Microsoft.AspNetCore.DeveloperCertificates.XPlat - 5.0.0-alpha1.19454.6 - Microsoft.AspNetCore.App.Runtime.win-x64 - 5.0.0-alpha1.19454.6 - Microsoft.AspNetCore.App.Ref - 5.0.0-alpha1.19454.6 - dotnet-watch - 5.0.0-alpha1.19454.6 - dotnet-user-secrets - 5.0.0-alpha1.19454.6 - dotnet-dev-certs - 5.0.0-alpha1.19454.6 * Update dependencies from https://github.com/aspnet/AspNetCore build 20190904.9 - Microsoft.AspNetCore.DeveloperCertificates.XPlat - 5.0.0-alpha1.19454.9 - Microsoft.AspNetCore.App.Runtime.win-x64 - 5.0.0-alpha1.19454.9 - Microsoft.AspNetCore.App.Ref - 5.0.0-alpha1.19454.9 - dotnet-watch - 5.0.0-alpha1.19454.9 - dotnet-user-secrets - 5.0.0-alpha1.19454.9 - dotnet-dev-certs - 5.0.0-alpha1.19454.9 * Update dependencies from https://github.com/aspnet/AspNetCore build 20190906.3 - Microsoft.AspNetCore.DeveloperCertificates.XPlat - 5.0.0-alpha1.19456.3 - Microsoft.AspNetCore.App.Runtime.win-x64 - 5.0.0-alpha1.19456.3 - Microsoft.AspNetCore.App.Ref - 5.0.0-alpha1.19456.3 - dotnet-watch - 5.0.0-alpha1.19456.3 - dotnet-user-secrets - 5.0.0-alpha1.19456.3 - dotnet-dev-certs - 5.0.0-alpha1.19456.3 * Update dependencies from https://github.com/aspnet/AspNetCore build 20190909.1 - Microsoft.AspNetCore.DeveloperCertificates.XPlat - 5.0.0-alpha1.19459.1 - Microsoft.AspNetCore.App.Runtime.win-x64 - 5.0.0-alpha1.19459.1 - Microsoft.AspNetCore.App.Ref - 5.0.0-alpha1.19459.1 - dotnet-watch - 5.0.0-alpha1.19459.1 - dotnet-user-secrets - 5.0.0-alpha1.19459.1 - dotnet-dev-certs - 5.0.0-alpha1.19459.1 * Update 3.0 versions to rc1, update TargetFramework for ASP.NET framework reference * Update dependencies from https://github.com/aspnet/AspNetCore build 20190909.4 - Microsoft.AspNetCore.DeveloperCertificates.XPlat - 5.0.0-alpha1.19459.4 - Microsoft.AspNetCore.App.Runtime.win-x64 - 5.0.0-alpha1.19459.4 - Microsoft.AspNetCore.App.Ref - 5.0.0-alpha1.19459.4 - dotnet-watch - 5.0.0-alpha1.19459.4 - dotnet-user-secrets - 5.0.0-alpha1.19459.4 - dotnet-dev-certs - 5.0.0-alpha1.19459.4 * Update dependencies from https://github.com/aspnet/AspNetCore build 20190911.3 - Microsoft.AspNetCore.DeveloperCertificates.XPlat - 5.0.0-alpha1.19461.3 - Microsoft.AspNetCore.App.Runtime.win-x64 - 5.0.0-alpha1.19461.3 - Microsoft.AspNetCore.App.Ref - 5.0.0-alpha1.19461.3 - dotnet-watch - 5.0.0-alpha1.19461.3 - dotnet-user-secrets - 5.0.0-alpha1.19461.3 - dotnet-dev-certs - 5.0.0-alpha1.19461.3 * Update dependencies from https://github.com/aspnet/AspNetCore build 20190911.5 - Microsoft.AspNetCore.DeveloperCertificates.XPlat - 5.0.0-alpha1.19461.5 - Microsoft.AspNetCore.App.Runtime.win-x64 - 5.0.0-alpha1.19461.5 - Microsoft.AspNetCore.App.Ref - 5.0.0-alpha1.19461.5 - dotnet-watch - 5.0.0-alpha1.19461.5 - dotnet-user-secrets - 5.0.0-alpha1.19461.5 - dotnet-dev-certs - 5.0.0-alpha1.19461.5 * Update dependencies from https://github.com/aspnet/AspNetCore build 20190911.8 - Microsoft.AspNetCore.DeveloperCertificates.XPlat - 5.0.0-alpha1.19461.8 - Microsoft.AspNetCore.App.Runtime.win-x64 - 5.0.0-alpha1.19461.8 - Microsoft.AspNetCore.App.Ref - 5.0.0-alpha1.19461.8 - dotnet-watch - 5.0.0-alpha1.19461.8 - dotnet-user-secrets - 5.0.0-alpha1.19461.8 - dotnet-dev-certs - 5.0.0-alpha1.19461.8 * Update dependencies from https://github.com/aspnet/AspNetCore build 20190911.11 - Microsoft.AspNetCore.DeveloperCertificates.XPlat - 5.0.0-alpha1.19461.11 - Microsoft.AspNetCore.App.Runtime.win-x64 - 5.0.0-alpha1.19461.11 - Microsoft.AspNetCore.App.Ref - 5.0.0-alpha1.19461.11 - dotnet-watch - 5.0.0-alpha1.19461.11 - dotnet-user-secrets - 5.0.0-alpha1.19461.11 - dotnet-dev-certs - 5.0.0-alpha1.19461.11 * Update dependencies from https://github.com/aspnet/AspNetCore build 20190911.13 - Microsoft.AspNetCore.DeveloperCertificates.XPlat - 5.0.0-alpha1.19461.13 - Microsoft.AspNetCore.App.Runtime.win-x64 - 5.0.0-alpha1.19461.13 - Microsoft.AspNetCore.App.Ref - 5.0.0-alpha1.19461.13 - dotnet-watch - 5.0.0-alpha1.19461.13 - dotnet-user-secrets - 5.0.0-alpha1.19461.13 - dotnet-dev-certs - 5.0.0-alpha1.19461.13 * Update dependencies from https://github.com/aspnet/AspNetCore build 20190912.1 - Microsoft.AspNetCore.DeveloperCertificates.XPlat - 5.0.0-alpha1.19462.1 - Microsoft.AspNetCore.App.Runtime.win-x64 - 5.0.0-alpha1.19462.1 - Microsoft.AspNetCore.App.Ref - 5.0.0-alpha1.19462.1 - dotnet-watch - 5.0.0-alpha1.19462.1 - dotnet-user-secrets - 5.0.0-alpha1.19462.1 - dotnet-dev-certs - 5.0.0-alpha1.19462.1 * Update dependencies from https://github.com/aspnet/AspNetCore build 20190912.5 - Microsoft.AspNetCore.DeveloperCertificates.XPlat - 5.0.0-alpha1.19462.5 - Microsoft.AspNetCore.App.Runtime.win-x64 - 5.0.0-alpha1.19462.5 - Microsoft.AspNetCore.App.Ref - 5.0.0-alpha1.19462.5 - dotnet-watch - 5.0.0-alpha1.19462.5 - dotnet-user-secrets - 5.0.0-alpha1.19462.5 - dotnet-dev-certs - 5.0.0-alpha1.19462.5 * Update dependencies from https://github.com/aspnet/AspNetCore build 20190912.9 - Microsoft.AspNetCore.DeveloperCertificates.XPlat - 5.0.0-alpha1.19462.9 - Microsoft.AspNetCore.App.Runtime.win-x64 - 5.0.0-alpha1.19462.9 - Microsoft.AspNetCore.App.Ref - 5.0.0-alpha1.19462.9 - dotnet-watch - 5.0.0-alpha1.19462.9 - dotnet-user-secrets - 5.0.0-alpha1.19462.9 - dotnet-dev-certs - 5.0.0-alpha1.19462.9 * Update dependencies from https://github.com/aspnet/AspNetCore build 20190916.1 - Microsoft.AspNetCore.DeveloperCertificates.XPlat - 5.0.0-alpha1.19466.1 - Microsoft.AspNetCore.App.Runtime.win-x64 - 5.0.0-alpha1.19466.1 - Microsoft.AspNetCore.App.Ref - 5.0.0-alpha1.19466.1 - dotnet-watch - 5.0.0-alpha1.19466.1 - dotnet-user-secrets - 5.0.0-alpha1.19466.1 - dotnet-dev-certs - 5.0.0-alpha1.19466.1 * Update dependencies from https://github.com/aspnet/AspNetCore build 20190916.2 - Microsoft.AspNetCore.DeveloperCertificates.XPlat - 5.0.0-alpha1.19466.2 - Microsoft.AspNetCore.App.Runtime.win-x64 - 5.0.0-alpha1.19466.2 - Microsoft.AspNetCore.App.Ref - 5.0.0-alpha1.19466.2 - dotnet-watch - 5.0.0-alpha1.19466.2 - dotnet-user-secrets - 5.0.0-alpha1.19466.2 - dotnet-dev-certs - 5.0.0-alpha1.19466.2 * Update dependencies from https://github.com/aspnet/AspNetCore build 20190916.4 - Microsoft.AspNetCore.DeveloperCertificates.XPlat - 5.0.0-alpha1.19466.4 - Microsoft.AspNetCore.App.Runtime.win-x64 - 5.0.0-alpha1.19466.4 - Microsoft.AspNetCore.App.Ref - 5.0.0-alpha1.19466.4 - dotnet-watch - 5.0.0-alpha1.19466.4 - dotnet-user-secrets - 5.0.0-alpha1.19466.4 - dotnet-dev-certs - 5.0.0-alpha1.19466.4 * Update dependencies from https://github.com/aspnet/AspNetCore build 20190916.5 - Microsoft.AspNetCore.DeveloperCertificates.XPlat - 5.0.0-alpha1.19466.5 - Microsoft.AspNetCore.App.Runtime.win-x64 - 5.0.0-alpha1.19466.5 - Microsoft.AspNetCore.App.Ref - 5.0.0-alpha1.19466.5 - dotnet-watch - 5.0.0-alpha1.19466.5 - dotnet-user-secrets - 5.0.0-alpha1.19466.5 - dotnet-dev-certs - 5.0.0-alpha1.19466.5 * Update dependencies from https://github.com/aspnet/AspNetCore build 20190916.7 - Microsoft.AspNetCore.DeveloperCertificates.XPlat - 5.0.0-alpha1.19466.7 - Microsoft.AspNetCore.App.Runtime.win-x64 - 5.0.0-alpha1.19466.7 - Microsoft.AspNetCore.App.Ref - 5.0.0-alpha1.19466.7 - dotnet-watch - 5.0.0-alpha1.19466.7 - dotnet-user-secrets - 5.0.0-alpha1.19466.7 - dotnet-dev-certs - 5.0.0-alpha1.19466.7 * Support targeting ASP.NET Core 5.0
121 lines
4.6 KiB
C#
121 lines
4.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Xml.Linq;
|
|
using FluentAssertions;
|
|
using Microsoft.DotNet.PlatformAbstractions;
|
|
using Microsoft.DotNet.TestFramework;
|
|
using Microsoft.DotNet.Tools.Test.Utilities;
|
|
using NuGet.ProjectModel;
|
|
using NuGet.Versioning;
|
|
using Xunit;
|
|
|
|
namespace EndToEnd
|
|
{
|
|
public class GivenFrameworkDependentApps : TestBase
|
|
{
|
|
[Theory]
|
|
[ClassData(typeof(SupportedNetCoreAppVersions))]
|
|
public void ItDoesNotRollForwardToTheLatestVersionOfNetCore(string minorVersion)
|
|
{
|
|
if (minorVersion == "3.0" || minorVersion == "5.0")
|
|
{
|
|
// https://github.com/dotnet/core-sdk/issues/621
|
|
return;
|
|
}
|
|
ItDoesNotRollForwardToTheLatestVersion(TestProjectCreator.NETCorePackageName, minorVersion);
|
|
}
|
|
|
|
[Theory]
|
|
[ClassData(typeof(SupportedAspNetCoreVersions))]
|
|
public void ItDoesNotRollForwardToTheLatestVersionOfAspNetCoreApp(string minorVersion)
|
|
{
|
|
if (minorVersion == "3.0" || minorVersion == "5.0")
|
|
{
|
|
// https://github.com/dotnet/core-sdk/issues/621
|
|
return;
|
|
}
|
|
ItDoesNotRollForwardToTheLatestVersion(TestProjectCreator.AspNetCoreAppPackageName, minorVersion);
|
|
}
|
|
|
|
[Theory]
|
|
[ClassData(typeof(SupportedAspNetCoreAllVersions))]
|
|
public void ItDoesNotRollForwardToTheLatestVersionOfAspNetCoreAll(string minorVersion)
|
|
{
|
|
ItDoesNotRollForwardToTheLatestVersion(TestProjectCreator.AspNetCoreAllPackageName, minorVersion);
|
|
}
|
|
|
|
internal void ItDoesNotRollForwardToTheLatestVersion(string packageName, string minorVersion)
|
|
{
|
|
var testProjectCreator = new TestProjectCreator()
|
|
{
|
|
PackageName = packageName,
|
|
MinorVersion = minorVersion,
|
|
};
|
|
|
|
var _testInstance = testProjectCreator.Create();
|
|
|
|
string projectDirectory = _testInstance.Root.FullName;
|
|
|
|
string projectPath = Path.Combine(projectDirectory, "TestAppSimple.csproj");
|
|
|
|
// Get the resolved version of .NET Core
|
|
new RestoreCommand()
|
|
.WithWorkingDirectory(projectDirectory)
|
|
.Execute()
|
|
.Should().Pass();
|
|
|
|
string assetsFilePath = Path.Combine(projectDirectory, "obj", "project.assets.json");
|
|
var assetsFile = new LockFileFormat().Read(assetsFilePath);
|
|
|
|
var versionInAssertsJson = GetPackageVersion(assetsFile, packageName);
|
|
versionInAssertsJson.Should().NotBeNull();
|
|
|
|
if (versionInAssertsJson.IsPrerelease && versionInAssertsJson.Patch == 0)
|
|
{
|
|
// if the bundled version is, for example, a prerelease of
|
|
// .NET Core 2.1.1, that we don't roll forward to that prerelease
|
|
// version for framework-dependent deployments.
|
|
return;
|
|
}
|
|
|
|
versionInAssertsJson.ToNormalizedString().Should().BeEquivalentTo(GetExpectedVersion(packageName, minorVersion));
|
|
}
|
|
|
|
private static NuGetVersion GetPackageVersion(LockFile lockFile, string packageName)
|
|
{
|
|
return lockFile?.Targets?.SingleOrDefault(t => t.RuntimeIdentifier == null)
|
|
?.Libraries?.SingleOrDefault(l =>
|
|
string.Compare(l.Name, packageName, StringComparison.CurrentCultureIgnoreCase) == 0)
|
|
?.Version;
|
|
}
|
|
|
|
public string GetExpectedVersion(string packageName, string minorVersion)
|
|
{
|
|
if (minorVersion.StartsWith("1.0"))
|
|
{
|
|
return "1.0.5"; // special case for 1.0
|
|
}
|
|
else if (minorVersion.StartsWith("1.1"))
|
|
{
|
|
return "1.1.2"; // special case for 1.1
|
|
}
|
|
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 == TestProjectCreator.AspNetCoreAppPackageName ||
|
|
packageName == TestProjectCreator.AspNetCoreAllPackageName)
|
|
{
|
|
if (minorVersion == "2.1")
|
|
{
|
|
return "2.1.1";
|
|
}
|
|
}
|
|
var parsed = NuGetVersion.Parse(minorVersion);
|
|
return new NuGetVersion(parsed.Major, parsed.Minor, 0).ToNormalizedString();
|
|
}
|
|
}
|
|
}
|
|
}
|