You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AssetTargetFallback doesn't work if a package author forgot a TFM on one asset group #6932
I ran into a few packages which were designed to work only with net40 but the package author didn't constrain their build assets with the same TFM (eg: lib\net40\foo.dll, build\foo.targets). I've also seen similar packages where folks forgot to constrain their dependencies (eg: lib\net40\foo.dll, root dependencies with no TFM).
In the case I hit this issue I was able to use PackageTargetFallback instead but that's not a real solution since it's a global hammer and also something that @rrelyea mentioned NuGet wants to deprecate.
I had some other ideas and thought to propose them here as an alternative:
Make AssetTargetFallback always ignore TFM-less matches.
Allow a project-wide property that says AssetTargetFallback should ignore TFM-less matches.
Allow for per-package-reference metadata that says AssetTargetFallback should ignore TFM-less matches.
Allow for per-package-reference metadata to tell NuGet specifically which TFM to evaluate for assets within a package. For example UseAssets="net46" or UseAssets="Dependencies=net46;Compile=net46" etc.
Due to lack of recent activity, this issue has been marked as a candidate for icebox cleanup. It will be closed if no further activity occurs within 14 more days. If the issue receives enough upvotes, it will be flagged with Triage:NeedsTriageDiscussion for team review.
Activity
wtgodbe commentedon Nov 15, 2024
We just hit this in aspnetcore too: dotnet/aspnetcore#58995
dotnet-policy-service commentedon Nov 16, 2026
Due to lack of recent activity, this issue has been marked as a candidate for icebox cleanup. It will be closed if no further activity occurs within 14 more days. If the issue receives enough upvotes, it will be flagged with
Triage:NeedsTriageDiscussionfor team review.