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

Improve KnownFrameworkReference workarounds in templatetests.props.in #14895

Closed
wtgodbe opened this issue Oct 10, 2019 · 8 comments
Closed

Improve KnownFrameworkReference workarounds in templatetests.props.in #14895

wtgodbe opened this issue Oct 10, 2019 · 8 comments
Assignees
Labels
affected-very-few This issue impacts very few customers area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework Done This issue has been fixed enhancement This issue represents an ask for new feature or an enhancement to an existing one severity-nice-to-have This label is used by an internal tool
Milestone

Comments

@wtgodbe
Copy link
Member

wtgodbe commented Oct 10, 2019

462acbe#diff-a0bc203ab59b1a2f006b56858a20684b removed the TargetFramework metadata from the KnownFrameworkReference workarounds in templatetests.props.in. We need these workarounds in order to reference the desired versions of Microsoft.Netcore.App (the one we depend on in versions.props, rather than the one the SDK depends on). However, the current workaround modifies the metadata for all KnownFrameworkReference items for Microsoft.Netcore.App/Microsoft.AspNetcore.App, rather than just the ones that match the TFM of the desired reference version. This is because, during the build of the template test projects, conditions on Item metadata give the following error:

error MSB4191: The reference to custom metadata "TargetFramework" at position 1 is not allowed in this condition "'%(TargetFramework)' == 'netcoreapp3.1'".

This happens for both of the following conditions:

Condition="'%(TargetFramework)' == '${DefaultNetCoreTargetFramework}'"

Condition="'%(KnownFrameworkReference.TargetFramework)' == '${DefaultNetCoreTargetFramework}'"

We should investigate why this error occurs only in the template tests, and what we can do to work around it so that we can apply this condition to the update. It's worth noting that the same workaround appears in release/3.1, so we should decide if it's worth fixing there as well.

CC @dougbu @JunTaoLuo @Pilchie

@wtgodbe wtgodbe added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Oct 10, 2019
@wtgodbe wtgodbe added this to the 5.0.0 milestone Oct 10, 2019
@wtgodbe wtgodbe self-assigned this Oct 10, 2019
@dougbu
Copy link
Member

dougbu commented Oct 10, 2019

@rainersigwald any suggestions on avoiding the error @wtgodbe describes above?

@rainersigwald
Copy link
Member

You can't do that kind of metadata expansion in a condition outside of a target. Can you move the filtering operation to a target?

@dougbu
Copy link
Member

dougbu commented Jan 27, 2020

@wtgodbe anything new for this issue?

@wtgodbe
Copy link
Member Author

wtgodbe commented Jan 29, 2020

Not yet, we can keep this in backlog for now

@BrennanConroy BrennanConroy modified the milestones: 5.0.0, 5.0.0-rc1, Backlog Jul 27, 2020
@ghost
Copy link

ghost commented Jul 27, 2020

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@dougbu dougbu assigned dougbu and unassigned wtgodbe Nov 4, 2020
@dougbu
Copy link
Member

dougbu commented Nov 4, 2020

Taking this because it's addressed in #27473

@dougbu
Copy link
Member

dougbu commented Nov 4, 2020

To clarify: The templates used in the GenerateFiles project introduced in #26788 avoided updates to all @(KnownFrameworkReference) items using WithMetadataValue(...) item function calls, avoiding unsupported Conditions. #27473 finishes the job because it uses the GenerateFiles output for the project template test assets.

@wtgodbe wtgodbe added affected-very-few This issue impacts very few customers enhancement This issue represents an ask for new feature or an enhancement to an existing one severity-nice-to-have This label is used by an internal tool labels Nov 12, 2020 — with ASP.NET Core Issue Ranking
@dougbu
Copy link
Member

dougbu commented Dec 3, 2020

5fd1db2

@dougbu dougbu closed this as completed Dec 3, 2020
@dougbu dougbu added the Done This issue has been fixed label Dec 3, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Jan 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affected-very-few This issue impacts very few customers area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework Done This issue has been fixed enhancement This issue represents an ask for new feature or an enhancement to an existing one severity-nice-to-have This label is used by an internal tool
Projects
None yet
Development

No branches or pull requests

4 participants