Search code examples
c#uwpnugetprogress-barnuget-package

How do I determine .NET Framework needed for a particular NuGet package?


Using Nuget Package Manager in Visual Studio 2019 I attempted to install Microsoft.Toolkit.Uwp.UI.Controls and was met with this message/error:

Could not install package 'Microsoft.Toolkit.Uwp.UI.Controls 6.1.1'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.8', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

Unfortunately, I probably can't change the .NETFramework version (it's a shared project). However, it occurred to me that an earlier version of Microsoft.Toolkit.Uwp.UI.Controls might work just fine. But how does one determine which version of .NETFramework a particular version of Microsoft.Toolkit.Uwp.UI.Controls requires?

I suppose I could just start trying them and see what happens but that seems like a lot of work. Even if I do that, it's not clear how you figure out what version of .NETFramework it uses. This answer How to find out which .NET framework nuget package targets? , suggested looking in packages.config but all I see in that is:

<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Cake" version="0.37.0" />
</packages>

I'm doing all this because I'm trying to get a radial progress bar. See https://stackoverflow.com/questions/64866256/how-do-i-code-a-radial-progress-bar-for-wpf-c-app

Update

There is some information about Dependencies at the bottom of the Nuget Package Manager, as Michel pointed out. However, in my case, no mention is made of .NETFramework. See picture:

enter image description here


Solution

  • You can see the dependencies at the bottom om the info pane, in the NuGet package manager. The particular package you have chosen seem to be only for UWP apps, hence it depends on UAP.

    Nuget Package manager


    For packages requiring other frameworks it might look like this:

    Other Dependencies