Update .NET Core version, and add test to catch when ASP.NET depends on a later version than we have

Fixes https://github.com/dotnet/cli/issues/10553
This commit is contained in:
Daniel Plaisted 2019-01-07 13:55:18 -08:00
parent b0df13543b
commit 424024ad0c
2 changed files with 45 additions and 1 deletions

View file

@ -28,7 +28,7 @@
<DotnetWatchPackageVersion>$(MicrosoftAspNetCoreAppPackageVersion)</DotnetWatchPackageVersion> <DotnetWatchPackageVersion>$(MicrosoftAspNetCoreAppPackageVersion)</DotnetWatchPackageVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<MicrosoftNETCoreAppPackageVersion>3.0.0-preview-27218-01</MicrosoftNETCoreAppPackageVersion> <MicrosoftNETCoreAppPackageVersion>3.0.0-preview-27219-3</MicrosoftNETCoreAppPackageVersion>
<MicrosoftNETCoreDotNetHostResolverPackageVersion>$(MicrosoftNETCoreAppPackageVersion)</MicrosoftNETCoreDotNetHostResolverPackageVersion> <MicrosoftNETCoreDotNetHostResolverPackageVersion>$(MicrosoftNETCoreAppPackageVersion)</MicrosoftNETCoreDotNetHostResolverPackageVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>

View file

@ -61,6 +61,50 @@ namespace EndToEnd.Tests
binDirectory.Should().NotHaveFilesMatching("*.dll", SearchOption.AllDirectories); binDirectory.Should().NotHaveFilesMatching("*.dll", SearchOption.AllDirectories);
} }
[Fact]
public void ItCanRunAnAppUsingTheWebSdk()
{
var directory = TestAssets.CreateTestDirectory();
string projectDirectory = directory.FullName;
string newArgs = "console --debug:ephemeral-hive --no-restore";
new NewCommandShim()
.WithWorkingDirectory(projectDirectory)
.Execute(newArgs)
.Should().Pass();
string projectPath = Path.Combine(projectDirectory, directory.Name + ".csproj");
var project = XDocument.Load(projectPath);
var ns = project.Root.Name.Namespace;
project.Root.Attribute("Sdk").Value = "Microsoft.NET.Sdk.Web";
project.Save(projectPath);
new BuildCommand()
.WithWorkingDirectory(projectDirectory)
.Execute()
.Should().Pass();
var runCommand = new RunCommand()
.WithWorkingDirectory(projectDirectory);
// Set DOTNET_ROOT as workaround for https://github.com/dotnet/cli/issues/10196
var dotnetRoot = Path.GetDirectoryName(RepoDirectoriesProvider.DotnetUnderTest);
if (!string.IsNullOrEmpty(dotnetRoot))
{
bool useX86 = RepoDirectoriesProvider.DotnetRidUnderTest.EndsWith("x86", StringComparison.InvariantCultureIgnoreCase);
runCommand = runCommand.WithEnvironmentVariable(useX86 ? "DOTNET_ROOT(x86)" : "DOTNET_ROOT",
dotnetRoot);
}
runCommand.ExecuteWithCapturedOutput()
.Should().Pass()
.And.HaveStdOutContaining("Hello World!");
}
[Theory] [Theory]
[InlineData("console")] [InlineData("console")]
[InlineData("classlib")] [InlineData("classlib")]