1

I'm trying to build a console project (.NetCore 3.1) to run the matrix multiplication example.

The issue is the following with VS2109

  • using System.Windows.Media; (VS2019 suggest me to remove the ".Media")

Just by looking at the Microsoft documentation on the web, can you explain how can I find the package to use.

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
Jean-Marc Flamand
  • 939
  • 3
  • 10
  • 24

1 Answers1

4

Firstly, scroll down to the bottom of the page, to "Applies to". You can see that it's already built into .NET 3.0+ and .NET Core 3.0+:

Applies to

Fine, so we don't need to install a NuGet package to use it on .NET Framework and .NET Core. So what DLL is it in?

Take a look at the top of the page:

Namespace and Assembly

We can see that it's in WindowsBase.dll.

Provided that you're using .NET Framework or .NET Core 3.0+, you can add a reference to WindowsBase:

Reference Manager

canton7
  • 37,633
  • 3
  • 64
  • 77
  • ok, need additional help to reference properly the right dll. Using the Reference Manager (VS2019) I was not able to find "WindowsBase.dll" using the search in "COM". Before to Browse, I did use "windows explorer" and found dozens of “WindowsBase.dll” in my computer using windows explorer. Which one should I select to make sure that when Microsoft perform update on my computer that “dll” will be updated if there is and update to perform? – Jean-Marc Flamand Jan 14 '20 at 13:57
  • Look in "Assemblies" for "WindowsBase" (no ".dll"). I've edited my answer. – canton7 Jan 14 '20 at 13:59
  • ok "Assemblies" is not an option in my Reference Manager. I'm using Microsoft Visual Studio Community 2019 Version 16.4.2. Additional info - In my console project the Dependencies refer to Frameworks/Microsoft.NetCore.app. – Jean-Marc Flamand Jan 14 '20 at 14:17
  • What are you targetting? .NET Core 3.0? In your csproj, what's your ``? – canton7 Jan 14 '20 at 14:22
  • Exe netcoreapp3.1 – Jean-Marc Flamand Jan 14 '20 at 14:24
  • Ah, confusingly, it looks like it's only available in .NET Core as part of a WPF application. (I don't know of an easy way to find out that - I had to go googling). Although there is a hint [here](https://learn.microsoft.com/en-us/dotnet/api/system.windows.media?view=netframework-4.8) – canton7 Jan 14 '20 at 14:32
  • Thanks, I will do a WPF project instead. – Jean-Marc Flamand Jan 14 '20 at 14:44