Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssetTargetFallback doesn't work if a package author forgot a TFM on one asset group #6932

Open
ericstj opened this issue May 14, 2018 · 1 comment
Labels
Functionality:Restore Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Triage:Investigate
Milestone

Comments

@ericstj
Copy link

ericstj commented May 14, 2018

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).

The result was that package would only install the unconstrained assets and wouldn't trigger AssetTargetFallback. I know this is covered in the last row of https://github.com/NuGet/Home/wiki/Enable-.NET-Core-2.0-projects-to-work-with-.NET-Framework-4.6.1-compatible-packages but I want to raise this as a potential issue.

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:

  1. Make AssetTargetFallback always ignore TFM-less matches.
  2. Allow a project-wide property that says AssetTargetFallback should ignore TFM-less matches.
  3. Allow for per-package-reference metadata that says AssetTargetFallback should ignore TFM-less matches.
  4. 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.
@mishra14 mishra14 added this to the Backlog milestone May 15, 2018
@mishra14 mishra14 added the Priority:2 Issues for the current backlog. label May 15, 2018
@nkolev92 nkolev92 added Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. and removed Priority:2 Issues for the current backlog. labels Dec 2, 2021
@wtgodbe
Copy link

wtgodbe commented Nov 15, 2024

We just hit this in aspnetcore too: dotnet/aspnetcore#58995

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Functionality:Restore Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Triage:Investigate
Projects
None yet
Development

No branches or pull requests

6 participants