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

Design Time Builds failing if we have some derived properties in Implicit or leading imports #6143

Closed
rainersigwald opened this issue Apr 29, 2020 · 8 comments
Labels
Area-External-CPS Owned by CPS and not this repo. Likely be closed in lieu of issue filed against VS platform. Triage-Won't-Fix The bug is minor, against project direction or the risk of fixing it outweighs the benefit.

Comments

@rainersigwald
Copy link
Member

From @Anipik on Monday, April 27, 2020 8:50:43 PM

In case of multple TargetFrameworks, DesignTimeBuild uses msbuild setproperty function to set the TargetFramework property.

So this updates a property if it exists, otherwise it searches for the first unconditioned PropertyGroup in the project file to add the property to. This is always going to be after any implicit imports as well as explicitly leading imports. This appears to be the long-standing behavior of SetProperty. Contrast that to SetGlobalProperty, which will treat the property as global.

Hence any property derived from targetFramework in implicit imports and leading imports will not be evaluated correctly.

There is a detail repro here dotnet/runtime#33427 (comment)

cc @ericstj @ViktorHofer

similar issue OmniSharp/omnisharp-roslyn#1738

Copied from original issue: dotnet/msbuild#5319

@rainersigwald
Copy link
Member Author

Please let us know if you need a new API from MSBuild to fix this, we can work together if so.

@ericstj
Copy link
Member

ericstj commented May 1, 2020

@davkean please have a look. This is the same as #5996 which was moved to msbuild and now came back. I believe the bug here is that project system (or some service it uses) is calling SetProperty instead of SetGlobalProperty.

@davkean
Copy link
Member

davkean commented May 1, 2020

This is a core CPS bug and not this repo. I suspect looking at the code, they've done this because they have an existing project instance and can't change global properties. @lifengl?

@ViktorHofer
Copy link
Member

ping @lifengl

@jjmew jjmew added Triage-Won't-Fix The bug is minor, against project direction or the risk of fixing it outweighs the benefit. Area-External-CPS Owned by CPS and not this repo. Likely be closed in lieu of issue filed against VS platform. labels May 12, 2020
@jjmew
Copy link
Contributor

jjmew commented May 12, 2020

@ericstj You will need to file a bug in Azure Dev Ops under DevDiv\VS Core\Project as this is a CPS issue

@jjmew jjmew closed this as completed May 12, 2020
@ericstj
Copy link
Member

ericstj commented May 12, 2020

@Anipik can you please open the issue as @jjmew suggests?

@ViktorHofer
Copy link
Member

Please 'cc me in the issue as I'm interested in a near-term solution.

@Anipik
Copy link

Anipik commented May 12, 2020

sure i will do that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-External-CPS Owned by CPS and not this repo. Likely be closed in lieu of issue filed against VS platform. Triage-Won't-Fix The bug is minor, against project direction or the risk of fixing it outweighs the benefit.
Projects
None yet
Development

No branches or pull requests

6 participants