-
Notifications
You must be signed in to change notification settings - Fork 389
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 #5996
Comments
This is an MSBuild issue, please open it against http://github.com/microsoft/msbuild. I'd move the issue but I can't across orgs. |
@Anipik did you open an issue in msbuild as David suggested? Can't find one. |
no i missed his comment, i am just doing it right now. |
@davkean are you sure this is an MSBuild issue? I believe MSBuild is behaving correctly. The problem is that the project system ends up setting a local property rather than a global property: Lines 41 to 59 in 600486b
This results in an inconsistency between what the SDK does in an actual build (global property) vs what the project system does in the design time build (local property). |
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
similar issue OmniSharp/omnisharp-roslyn#1738
The text was updated successfully, but these errors were encountered: