Skip to content
Open
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.Abstractions/EFCore.Abstractions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Description>Provides abstractions and attributes that are used to configure Entity Framework Core</Description>
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
<TargetFramework>$(NetMinimum)</TargetFramework>
<MinClientVersion>3.6</MinClientVersion>
<AssemblyName>Microsoft.EntityFrameworkCore.Abstractions</AssemblyName>
<RootNamespace>Microsoft.EntityFrameworkCore</RootNamespace>
Expand Down
23 changes: 14 additions & 9 deletions src/EFCore.Tasks/EFCore.Tasks.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>$(NetCurrent);$(NetFrameworkToolCurrent)</TargetFrameworks>
<TargetFrameworks>$(NetMinimum);$(NetFrameworkToolCurrent)</TargetFrameworks>
<Description>MSBuild tasks for Entity Framework Core projects.</Description>
<AssemblyName>Microsoft.EntityFrameworkCore.Tasks</AssemblyName>
<RootNamespace>Microsoft.EntityFrameworkCore</RootNamespace>
Expand All @@ -11,7 +11,7 @@
<ImplicitUsings>true</ImplicitUsings>
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)..\..\rulesets\EFCore.noxmldocs.ruleset</CodeAnalysisRuleSet>
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);AddPackContent</TargetsForTfmSpecificContentInPackage>
<BuildOutputTargetFolder>tasks</BuildOutputTargetFolder>
<IncludeBuildOutput>false</IncludeBuildOutput>
Copy link
Member

@ViktorHofer ViktorHofer Mar 6, 2026

Choose a reason for hiding this comment

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

I understand the reason for this change but this will cause the pdb to be omitted from the symbols package. We should chat with NuGet on how to correctly include the symbols in that scenario.

https://github.com/NuGet/NuGet.Client/blob/8deb76a20811f7b78531b66a1024cfe9e650cc69/src/NuGet.Core/NuGet.Build.Tasks/NuGet.Build.Tasks.Pack.targets#L382-L384

Copy link
Member

Choose a reason for hiding this comment

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

@zivkan are you the right contact for NuGet Pack questions? We are using TfmSpecificDebugSymbolsFile in L86 to include a pdb into the symbols package. That works well but now this PR changes the IncludeBuildOutput flag to false which makes the item not getting respected anymore (see link above). Can you please share guidance on how to do this "the right way"?

Copy link
Member

Choose a reason for hiding this comment

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

Unfortunately, Pack hasn't had much investment since I joined the team, so I've never had the opportunity to learn the breadth of features or common problems and solution. I'm also confident that the only "friendly" helper is pack as tool for .NET tools, but we need to make improvements for packing msbuild task packages, as well as roslyn analyzers. It's a gap.

Down on line 76, I see a pdb is being added via TfmSpecificPackageFile. I would have hoped that NuGet's existing logic to split the symbols package would make this work automatically. Can we check the CI build artifacts? If it doesn't work, there's another target that includes TfmSpecificDebugSymbolsFile: https://github.com/NuGet/NuGet.Client/blob/8deb76a20811f7b78531b66a1024cfe9e650cc69/src/NuGet.Core/NuGet.Build.Tasks/NuGet.Build.Tasks.Pack.targets#L471

Copy link
Member

Choose a reason for hiding this comment

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

</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == '$(NetFrameworkToolCurrent)'">
Expand Down Expand Up @@ -71,22 +71,27 @@
</ItemGroup>

<Target Name="AddPackContent">
<ItemGroup Condition="'$(TargetFramework)' == '$(NetCurrent)'">
<TfmSpecificPackageFile Include="$(ArtifactsBinDir)ef/$(Configuration)/$(NetMinimum)/*" PackagePath="tools/$(NetCurrent)" />
<TfmSpecificPackageFile Include="$(OutputPath)$(AssemblyName).deps.json" PackagePath="tasks/$(TargetFramework)" />
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETFramework'">
<TfmSpecificPackageFile Include="$(TargetPath)" PackagePath="tasks/net" />
<TfmSpecificPackageFile Include="$(TargetDir)$(TargetName).pdb" PackagePath="tasks/net" />
<TfmSpecificPackageFile Include="$(ArtifactsBinDir)ef/$(Configuration)/$(NetMinimum)/*" PackagePath="tools/net" />
<TfmSpecificPackageFile Include="$(OutputPath)$(AssemblyName).deps.json" PackagePath="tasks/net" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == '$(NetFrameworkToolCurrent)'">
<TfmSpecificPackageFile Include="$(OutputPath)*" Exclude="$(TargetPath);$(TargetDir)$(TargetName).pdb" PackagePath="tasks/$(TargetFramework)" />
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
<TfmSpecificPackageFile Include="$(OutputPath)*" PackagePath="tasks/netframework" />
</ItemGroup>

<ItemGroup>
<TfmSpecificDebugSymbolsFile Include="@(TfmSpecificPackageFile->WithMetadataValue('Extension', '.pdb'))"
TargetPath="/%(TfmSpecificPackageFile.PackagePath)/%(Filename)%(Extension)"
TargetFramework="$(TargetFramework)"
Condition="'$(IncludeSymbols)' == 'true'" />
<!-- Remove symbols from the non symbol package. -->
<TfmSpecificPackageFile Remove="@(TfmSpecificPackageFile->WithMetadataValue('Extension', '.pdb'))" />
<!--
The NuGet SDK only collects TfmSpecificDebugSymbolsFile when IncludeBuildOutput is true, but this
project sets IncludeBuildOutput=false. So as a workaround, we include PDBs in both packages.
-->
<!-- <TfmSpecificPackageFile Remove="@(TfmSpecificPackageFile->WithMetadataValue('Extension', '.pdb'))" /> -->
</ItemGroup>
</Target>

Expand Down
15 changes: 6 additions & 9 deletions src/EFCore.Tasks/Tasks/Internal/OperationTaskBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,18 +198,15 @@ protected override string GenerateCommandLineCommands()
args.Add(runtimeFrameworkVersion);
}

#if NET472
#elif NET11_0
#else
#error Target framework needs to be updated here
#endif
var packageRoot = Path.Combine(
Path.GetDirectoryName(typeof(OperationTaskBase).Assembly.Location)!,
"..",
"..");
args.Add(
Path.Combine(
Path.GetDirectoryName(typeof(OperationTaskBase).Assembly.Location)!,
"..",
"..",
packageRoot,
"tools",
"net11.0",
"net",
"ef.dll"));

args.AddRange(AdditionalArguments);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<Project ToolsVersion="17.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<_TaskTargetFramework Condition="'$(MSBuildRuntimeType)' == 'Core'">net11.0</_TaskTargetFramework>
<_TaskTargetFramework Condition="'$(MSBuildRuntimeType)' != 'Core'">net472</_TaskTargetFramework>
<_TaskTargetFramework Condition="'$(MSBuildRuntimeType)' == 'Core'">net</_TaskTargetFramework>
<_TaskTargetFramework Condition="'$(MSBuildRuntimeType)' != 'Core'">netframework</_TaskTargetFramework>
<_EFCustomTasksAssembly>$([MSBuild]::NormalizePath($(MSBuildThisFileDirectory),'..\tasks\$(_TaskTargetFramework)\$(MSBuildThisFileName).dll'))</_EFCustomTasksAssembly>
<EFScaffoldModelStage Condition="'$(EFScaffoldModelStage)'==''">publish</EFScaffoldModelStage>
<EFPrecompileQueriesStage Condition="'$(EFPrecompileQueriesStage)'==''">publish</EFPrecompileQueriesStage>
Expand Down
6 changes: 3 additions & 3 deletions src/EFCore.Tools/EFCore.Tools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ Update-Database
<ItemGroup>
<TfmSpecificPackageFile Include="tools/**/*" PackagePath="tools/" />
<TfmSpecificPackageFile Include="$(IntermediateOutputPath)*.psd1" PackagePath="tools/" />
<TfmSpecificPackageFile Include="$(ArtifactsBinDir)ef/$(Configuration)/$(TargetFramework)/ef.dll" PackagePath="tools/$(TargetFramework)/any" />
<TfmSpecificPackageFile Include="$(ArtifactsBinDir)ef/$(Configuration)/$(TargetFramework)/ef.runtimeconfig.json" PackagePath="tools/$(TargetFramework)/any" />
<TfmSpecificPackageFile Include="$(ArtifactsBinDir)ef/$(Configuration)/$(TargetFramework)/ef.pdb" PackagePath="tools/$(TargetFramework)/any" />
<TfmSpecificPackageFile Include="$(ArtifactsBinDir)ef/$(Configuration)/$(TargetFramework)/ef.dll" PackagePath="tools/net" />
<TfmSpecificPackageFile Include="$(ArtifactsBinDir)ef/$(Configuration)/$(TargetFramework)/ef.runtimeconfig.json" PackagePath="tools/net" />
<TfmSpecificPackageFile Include="$(ArtifactsBinDir)ef/$(Configuration)/$(TargetFramework)/ef.pdb" PackagePath="tools/net" />
</ItemGroup>

<ItemGroup>
Expand Down
3 changes: 1 addition & 2 deletions src/EFCore.Tools/tools/EntityFrameworkCore.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -1306,8 +1306,7 @@ function EF($project, $startupProject, $params, $applicationArgs, [switch] $skip
$projectAssetsFile = GetCpsProperty $startupProject 'ProjectAssetsFile'
$runtimeConfig = Join-Path $targetDir ($startupTargetName + '.runtimeconfig.json')
$runtimeFrameworkVersion = GetCpsProperty $startupProject 'RuntimeFrameworkVersion'
# TODO: Remove TFM from the path, issue #37473
$efPath = Join-Path $PSScriptRoot 'net10.0\any\ef.dll'
$efPath = Join-Path $PSScriptRoot 'net\ef.dll'

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

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

#if !NET10_0
#error Target framework needs to be updated here, as well as in Microsoft.EntityFrameworkCore.Tasks.props and EntityFrameworkCore.psm1
#endif
// TODO: Remove TFM from the path, issue #37473
args.Add(Path.Combine(toolsPath, "net10.0", "any", "ef.dll"));
args.Add(Path.Combine(toolsPath, "net", "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 @@ -69,12 +69,11 @@

<!-- PDBs are currently always included as PackAsTool packages don't support excluding them.
https://github.com/dotnet/sdk/issues/53226 -->
<!-- TODO: Remove TFM from the path, issue #37473 -->
<Target Name="AddEfProjectOutput">
<ItemGroup>
<TfmSpecificPackageFile Include="$(ArtifactsBinDir)ef/$(Configuration)/$(TargetFramework)/ef.dll" PackagePath="tools/$(TargetFramework)/any/tools/$(TargetFramework)/any" />
<TfmSpecificPackageFile Include="$(ArtifactsBinDir)ef/$(Configuration)/$(TargetFramework)/ef.runtimeconfig.json" PackagePath="tools/$(TargetFramework)/any/tools/$(TargetFramework)/any" />
<TfmSpecificPackageFile Include="$(ArtifactsBinDir)ef/$(Configuration)/$(TargetFramework)/ef.pdb" PackagePath="tools/$(TargetFramework)/any/tools/$(TargetFramework)/any" />
<TfmSpecificPackageFile Include="$(ArtifactsBinDir)ef/$(Configuration)/$(TargetFramework)/ef.dll" PackagePath="tools/$(TargetFramework)/any/tools/net" />
<TfmSpecificPackageFile Include="$(ArtifactsBinDir)ef/$(Configuration)/$(TargetFramework)/ef.runtimeconfig.json" PackagePath="tools/$(TargetFramework)/any/tools/net" />
<TfmSpecificPackageFile Include="$(ArtifactsBinDir)ef/$(Configuration)/$(TargetFramework)/ef.pdb" PackagePath="tools/$(TargetFramework)/any/tools/net" />
</ItemGroup>
</Target>

Expand Down
Loading