Skip to content

Commit

Permalink
Update tool to require .NET 6 / .NET Framework 4.6.1 at minimum.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
AraHaan committed Mar 20, 2022
1 parent 44f1c24 commit ec7fe33
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/EFCore.Tools/EFCore.Tools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<PackageId>Microsoft.EntityFrameworkCore.Tools</PackageId>
<NuspecFile>$(MSBuildThisFileDirectory)$(MSBuildProjectName).nuspec</NuspecFile>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
Expand Down
6 changes: 3 additions & 3 deletions src/EFCore.Tools/EFCore.Tools.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<file src="../../artifacts/bin/ef/$configuration$/net461/ef.pdb" target="tools/net461/any/" />
<file src="../../artifacts/bin/ef/x86/$configuration$/net461/ef.exe" target="tools/net461/win-x86/" />
<file src="../../artifacts/bin/ef/x86/$configuration$/net461/ef.pdb" target="tools/net461/win-x86/" />
<file src="../../artifacts/bin/ef/$configuration$/netcoreapp2.0/ef.dll" target="tools/netcoreapp2.0/any/" />
<file src="../../artifacts/bin/ef/$configuration$/netcoreapp2.0/ef.pdb" target="tools/netcoreapp2.0/any/" />
<file src="../../artifacts/bin/ef/$configuration$/netcoreapp2.0/ef.runtimeconfig.json" target="tools/netcoreapp2.0/any/" />
<file src="../../artifacts/bin/ef/$configuration$/net6.0/ef.dll" target="tools/net6.0/any/" />
<file src="../../artifacts/bin/ef/$configuration$/net6.0/ef.pdb" target="tools/net6.0/any/" />
<file src="../../artifacts/bin/ef/$configuration$/net6.0/ef.runtimeconfig.json" target="tools/net6.0/any/" />
</files>
</package>
2 changes: 1 addition & 1 deletion src/EFCore.Tools/tools/EntityFrameworkCore.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/dotnet-ef/dotnet-ef.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dotnet ef dbcontext scaffold
dotnet ef database drop
dotnet ef database update
</Description>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<OutputType>Exe</OutputType>
<PackAsTool>true</PackAsTool>
<PackAsToolShimRuntimeIdentifiers>win-x64;win-x86</PackAsToolShimRuntimeIdentifiers>
Expand Down
2 changes: 1 addition & 1 deletion src/ef/AppDomainOperationExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public override void Dispose()
}
}
}
#elif NETCOREAPP2_0
#elif NET6_0
#else
#error target frameworks need to be updated.
#endif
2 changes: 1 addition & 1 deletion src/ef/Commands/ProjectCommandBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 3 additions & 1 deletion src/ef/ef.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
<TargetFrameworks>net6.0;net461</TargetFrameworks>
<Description>Entity Framework Core Command-line Tools</Description>
<OutputType>Exe</OutputType>
<IsPackable>false</IsPackable>
<RootNamespace>Microsoft.EntityFrameworkCore.Tools</RootNamespace>
<CheckEolTargetFramework>False</CheckEolTargetFramework>
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)..\..\rulesets\EFCore.noxmldocs.ruleset</CodeAnalysisRuleSet>
<!-- disable nullable warnings for now. -->
<Nullable>annotations</Nullable>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit ec7fe33

Please sign in to comment.