Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How Can I use .NET Framework 4.8 on an WPF Class Library?

So I want to create an WPF Class Library but in the .NET Framework 4.8.
But in the creating I only get this two Frameworks to choose:

Version

How Can I get .NET Framework 4.8 in this to Choose?
Because when I just use the normal Class Library, without the WPF in the name I can only add an UserControl. I cant choose in that something like Ressource dictionary for example

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Choose

WPF User Control Library (.NET Framework)

or

WPF Custom Control Library (.NET Framework)

instead of

WPF Class Library

as project template.


Alternatively, replace

<PropertyGroup>
    <TargetFramework>net6.0-windows</TargetFramework>
    <Nullable>enable</Nullable>
    <UseWPF>true</UseWPF>
</PropertyGroup>

with

<PropertyGroup>
    <TargetFramework>net48</TargetFramework>
    <UseWPF>true</UseWPF>
</PropertyGroup>

in the project file (.csproj).


You can also support multiple target frameworks like this:

<TargetFrameworks>net6.0-windows;net48</TargetFrameworks>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading