Remove checked-in nuspec files to resolve build issues#37826
Remove checked-in nuspec files to resolve build issues#37826AndriySvyryd merged 21 commits intomainfrom
Conversation
- Remove dotnet-ef.nuspec, EFCore.Tools.nuspec, EFCore.Tasks.nuspec - Convert package customizations to MSBuild properties and targets - Add Microsoft.EntityFrameworkCore.Design to Directory.Packages.props - Use _PackageFiles items in targets to include ef project outputs - Add PrivateAssets="all" to ef ProjectReference to prevent dependency leakage - Use ProjectReference to EFCore.Design for Tasks dependency Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
|
@copilot To validate, compare the content of the affected NuGet before and after the fix, they should match exactly, however, it's acceptable if the versions change to |
…ks, add Pack=false to framework refs Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Validated in commit ccbce7a. Comparison summary: EFCore.Tasks — only EFCore.Tools — dotnet-ef — Nuspec metadata — |
|
@copilot Rename every PACKAGE.md to README.md |
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
…nline task Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
…version to 10.0.0, remove explicit PackageReadmeFile from Analyzers Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
0a520ba to
b89d49d
Compare
|
The default targets include the additional pdbs in the main package. This is needed to only include them in he symbols package. |
|
For the default globs, pdbs are already filtered out automatically by NuGet when constructing the "main" package. When you add additionally stuff, you want to condition that on |
|
Btw, we should use the officially documented extension points here: https://learn.microsoft.com/en-us/nuget/reference/msbuild-targets#advanced-extension-points-to-create-customized-package. Everything else has couple of issues. |
|
Happy to help. I hope pushing a few commits here is OK. |
Please go ahead if you can get it to work. |
| <ItemGroup> | ||
| <PackageReference Include="Microsoft.DotNet.Build.Tasks.Templating" PrivateAssets="All" /> | ||
| <PackageReference Include="Microsoft.DotNet.Build.Tasks.Templating" PrivateAssets="all" /> | ||
| <PackageReference Include="Microsoft.EntityFrameworkCore.Design" VersionOverride="8.0.0" /> |
There was a problem hiding this comment.
@AndriySvyryd this change is questionable. What's the intent? Why 8.0.0?
There was a problem hiding this comment.
See my last commit. I added a stub project that makes referencing the live EFCore.Design work from this project, even though it targets net10.0. This is a hack though. I'm not sure why this design was chosen in the first place.
There was a problem hiding this comment.
The tools need to work with older versions of EF and 8.0.0 is currently the oldest supported version. Referencing the live one will break support for net8.0 apps, see #37515 (comment)
However, I do realize this is brittle anyway, so #37739 tracks removing it and forcing the user to add this dependency themselves, I just wanted to do it in a separate PR to allow this to be checked in quicker.
There was a problem hiding this comment.
This is a change to the current package on nuget.org. Why adding a placeholder file?
There was a problem hiding this comment.
For same reason as the .Tools package. But this is also likely going to be removed.
| <IncludeSymbols>true</IncludeSymbols> | ||
| </PropertyGroup> | ||
|
|
||
| <!-- PDBs are currently always included as PackAsTool packages don't support excluding them. |
There was a problem hiding this comment.
Yes, this is the reason why I had added the workaround to build the symbols package in the second pass
There was a problem hiding this comment.
Not necessary to do anything here. This is the same as the latest released package on nuget.org. When the sdk issue will be adressed, efcore will automatically benefit.
|
@AndriySvyryd ready to merge? |
|
I'd prefer to use the workaround that avoids symbols in the main package, but we can merge this now to unblock VMR |
|
We should truely fix this in sdk so that everyone benefits from it. Don't workaround it. |
Fixes #36254
Fixes #33165
Removes checked-in
.nuspecfiles fordotnet-ef,EFCore.Tools, andEFCore.Tasksand replaces them with MSBuild properties and_PackageFilestargets. This fixes build breaks with newer SDKs where the nuspec files causeNU5000errors due to missing package type name attributes.Changes Made
src/dotnet-ef/dotnet-ef.nuspec,src/EFCore.Tools/EFCore.Tools.nuspec,src/EFCore.Tasks/EFCore.Tasks.nuspecNuspecFile/SetPackagePropertieswith anAddEfProjectOutputtarget that uses_PackageFilesto include ef.csproj output (dll, exe, pdb, runtimeconfig) at the correct package paths. AnExcludePdbFilestarget strips all PDB files from the main package; they are included only in the symbols packageNuspecFile/SetPackagePropertieswith anAddPackContenttarget for lib, tools, psd1, and ef.csproj output (including PDB files). AnExcludePdbFilestarget strips PDBs from the main package. AddedMicrosoft.EntityFrameworkCore.Designas aPackageReferencewithVersionOverride="8.0.0"for the dependency declarationNuspecFile/SetPackagePropertieswith anAddPackContenttarget for lib, tasks, tools, and buildTransitive content. Added aProjectReferencetoEFCore.DesignwithPrivateAssets="all"(for build ordering) and a separatePackageReferencewithVersionOverride="10.0.0"for the nuspec dependency. SetSuppressDependenciesWhenPacking=truefor net472 andPack=falseon .NET Framework References to suppress unwanted dependency groups. Addedlib/net10.0/_._marker file to ensure the package is recognized as targeting net10.ExcludePdbFilestarget andeng/CreateSymbolsPackage.targetsimport for symbols package creationPACKAGE.mdfiles toREADME.mdacrosssrc/andtest/directories (22 files) and updatedDirectory.Build.targetsto auto-detectREADME.mdinstead ofPACKAGE.md.symbols.nupkgvia a secondMSBuild Packcall with_IsSymbolsPack=true. PDB files are included unconditionally in_PackageFiles, and each project has anExcludePdbFilestarget that strips all.pdbfiles by extension when_IsSymbolsPack != true. This ensures the main package nuspec is generated without PDB references, while the symbols package includes them correctly. Uses$([MSBuild]::NormalizeDirectory(...))for cross-platform path handling. Imported bydotnet-ef.csproj,EFCore.Tools.csproj, andEFCore.Tasks.csprojPackageReadmeFileproperty (auto-detected byDirectory.Build.targets)_PackageFilesInclude attributes use/instead of\for filesystem paths to ensure compatibility on non-Windows buildsPackage Content Comparison
Package contents were compared before and after the change. Remaining differences are expected SDK behavior changes:
README.mdat the package root (previouslydocs/PACKAGE.md)dotnet-efbinary no longer in package (SDK explicitly removes AppHost for RID-neutral tool packages perMicrosoft.NET.PackTool.targets)exclude="Build,Analyzers"added by SDK on Design dependency (default for PackageReferences); empty.NETFramework4.7.2dependency group in Tasks (functionally identical to no group)💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.