How can I add a reference to PresentationCore in Visual Studio 2019?

Viewed 1311

How can I add a reference to PresentationCore to an existing .NET 5 class library?

enter image description here

1 Answers

Set TargetFramework and UseWPF:

<Project Sdk="Microsoft.NET.Sdk">
    <PropertyGroup>
        <TargetFramework>net5.0-windows</TargetFramework>
        <UseWPF>true</UseWPF>
    </PropertyGroup>
</Project>
Related