Use correct PresentationBuildTasks.dll for VS and MSBuild builds#1999
Merged
vatsan-madhavan merged 1 commit intodotnet:masterfrom Oct 8, 2019
Merged
Use correct PresentationBuildTasks.dll for VS and MSBuild builds#1999vatsan-madhavan merged 1 commit intodotnet:masterfrom
vatsan-madhavan merged 1 commit intodotnet:masterfrom
Conversation
… 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.
|
I don't know how that happened because the old PBT was breaking hard on System.Runtime as core assembly. |
|
We had workarounds in place just to be able to use the old PBT |
|
Oh, when the target framework is net4x! |
Member
Author
|
Fixed issue description. Yeah - this is limited to netfx TFM’s. |
nguerrera
approved these changes
Oct 4, 2019
rladuca
approved these changes
Oct 4, 2019
Member
Author
Sorry, that's not right. This is not limited to netfx TFM's. See #1998 (comment). |
|
I think that it was right. See my comments. |
Member
Author
you're right! |
This was referenced Oct 22, 2019
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.
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).The 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.Addresses #1998
This needs to be ported to release/3.1 and release/3.0 (servicing).