Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/EFCore.Tasks/EFCore.Tasks.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<file src="$OutputPath$$DefaultNetCoreTargetFramework$\$AssemblyName$.pdb" target="tasks\$DefaultNetCoreTargetFramework$\" />
<file src="$OutputPath$$DefaultNetCoreTargetFramework$\$AssemblyName$.deps.json" target="tasks\$DefaultNetCoreTargetFramework$\" />
<file src="$OutputPath$net472\*" target="tasks\net472\" />
<file src="$ArtifactsBinDir$ef\$Configuration$\netcoreapp2.0\*" target="tools\netcoreapp2.0\" />
<file src="$ArtifactsBinDir$ef\$Configuration$\$DefaultNetCoreTargetFramework$\*" target="tools\$DefaultNetCoreTargetFramework$\" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying to understand why do we need this now, and how does this play into versioning with Aspire etc?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • netcoreapp2.0 is very out of support and this is being flagged by NuGet Audit
  • We need to target net9.0 or newer to be able to fix React to deps.json change wrt PrivateAssets #35265
  • This is a significant change, so it's best to be done early in the release

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means that the user project will need to target net10.0 to be able to refence and use our tools.

<file src="buildTransitive\*" target="buildTransitive\" />
</files>
</package>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<Project ToolsVersion="17.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<_TaskTargetFramework Condition="'$(MSBuildRuntimeType)' == 'core'">net8.0</_TaskTargetFramework>
<_TaskTargetFramework Condition="'$(MSBuildRuntimeType)' == 'core'">net10.0</_TaskTargetFramework>
<_TaskTargetFramework Condition="'$(MSBuildRuntimeType)' != 'core'">net472</_TaskTargetFramework>
<_EFCustomTasksAssembly>$([MSBuild]::NormalizePath($(MSBuildThisFileDirectory), '..\tasks\$(_TaskTargetFramework)\$(MSBuildThisFileName).dll'))</_EFCustomTasksAssembly>
<EFScaffoldModelStage Condition="'$(EFScaffoldModelStage)'==''">publish</EFScaffoldModelStage>
Expand Down
3 changes: 2 additions & 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>$(DefaultNetCoreTargetFramework)</TargetFramework>
<PackageId>Microsoft.EntityFrameworkCore.Tools</PackageId>
<NuspecFile>$(MSBuildThisFileDirectory)$(MSBuildProjectName).nuspec</NuspecFile>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
Expand Down Expand Up @@ -49,6 +49,7 @@ Update-Database
<ItemGroup>
<NuspecProperty Include="configuration=$(Configuration)" />
<NuspecProperty Include="intermediateOutputPath=$(IntermediateOutputPath)" />
<NuspecProperty Include="targetFramework=$(TargetFramework)" />
</ItemGroup>
</Target>

Expand Down
8 changes: 4 additions & 4 deletions src/EFCore.Tools/EFCore.Tools.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<metadata>
$CommonMetadataElements$
<dependencies>
<group targetFramework=".NET10.0">
<group targetFramework="$targetFramework$">
<dependency id="Microsoft.EntityFrameworkCore.Design" version="$Version$" />
</group>
</dependencies>
Expand All @@ -21,8 +21,8 @@
<file src="../../artifacts/bin/ef/x86/$configuration$/net472/ef.pdb" target="tools/net472/win-x86/" />
<file src="../../artifacts/bin/ef/ARM64/$configuration$/net472/ef.exe" target="tools/net472/win-arm64/" />
<file src="../../artifacts/bin/ef/ARM64/$configuration$/net472/ef.pdb" target="tools/net472/win-arm64/" />
<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$/$targetFramework$/ef.dll" target="tools/$targetFramework$/any/" />
<file src="../../artifacts/bin/ef/$configuration$/$targetFramework$/ef.pdb" target="tools/$targetFramework$/any/" />
<file src="../../artifacts/bin/ef/$configuration$/$targetFramework$/ef.runtimeconfig.json" target="tools/$targetFramework$/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 @@ -1253,7 +1253,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 'net10.0\any\ef.dll'

$dotnetParams = 'exec', '--depsfile', $depsFile

Expand Down
5 changes: 4 additions & 1 deletion src/dotnet-ef/RootCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,10 @@ protected override int Execute(string[] _)
args.Add(startupProject.RuntimeFrameworkVersion);
}

args.Add(Path.Combine(toolsPath, "netcoreapp2.0", "any", "ef.dll"));
#if !NET10_0
#error Target framework needs to be updated here, as well as in Microsoft.EntityFrameworkCore.Tasks.props and EntityFrameworkCore.psm1
#endif
args.Add(Path.Combine(toolsPath, "net10.0", "any", "ef.dll"));
}
else if (targetFramework.Identifier == ".NETStandard")
{
Expand Down
7 changes: 3 additions & 4 deletions src/dotnet-ef/dotnet-ef.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,12 @@ dotnet ef database update
<ItemGroup>
<NuspecProperty Include="packageType=$(PackageType)" />
<NuspecProperty Include="targetFramework=$(TargetFramework)" />

<NuspecProperty Include="SettingsFile=$(_ToolsSettingsFilePath)" />
<!-- https://github.com/dotnet/msbuild/issues/10715. %2A replaces * working around an issue building Linux. -->
<NuspecProperty Include="Output=$(PublishDir)%2A%2A/%2A" />
<NuspecProperty Include="OutputBinary=..\..\artifacts\bin\ef\$(Configuration)\netcoreapp2.0\ef.dll" />
<NuspecProperty Include="OutputRuntimeConfig=..\..\artifacts\bin\ef\$(Configuration)\netcoreapp2.0\ef.runtimeconfig.json" />
<NuspecProperty Include="OutputSymbol=..\..\artifacts\bin\ef\$(Configuration)\netcoreapp2.0\ef.pdb" />
<NuspecProperty Include="OutputBinary=..\..\artifacts\bin\ef\$(Configuration)\$(TargetFramework)\ef.dll" />
<NuspecProperty Include="OutputRuntimeConfig=..\..\artifacts\bin\ef\$(Configuration)\$(TargetFramework)\ef.runtimeconfig.json" />
<NuspecProperty Include="OutputSymbol=..\..\artifacts\bin\ef\$(Configuration)\$(TargetFramework)\ef.pdb" />
<NuspecProperty Include="OutputExe=..\..\artifacts\bin\ef\$(Configuration)\net472\ef.exe" />
<NuspecProperty Include="OutputExeSymbol=..\..\artifacts\bin\ef\$(Configuration)\net472\ef.pdb" />
<NuspecProperty Include="OutputX86Exe=..\..\artifacts\bin\ef\x86\$(Configuration)\net472\ef.exe" />
Expand Down
6 changes: 3 additions & 3 deletions src/dotnet-ef/dotnet-ef.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
<file src="PACKAGE.md" target="docs\" />
<file src="$SettingsFile$" target="tools\$targetFramework$\any" />
<file src="$Output$" target="tools\$targetFramework$\any" />
<file src="$OutputBinary$" target="tools\$targetFramework$\any\tools\netcoreapp2.0\any" />
<file src="$OutputRuntimeConfig$" target="tools\$targetFramework$\any\tools\netcoreapp2.0\any" />
<file src="$OutputSymbol$" target="tools\$targetFramework$\any\tools\netcoreapp2.0\any" />
<file src="$OutputBinary$" target="tools\$targetFramework$\any\tools\$TargetFramework$\any" />
<file src="$OutputRuntimeConfig$" target="tools\$targetFramework$\any\tools\$TargetFramework$\any" />
<file src="$OutputSymbol$" target="tools\$targetFramework$\any\tools\$TargetFramework$\any" />
<file src="$OutputExe$" target="tools\$targetFramework$\any\tools\net472\any" />
<file src="$OutputExeSymbol$" target="tools\$targetFramework$\any\tools\net472\any" />
<file src="$OutputX86Exe$" target="tools\$targetFramework$\any\tools\net472\win-x86" />
Expand Down
3 changes: 0 additions & 3 deletions src/ef/AppDomainOperationExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,4 @@ public override void Dispose()
}
}
}
#elif NETCOREAPP2_0_OR_GREATER
#else
#error target frameworks need to be updated.
#endif
6 changes: 3 additions & 3 deletions src/ef/Commands/MigrationsBundleCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected override int Execute(string[] args)
string context;
using (var executor = CreateExecutor(args))
{
context = (string)executor.GetContextInfo(Context!.Value())["Type"];
context = (string)executor.GetContextInfo(Context!.Value())["Type"]!;
}

Reporter.WriteInformation(Resources.BuildBundleStarted);
Expand Down Expand Up @@ -86,7 +86,7 @@ protected override int Execute(string[] args)
var globalJson = default(string);
var nugetConfigs = new Stack<string>();

var searchPath = WorkingDir!.Value();
var searchPath = WorkingDir!.Value()!;
do
{
foreach (var file in Directory.EnumerateFiles(searchPath))
Expand Down Expand Up @@ -131,7 +131,7 @@ protected override int Execute(string[] args)

var runtime = _runtime!.HasValue()
? _runtime!.Value()!
: (string)AppContext.GetData("RUNTIME_IDENTIFIER");
: (string)AppContext.GetData("RUNTIME_IDENTIFIER")!;
publishArgs.Add("--runtime");
publishArgs.Add(runtime);

Expand Down
2 changes: 0 additions & 2 deletions src/ef/Commands/ProjectCommandBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,6 @@ protected IOperationExecutor CreateExecutor(string[] remainingArguments)
}
}
}
#elif !NETCOREAPP2_0
#error target frameworks need to be updated.
#endif
return new ReflectionOperationExecutor(
Assembly!.Value()!,
Expand Down
7 changes: 1 addition & 6 deletions src/ef/ef.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net472</TargetFrameworks>
<TargetFrameworks>$(DefaultNetCoreTargetFramework);net472</TargetFrameworks>
<Description>Entity Framework Core Command-line Tools</Description>
<OutputType>Exe</OutputType>
<IsPackable>false</IsPackable>
Expand Down Expand Up @@ -29,11 +29,6 @@
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Configuration" />
</ItemGroup>

<ItemGroup>
<!-- Permit targeting `netcoreapp2.0`, see https://github.com/dotnet/efcore/issues/34654 -->
<NuGetAuditSuppress Include="https://github.com/advisories/GHSA-7mfr-774f-w5r9" />
</ItemGroup>

<ItemGroup>
<None Update="Generators\BundleProgramGenerator.tt">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -920,11 +920,11 @@ public class ManyTypes
public IPAddress?[] NullableIPAddressArray { get; set; } = null!;
public PhysicalAddress?[] NullablePhysicalAddressArray { get; set; } = null!;

private List<bool> _boolReadOnlyCollection = [];
private List<byte> _uInt8ReadOnlyCollection = [];
private List<int> _int32ReadOnlyCollection = [];
private List<string> _stringReadOnlyCollection = [];
private List<IPAddress> _ipAddressReadOnlyCollection = [];
private readonly List<bool> _boolReadOnlyCollection = [];
private readonly List<byte> _uInt8ReadOnlyCollection = [];
private readonly List<int> _int32ReadOnlyCollection = [];
private readonly List<string> _stringReadOnlyCollection = [];
private readonly List<IPAddress> _ipAddressReadOnlyCollection = [];

public IReadOnlyCollection<bool> BoolReadOnlyCollection
=> _boolReadOnlyCollection.ToList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
<ProjectReference Include="..\EFCore.SqlServer.FunctionalTests\EFCore.SqlServer.FunctionalTests.csproj" />
</ItemGroup>

<Import Project="..\..\src\EFCore.SqlServer.HierarchyId\build\net8.0\Microsoft.EntityFrameworkCore.SqlServer.HierarchyId.targets" />
<Import Project="..\..\src\EFCore.SqlServer.HierarchyId\build\net10.0\Microsoft.EntityFrameworkCore.SqlServer.HierarchyId.targets" />

</Project>