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

[2.0] Describe AssetTargetFallback #2816

Closed
guardrex opened this issue Aug 2, 2017 · 10 comments · Fixed by #17392
Closed

[2.0] Describe AssetTargetFallback #2816

guardrex opened this issue Aug 2, 2017 · 10 comments · Fixed by #17392
Assignees
Milestone

Comments

@guardrex
Copy link
Contributor

guardrex commented Aug 2, 2017

Similar to the request to surface AssetTargetFallback in https://github.com/NuGet/docs.microsoft.com-nuget/issues/410, which was prompted by a discussion regarding PackageTargetFallback here, there are a few topics over here that might (probably) need a smidgen of work ... a note? a section? a replacement? versioned content? ... something to surface it:

https://docs.microsoft.com/en-us/dotnet/core/tools/csproj#packagetargetfallback
https://docs.microsoft.com/en-us/dotnet/core/tools/project-json-to-csproj#imports

Cross ref: Documenting .NET Core MSBuild targets and properties/CSPROJ (2642)

@dasMulli
Copy link
Contributor

dasMulli commented Aug 2, 2017

Note that especially when upgrading to 2.0, users might see this error if they have been using PackageTargetFallback :

error NU1003: PackageTargetFallback and AssetTargetFallback cannot be used together. Remove PackageTargetFallback(deprecated) references from the project environment.

see https://github.com/dotnet/cli/issues/6952.
TL;DR unless DisableImplicitAssetTargetFallback is set to true, .NET Core and .NET Standard >= 2.0 projects will implicitly have their AssetTargetFallback set to include net461 (see source).

The only docs I found are in a table at the bottom of https://github.com/NuGet/Home/wiki/Enable-.NET-Core-2.0-projects-to-work-with-.NET-Framework-4.6.1-compatible-packages

@guardrex guardrex changed the title [2.0] Describe AssetsTargetFallback [2.0] Describe AssetTargetFallback Aug 2, 2017
@dasMulli
Copy link
Contributor

dasMulli commented Aug 2, 2017

Some more context from dotnet/core#711 (comment)

by @rrelyea:

We have since improved that error to:
PackageTargetFallback is deprecated. Replace PackageTargetFallback references with AssetTargetFallback in the project environment.

More details...PackageTargetFallback worked like imports did in Project.json.
The teams have realized that our implementation of that wasn't ideal.
In order to not break old projects/packages -- we created AssetTargetFallback which is implicitly set for netcoreapp/netstandard2.0 projects via targets.
Some project templates, in the past, used PackageTargetFallback.
When upgrading those projects to v2.0, you end up with both PTF and ATF in effect. Thus we error.
Ideally, you just move to ATF from your existing PTF.

@mairaw
Copy link
Contributor

mairaw commented Aug 12, 2017

Thank you @guardrex and @dasMulli for the info. I'll try to squeeze this one in asap after I'm done with some other high pri work.

@dasMulli
Copy link
Contributor

btw I put up a Q&A post on stack overflow back in august to at least have some info dealing with NU1003 there and it is still showing activity (visits/votes)
https://stackoverflow.com/questions/45569378/upgrading-to-net-core-2-0-packagetargetfallback-and-assettargetfallback-cannot/45569379

@guardrex
Copy link
Contributor Author

You see @mairaw why I nominated @dasMulli for MVP??!!

He's soooooo good that he can answer his own SO questions!

... well ... either that or he's a clone! 👽 😀

@mairaw
Copy link
Contributor

mairaw commented Dec 1, 2017

Thanks guys! Sorry for the delay. 😢

@BillWagner
Copy link
Member

raising priority as this has bumped several times.

@mairaw mairaw modified the milestones: 2018 - Quarter 2, Sprint 138 (07/02/2018 - 07/20/2018) Jun 18, 2018
@dasMulli
Copy link
Contributor

btw in 15.8+ MSBuild will also honour the AssetTargetFallback value for P2P references - dotnet/msbuild#3205.

@ViktorHofer
Copy link
Member

Please document AssetTargetFallback as soon as time allows.

@rrelyea
Copy link
Contributor

rrelyea commented Jan 15, 2019

Created a PR to add some details of AssetTargetFallback to NuGet docs:
NuGet/docs.microsoft.com-nuget#1264

@mairaw mairaw assigned gewarren and unassigned mairaw Feb 21, 2020
@BillWagner BillWagner modified the milestones: Backlog, March 2020 Mar 2, 2020
@BillWagner BillWagner added P1 and removed P0 labels Mar 5, 2020
gewarren added a commit to gewarren/docs that referenced this issue Mar 9, 2020
gewarren added a commit that referenced this issue Mar 10, 2020
* fixes #2816; document AssetTargetFallback

* review on staging

* Apply suggestions from nikolche

Co-Authored-By: Nikolche Kolev <nikolev@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants