Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
391 views
in Technique[技术] by (71.8m points)

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

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

enter image description here

question from:https://stackoverflow.com/questions/65846137/how-can-i-add-a-reference-to-presentationcore-in-visual-studio-2019

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Set TargetFramework and UseWPF:

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...