Skip to content

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

@rainersigwald

Description

@rainersigwald

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-External-CPSOwned by CPS and not this repo. Likely be closed in lieu of issue filed against VS platform.Triage-Won't-FixThe bug is minor, against project direction or the risk of fixing it outweighs the benefit.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions