зеркало из https://github.com/dotnet/cli-lab.git
Merge pull request #280 from dotnet/marcpopMSFT-updateTFM
Update to target net8.0
This commit is contained in:
Коммит
0efaa73fb4
|
@ -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;
|
||||
|
@ -48,9 +49,12 @@ namespace Microsoft.DotNet.Tools.Uninstall.Tests.Windows
|
|||
[InlineData("Microsoft .NET SDK 5.0.100 (arm64)")]
|
||||
internal void TestIsNetCoreBundleAccept(string input)
|
||||
{
|
||||
RegistryQuery.IsNetCoreBundle(input, "0.0", "mockuninstall.exe", "0.0")
|
||||
.Should()
|
||||
.BeTrue();
|
||||
if (OperatingSystem.IsWindows())
|
||||
{
|
||||
RegistryQuery.IsNetCoreBundle(input, "0.0", "mockuninstall.exe", "0.0")
|
||||
.Should()
|
||||
.BeTrue();
|
||||
}
|
||||
}
|
||||
|
||||
[WindowsOnlyTheory]
|
||||
|
@ -58,9 +62,12 @@ namespace Microsoft.DotNet.Tools.Uninstall.Tests.Windows
|
|||
[InlineData("Microsoft .NET Core SDK - rc1 (x86)")]
|
||||
internal void TestGetBundleVersionReturnsNullOnInvalidDisplayNames(string displayName)
|
||||
{
|
||||
RegistryQuery.GetBundleVersion(displayName, string.Empty, string.Empty)
|
||||
if (OperatingSystem.IsWindows())
|
||||
{
|
||||
RegistryQuery.GetBundleVersion(displayName, string.Empty, string.Empty)
|
||||
.Should()
|
||||
.BeNull();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
Загрузка…
Ссылка в новой задаче