From 7aeb4a78ccd6af86a32f51865393f9189ee828a7 Mon Sep 17 00:00:00 2001 From: AraHaan Date: Sun, 20 Mar 2022 03:09:17 -0400 Subject: [PATCH] Update tool to require .NET 6 / .NET Framework 4.6.1 at minimum. This is needed otherwise it will try to require ".NET 2.0 Runtime" to be installed, which will cause roll forward to fail to load 6.0.0's System.Runtime when used on devices with newer versions of the .NET SDK and runtimes. Fixes: https://github.com/dotnet/efcore/issues/27660. Signed-off-by: AraHaan --- src/EFCore.Tools/EFCore.Tools.csproj | 2 +- src/EFCore.Tools/EFCore.Tools.nuspec | 6 +++--- src/EFCore.Tools/tools/EntityFrameworkCore.psm1 | 2 +- src/dotnet-ef/RootCommand.cs | 2 +- src/dotnet-ef/dotnet-ef.csproj | 8 ++++---- src/dotnet-ef/dotnet-ef.nuspec | 6 +++--- src/ef/AppDomainOperationExecutor.cs | 2 +- src/ef/Commands/ProjectCommandBase.cs | 2 +- src/ef/ef.csproj | 5 ++++- 9 files changed, 19 insertions(+), 16 deletions(-) diff --git a/src/EFCore.Tools/EFCore.Tools.csproj b/src/EFCore.Tools/EFCore.Tools.csproj index 618412caf32..df0c078cd0e 100644 --- a/src/EFCore.Tools/EFCore.Tools.csproj +++ b/src/EFCore.Tools/EFCore.Tools.csproj @@ -3,7 +3,7 @@ - netcoreapp2.0 + net6.0 Microsoft.EntityFrameworkCore.Tools $(MSBuildThisFileDirectory)$(MSBuildProjectName).nuspec true diff --git a/src/EFCore.Tools/EFCore.Tools.nuspec b/src/EFCore.Tools/EFCore.Tools.nuspec index ebddc963d25..e180d2430b3 100644 --- a/src/EFCore.Tools/EFCore.Tools.nuspec +++ b/src/EFCore.Tools/EFCore.Tools.nuspec @@ -19,8 +19,8 @@ - - - + + + \ No newline at end of file diff --git a/src/EFCore.Tools/tools/EntityFrameworkCore.psm1 b/src/EFCore.Tools/tools/EntityFrameworkCore.psm1 index 3ba5bfa9043..52cd11698b0 100644 --- a/src/EFCore.Tools/tools/EntityFrameworkCore.psm1 +++ b/src/EFCore.Tools/tools/EntityFrameworkCore.psm1 @@ -1249,7 +1249,7 @@ function EF($project, $startupProject, $params, $applicationArgs, [switch] $skip $projectAssetsFile = GetCpsProperty $startupProject 'ProjectAssetsFile' $runtimeConfig = Join-Path $targetDir ($startupTargetName + '.runtimeconfig.json') $runtimeFrameworkVersion = GetCpsProperty $startupProject 'RuntimeFrameworkVersion' - $efPath = Join-Path $PSScriptRoot 'netcoreapp2.0\any\ef.dll' + $efPath = Join-Path $PSScriptRoot 'net6.0\any\ef.dll' $dotnetParams = 'exec', '--depsfile', $depsFile diff --git a/src/dotnet-ef/RootCommand.cs b/src/dotnet-ef/RootCommand.cs index 5a39820f31f..fd947ee5fcc 100644 --- a/src/dotnet-ef/RootCommand.cs +++ b/src/dotnet-ef/RootCommand.cs @@ -157,7 +157,7 @@ protected override int Execute(string[] _) args.Add(startupProject.RuntimeFrameworkVersion); } - args.Add(Path.Combine(toolsPath, "netcoreapp2.0", "any", "ef.dll")); + args.Add(Path.Combine(toolsPath, "net6.0", "any", "ef.dll")); } else if (targetFramework.Identifier == ".NETStandard") { diff --git a/src/dotnet-ef/dotnet-ef.csproj b/src/dotnet-ef/dotnet-ef.csproj index 676a63f5bd9..b12aff354d1 100644 --- a/src/dotnet-ef/dotnet-ef.csproj +++ b/src/dotnet-ef/dotnet-ef.csproj @@ -12,7 +12,7 @@ dotnet ef dbcontext scaffold dotnet ef database drop dotnet ef database update - netcoreapp3.1 + net6.0 Exe true win-x64;win-x86 @@ -85,9 +85,9 @@ dotnet ef database update - - - + + + diff --git a/src/dotnet-ef/dotnet-ef.nuspec b/src/dotnet-ef/dotnet-ef.nuspec index 5eea51128b0..4a3f750393e 100644 --- a/src/dotnet-ef/dotnet-ef.nuspec +++ b/src/dotnet-ef/dotnet-ef.nuspec @@ -11,9 +11,9 @@ $CommonFileElements$ - - - + + + diff --git a/src/ef/AppDomainOperationExecutor.cs b/src/ef/AppDomainOperationExecutor.cs index 6c4085a9983..2af031e2bdf 100644 --- a/src/ef/AppDomainOperationExecutor.cs +++ b/src/ef/AppDomainOperationExecutor.cs @@ -101,7 +101,7 @@ public override void Dispose() } } } -#elif NETCOREAPP2_0 +#elif NET6_0 #else #error target frameworks need to be updated. #endif diff --git a/src/ef/Commands/ProjectCommandBase.cs b/src/ef/Commands/ProjectCommandBase.cs index caab03930ce..5f0ac90d998 100644 --- a/src/ef/Commands/ProjectCommandBase.cs +++ b/src/ef/Commands/ProjectCommandBase.cs @@ -106,7 +106,7 @@ protected IOperationExecutor CreateExecutor(string[] remainingArguments) } } } -#elif !NETCOREAPP2_0 +#elif !NET6_0 #error target frameworks need to be updated. #endif return new ReflectionOperationExecutor( diff --git a/src/ef/ef.csproj b/src/ef/ef.csproj index 77a7d8d87fe..a0a22c526e1 100644 --- a/src/ef/ef.csproj +++ b/src/ef/ef.csproj @@ -1,13 +1,16 @@  - netcoreapp2.0;net461 + net6.0;net461 Entity Framework Core Command-line Tools Exe false Microsoft.EntityFrameworkCore.Tools False $(MSBuildThisFileDirectory)..\..\rulesets\EFCore.noxmldocs.ruleset + Major + + annotations