Skip to content

Visual Studio and MSBuild net4x TFM builds use legacy PresentationBuildTasks.dll when using WindowsDesktop SDK #1998

@vatsan-madhavan

Description

@vatsan-madhavan

When building WPF projects targeting net4x TFM and using the WindowsDesktop SDK in Visual Studio or MSBuild, legacy PresentationBuildTasks.dll (i.e, the one that shipped with .NET Framework, and installed in GAC) is used for Markup Compilation.

This behavior is wrong - and not what is intended. The correct behavior is to use the copy of PresentationBuildTasks.dll that ships with the .NET Core SDK under 3.0.100\SDKs\Microsoft.NET.Sdk.WindowsDesktop\tools\net472\PresentationBuildTasks.dll

Repro:

# Launch Visual Studio 2019 Developer Command Prompt
dotnet new globaljson --sdk-version 3.0.100
dotnet new wpf --target-framework-override net472
msbuild /bl 
// Inspect the logs; Search for $task MarkupCompilePass1
// Observed: PresentationBuildTasks, Version 4.0.0.0 is used from the .NET Framework GAC  
// Expected: 3.0.100\SDKs\Microsoft.NET.Sdk.WindowsDesktop\tools\net472\PresentationBuildTasks.dll from .NET Core 3.0 SDK should be used

Metadata

Metadata

Labels

BugProduct bug (most likely)rank20Rank: Priority/rank on a scale of (1..100)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions