Click here to Skip to main content
15,615,469 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

I am making some extension methods that extend System.Windows.Media.Color

I was trying to include them in a .Net 6 class library to use them across multiple projects,

But I couldn't add reference to the required namespace.

What I have tried:

1. Searched for nuget packages that contains PresentationCore or System.Windows.Media
Updated 16-Jun-22 2:41am

Quote from MSDN:
The requested page is not available for .NET 6. You have been redirected to the newest product version this page is available for.
It would appear that this namespace is not part of .NET 6.
Share this answer
Richard Deeming 6-Dec-21 5:06am    
The documentation says that it is:
Color Struct (System.Windows.Media) | Microsoft Docs[^]
Windows Desktop: 3.0, 3.1, 5.0, 6.0
Richard MacCutchan 6-Dec-21 5:10am    
That is for Windows Desktop 6. If I change the framework selector to .NET 6 it gives the error message quoted above. Is Desktop 6 the same as .NET 6?
Richard Deeming 6-Dec-21 5:13am    
AFAIK, the desktop SDK is a specific type of .NET 6 project.
Richard MacCutchan 6-Dec-21 5:15am    
It gets more confusing by the day.
I Think you have to:

target net6-windows,

add <usewpf>true in you project file .csroj, .vbproj or fsproj, etc. and
restore it.


<project sdk="Microsoft.NET.Sdk">





Share this answer
Install System.Windows.Extensions through NuGet PM
Install-Package System.Windows.Extensions -Version 6.0.0
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900