Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

wpf

.net-5

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

enter image description here

like image 980
AxD Avatar asked Oct 19 '25 14:10

AxD


1 Answers

Set TargetFramework and UseWPF:

<Project Sdk="Microsoft.NET.Sdk">
    <PropertyGroup>
        <TargetFramework>net5.0-windows</TargetFramework>
        <UseWPF>true</UseWPF>
    </PropertyGroup>
</Project>
like image 166
Clemens Avatar answered Oct 22 '25 10:10

Clemens