[release/3.1] Use correct PresentationBuildTasks.dll for VS and MSBuild builds#2075
Merged
1 commit merged intodotnet:release/3.1from Oct 22, 2019
Merged
Conversation
rladuca
approved these changes
Oct 22, 2019
… not being used for msbuild based builds (i.e., when `$(MSBuildRuntimeType)==Full`) of WPF projects that use WindowsDesktop SDK. Instead, the PresentationBuildTasks.dll from GAC, i.e., the DLL that shipped with .NET Framework, is being used for builds instead. This is because the *first* occurance of an `UsingTask` element that applies to a `TaskName` will always be used - it can not be overridden by subsequent `UsingTask` entries (this is unlike `Property` and `Item` behavior). See note in https://github.com/MicrosoftDocs/visualstudio-docs/blob/master/docs/msbuild/usingtask-element-msbuild.md immediate after the **Syntax** section (Note: The msbuild team added this note after identifying this behavior as part of investiaging this PresentationBuildTasks.dll issue). The fix ensures that the `UsingTask` declarations supplied by the WindowsDesktop SDK precede those supplied by .NET Framework's copy of `Microsoft.WinFX.targets` by introducing a new `.props` file - `Microsoft.WinFX.props` - and moving a small number of `Property` and `UsingTask` declartions into it. Since `.props` are imported before `targets`, the `UsingTask` declarations supplied by WindowsDesktop SDK will thus take precedence.
d6a347e to
8f14852
Compare
|
Hello @vatsan-madhavan! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Port of #1999
Fixes #1998
Description
The PresentationBuildTasks.dll built out of the .NET Core codebase is not being used for msbuild based builds (i.e., when
$(MSBuildRuntimeType)==Full) of WPF projects that use WindowsDesktop SDK. Instead, the PresentationBuildTasks.dll from GAC, i.e., the DLL that shipped with .NET Framework, is being used for builds instead.This is because the first occurance of an
UsingTaskelement that applies to aTaskNamewill always be used - it can not be overridden by subsequentUsingTaskentries (this is unlikePropertyandItembehavior). See note in https://github.com/MicrosoftDocs/visualstudio-docs/blob/master/docs/msbuild/usingtask-element-msbuild.md immediate after the Syntax section (Note: The msbuild team added this note after identifying this behavior as part of investiaging this PresentationBuildTasks.dll issue).This fix ensures that the
UsingTaskdeclarations supplied by the WindowsDesktop SDK precede those supplied by .NET Framework's copy ofMicrosoft.WinFX.targetsby introducing a new.propsfile -Microsoft.WinFX.props- and moving a small number ofPropertyandUsingTaskdeclartions into it. Since.propsare imported beforetargets, theUsingTaskdeclarations supplied by WindowsDesktop SDK will thus take precedence.Note that
Pbt.propsis used only for building this repo - it doesn't ship.Customer Impact
Multi-targeted builds targeting .NET Framework will be produced incorrectly under some conditions, specifically when building using VS. There may be no problems initially due to the strong backwards compatibility between .NET Core and .NET Framework WPF assemblies - but errors in XAML/markup compilation may lead to hard-to-identify/debug problems.
Regression
Not a regression. This was a missed corner case not caught until now.
Risk