Merge pull request #280 from dotnet/marcpopMSFT-updateTFM

Update to target net8.0
This commit is contained in:
Jacques Eloff 2024-03-04 11:52:03 -08:00 коммит произвёл GitHub
Родитель 86b3ccddf4 b0d1ab8e8a
Коммит 0efaa73fb4
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
10 изменённых файлов: 27 добавлений и 17 удалений

Просмотреть файл

@ -1,6 +1,6 @@
{
"tools": {
"dotnet": "7.0.100-rc.1.22431.12"
"dotnet": "8.0.100"
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.22480.2"

Просмотреть файл

@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Microsoft.Build.Logging.Query</RootNamespace>
<LangVersion>preview</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Build" Version="16.0.461" />
<PackageReference Include="Microsoft.Build" Version="17.9.5" />
</ItemGroup>
</Project>

Просмотреть файл

@ -133,13 +133,13 @@ namespace Microsoft.DotNet.Tools.Uninstall.Shared.Commands
{
try
{
if (RuntimeInfo.RunningOnWindows)
if (OperatingSystem.IsWindows())
{
var identity = WindowsIdentity.GetCurrent();
var principal = new WindowsPrincipal(identity);
return principal.IsInRole(WindowsBuiltInRole.Administrator);
}
else if (RuntimeInfo.RunningOnOSX)
else if (OperatingSystem.IsMacOS())
{
return getuid() == 0;
}

Просмотреть файл

@ -8,6 +8,7 @@ using System.CommandLine.Builder;
using System.CommandLine.Invocation;
using System.CommandLine.Parsing;
using System.Linq;
using System.Runtime.InteropServices;
using Microsoft.DotNet.Tools.Uninstall.MacOs;
using Microsoft.DotNet.Tools.Uninstall.Shared.BundleInfo;
using Microsoft.DotNet.Tools.Uninstall.Shared.Commands;
@ -231,7 +232,7 @@ namespace Microsoft.DotNet.Tools.Uninstall.Shared.Configs
}
AssignOptionsToCommand(ListCommand, ListAuxOptions);
var bundleCollector = RuntimeInfo.RunningOnWindows ? new RegistryQuery() as IBundleCollector : new FileSystemExplorer() as IBundleCollector;
var bundleCollector = OperatingSystem.IsWindows() ? new RegistryQuery() as IBundleCollector : new FileSystemExplorer() as IBundleCollector;
ListCommand.Handler = CommandHandler.Create(ExceptionHandler.HandleException(() => ListCommandExec.Execute(bundleCollector)));
DryRunCommand.Handler = CommandHandler.Create(ExceptionHandler.HandleException(() => DryRunCommandExec.Execute(bundleCollector)));
RemoveCommand.Handler = CommandHandler.Create(ExceptionHandler.HandleException(() => UninstallCommandExec.Execute(bundleCollector)));

Просмотреть файл

@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Versioning;
using System.Text.RegularExpressions;
using Microsoft.DotNet.Tools.Uninstall.MacOs;
using Microsoft.DotNet.Tools.Uninstall.Shared.BundleInfo;
@ -15,6 +16,7 @@ using Microsoft.Win32;
namespace Microsoft.DotNet.Tools.Uninstall.Windows
{
[SupportedOSPlatform("windows")]
internal class RegistryQuery : IBundleCollector
{
public IEnumerable<Bundle> GetInstalledBundles()

Просмотреть файл

@ -4,7 +4,7 @@
<OutputType>Exe</OutputType>
<RuntimeIdentifiers>win-x86;osx-x64</RuntimeIdentifiers>
<SignAssembly>true</SignAssembly>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RollForward>LatestMajor</RollForward>
</PropertyGroup>
@ -15,11 +15,11 @@
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Setup.Configuration.Interop" Version="$(MicrosoftVisualStudioSetupConfigurationPackageVersion)" />
<PackageReference Include="Microsoft.Win32.Registry" Version="4.6.0" />
<PackageReference Include="NuGet.Versioning" Version="5.3.1" />
<PackageReference Include="Microsoft.Win32.Registry" Version="4.7.0" />
<PackageReference Include="NuGet.Versioning" Version="6.9.1" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.20574.7" />
<PackageReference Include="System.CommandLine.Rendering" Version="0.3.0-alpha.20574.7" />
<PackageReference Include="System.Resources.Extensions" Version="4.6.0" />
<PackageReference Include="System.Resources.Extensions" Version="8.0.0" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<CopyBuildOutputToPublishDirectory>false</CopyBuildOutputToPublishDirectory>
<DisableImplicitFrameworkReferences>false</DisableImplicitFrameworkReferences>

Просмотреть файл

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Просмотреть файл

@ -1,6 +1,7 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using FluentAssertions;
using Microsoft.DotNet.Tools.Uninstall.Tests.Attributes;
using Microsoft.DotNet.Tools.Uninstall.Windows;
@ -47,16 +48,21 @@ namespace Microsoft.DotNet.Tools.Uninstall.Tests.Windows
[InlineData("Microsoft .NET 5.0.9 - Windows Server Hosting")]
[InlineData("Microsoft .NET SDK 5.0.100 (arm64)")]
internal void TestIsNetCoreBundleAccept(string input)
{
if (OperatingSystem.IsWindows())
{
RegistryQuery.IsNetCoreBundle(input, "0.0", "mockuninstall.exe", "0.0")
.Should()
.BeTrue();
}
}
[WindowsOnlyTheory]
[InlineData("Microsoft ASP.NET Web Frameworks and Tools VS2015")]
[InlineData("Microsoft .NET Core SDK - rc1 (x86)")]
internal void TestGetBundleVersionReturnsNullOnInvalidDisplayNames(string displayName)
{
if (OperatingSystem.IsWindows())
{
RegistryQuery.GetBundleVersion(displayName, string.Empty, string.Empty)
.Should()
@ -64,3 +70,4 @@ namespace Microsoft.DotNet.Tools.Uninstall.Tests.Windows
}
}
}
}

Просмотреть файл

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>