ExcludeAssets="Runtime" should not remove frameworkAssemblies #13951
Labels
Functionality:Restore
Partner:DotNet
Priority:3
Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog.
Style:PackageReference
Type:Bug
NuGet Product Used
dotnet.exe
Product Version
dotnet 9.0.100
Worked before?
Don't know
Impact
It's more difficult to complete my work
Repro Steps & Context
Build a project targeting .NET framework and referencing
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
For example:
Note that
System.ComponentModel.Annotations
contains Framework References and those are correctly resolve on .NETFramework when referenced normally.From NuSpec:
From Assets file:
Now add
ExcludeAssets="Runtime"
to the reference:NuGet removes the runtime asset, as expected, but also drops the
frameworkAssemblies
. The latter is incorrect. Framework Assemblies are not runtime assets, they are just references from the targeting pack. They need to be preserved as part of the compile assets.Verbose Logs
No response
The text was updated successfully, but these errors were encountered: