Fix tests for 9.0 runtime targeting

This commit is contained in:
Marc Paine 2023-09-29 11:42:14 -07:00
parent 83acde0e59
commit a95d4544b8
2 changed files with 7 additions and 2 deletions

View file

@ -18,7 +18,7 @@ namespace Microsoft.DotNet.Tests.EndToEnd
{
var testProjectCreator = new TestProjectCreator()
{
MinorVersion = "8.0"
MinorVersion = "9.0"
};
testProjectCreator.AdditionalProperties["RestorePackagesPath"] = @"$(MSBuildProjectDirectory)\packages";

View file

@ -16,6 +16,9 @@ namespace EndToEnd.Tests
{
public class ProjectBuildTests : TestBase
{
// This is needed each release after we upgrade to 9.0 but the templates haven't been upgraded yet
private static readonly string currentTfm = "net9.0";
[Fact]
public void ItCanNewRestoreBuildRunCleanMSBuildProject()
{
@ -54,7 +57,7 @@ namespace EndToEnd.Tests
binDirectory.Should().NotHaveFilesMatching("*.dll", SearchOption.AllDirectories);
}
[Fact]
[Fact(Skip ="The current aspnet runtime is built against an 8.0 core runtime")]
public void ItCanRunAnAppUsingTheWebSdk()
{
var directory = TestAssets.CreateTestDirectory();
@ -72,6 +75,8 @@ namespace EndToEnd.Tests
var ns = project.Root.Name.Namespace;
project.Root.Attribute("Sdk").Value = "Microsoft.NET.Sdk.Web";
project.Root.Element(ns + "PropertyGroup")
.Element(ns + "TargetFramework").Value = currentTfm;
project.Save(projectPath);
new BuildCommand()