如何在 Visual Studio 2019 中添加对 PresentationCore 的引用?

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

如何将对 PresentationCore 的引用添加到现有的 .NET 5 class 库?

设置TargetFrameworkUseWPF:

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