I have a project in Visual Studio 2019 that I am migrating from .NET Framework 4.6 to .NET Core 3.1.
I used the guide from Microsoft to port my project, described here. I ran the Portability Analyzer and it showed, that the project is to 100% portable.
But every dependency to System.Windows doesn't work anymore. For example I use System.Windows.Rect
. In the official documentation it clearly states that it is available for .NET Core 3.1.
In the code however it marks Rect with "The type or namespace name 'Rect' could not be found(are you missing a using directive or an assembly reference?)" and on the top it marks my using System.Windows
grey with the message "Using directive is unnecessary".
This error applies to many things in my code, like System.Windows.ResourceDictionary
, System.Windows.Application.Current
, System.Windows.Point
, ...
So for some reasons it seems that I can't use System.Windows
, even if the using itself seems to work fine.
I searched for System.Windows
in the NuGet package manager and googled it, but couldn't find anything.
So here is my question: How can I use System.Windows
in a .NET Core 3.1 project with Visual Studio 2019? My guess at the moment is, that I need to manually include the assembly WindowsBase.dll
but in my installation directory (C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional
) I can only find one at C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\Extensions\Microsoft\LiveShare\Agent
and it doesn't seem to be the right one.