-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Report TFM via GetTargetFrameworks if TF undefined #3550
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
Report TFM via GetTargetFrameworks if TF undefined #3550
Conversation
Prior to this change, ProjectReferences to non-SDK projects did not report a `TargetFrameworks` list to the referencing project because prior to the .NET Core SDK, the TFM for a project was defined in `$(TargetFrameworkMoniker)` as the long form of the moniker. Fixes dotnet#3546 by falling back to the legacy TFM in the included-in-all- projects copy of `GetTargetFrameworks`.
bf910ee to
c139abb
Compare
| <_ThisProjectBuildMetadata Include="$(MSBuildProjectFullPath)"> | ||
| <TargetFrameworks Condition="'$(TargetFrameworks)' != ''">$(TargetFrameworks)</TargetFrameworks> | ||
| <TargetFrameworks Condition="'$(TargetFrameworks)' == ''">$(TargetFramework)</TargetFrameworks> | ||
| <TargetFrameworks Condition="'$(TargetFrameworks)' == '' and '$(TargetFramework)' == ''">$(TargetFrameworkMoniker)</TargetFrameworks> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably needs to respect NuGetTargetMoniker for UWP at least where it is distinct from TargetFrameworkMoniker. But see weirdness with old school PCL in ReferrringTargetFrameworkMonikerForProjectReferences (not sure if I got the exact mouthful right from memory).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
I forget why we aren't doing this... |
|
Oh, I didn't mean to close this, it auto closed when I deleted the target branch. Looks like I can't reopen it, so I'll have to open a new PR. Current status is that I'm pretty sure this breaks legacy VS projects, but need to double-check. |
|
OK, I remember you said it might not be compatible, but I didn't remember a final conclusion. Makes sense now. |
|
Opened #3620 so I don't forget about this. |
Prior to this change, ProjectReferences to non-SDK projects did not
report a
TargetFrameworkslist to the referencing project becauseprior to the .NET Core SDK, the TFM for a project was defined in
$(TargetFrameworkMoniker)as the long form of the moniker.Fixes #3546 by falling back to the legacy TFM in the included-in-all-
projects copy of
GetTargetFrameworks.