target .NET 9 for upgrade command

This commit is contained in:
Matthew Parker [SSW]
2024-11-13 19:11:18 +10:00
parent 7221780caa
commit dbb5609500
4 changed files with 7 additions and 7 deletions

View File

@@ -33,11 +33,11 @@ public static class DotNetUpgrade
var targetFramework = project
.PropertyGroups.SelectMany(x => x.Properties)
.FirstOrDefault(x => x.Name == "TargetFramework");
if (targetFramework?.Value is "net8.0" or "net7.0" or "net6.0" or "net5.0")
if (targetFramework?.Value is "net9.0" or "net8.0" or "net7.0" or "net6.0" or "net5.0")
{
if (targetFramework.Value is not "net8.0")
if (targetFramework.Value is not "net9.0")
{
targetFramework.Value = "net8.0";
targetFramework.Value = "net9.0";
project.Save();
FormatCsproj.FormatCsprojFile(project.FullPath);
}