AssetTargetFallback doesn't work if a package author forgot a TFM on one asset group #6932
Labels
Functionality:Restore
Priority:3
Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog.
Triage:Investigate
Milestone
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:
UseAssets="net46"
orUseAssets="Dependencies=net46;Compile=net46"
etc.The text was updated successfully, but these errors were encountered: