Remove checked-in nuspec files to resolve build issues#37826
Remove checked-in nuspec files to resolve build issues#37826
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 <[email protected]>
Co-authored-by: AndriySvyryd <[email protected]>
|
@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 <[email protected]>
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 <[email protected]>
Co-authored-by: AndriySvyryd <[email protected]>
Co-authored-by: AndriySvyryd <[email protected]>
…nline task Co-authored-by: AndriySvyryd <[email protected]>
Co-authored-by: AndriySvyryd <[email protected]>
Co-authored-by: AndriySvyryd <[email protected]>
AndriySvyryd
left a comment
There was a problem hiding this comment.
@copilot Update description with a nice summary of the changes
…, simplify PDB handling, add lib/_._ Co-authored-by: AndriySvyryd <[email protected]>
Updated in the PR description checklist. Note: I can only update the description through the |
|
@copilot Update PR progress with a nice summary of the changes |
Done — PR description updated with a full summary covering: removed nuspec files, per-project csproj changes (AddEfProjectOutput/AddPackContent targets, ExcludePdbFiles, Design dependency handling), PACKAGE.md→README.md renames, eng/CreateSymbolsPackage.targets two-pass approach, cross-platform path fixes, and expected package content differences. |
AndriySvyryd
left a comment
There was a problem hiding this comment.
@copilot Also remove the explicit PackageReadmeFile from EFCore.Analyzers.csproj
…version to 10.0.0, remove explicit PackageReadmeFile from Analyzers Co-authored-by: AndriySvyryd <[email protected]>
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. |
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.