0

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 How do I code a Radial Progress Bar for WPF/C# app

Thanks, Dave

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

Dave
  • 8,095
  • 14
  • 56
  • 99

1 Answers1

1

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

Michel Jansson
  • 1,803
  • 1
  • 13
  • 14
  • Thank you for the quick answer Michel. However, in this case, no .NETFramework information is shown. I'll update my question to show this. – Dave Nov 16 '20 at 22:45
  • @Dave, it does not mention .NET Framework, since it relies on UAP (as circled in red), which is another target framework than .NET Framework, specific to UWP apps. For a package to work for you with .NETFramework, it would have to look similar to what you see in the second picture. – Michel Jansson Nov 16 '20 at 22:55
  • Ah! got it now. Gratefully marked as answer! I don't think I'll have the option of adding UWP references (I know that a WPF .NET Framework app can use UWP stuff, possibly with some work) so I hope I get answers to my other question: See: https://stackoverflow.com/questions/64866256/how-do-i-code-a-radial-progress-bar-for-wpf-c-app If it is VERY easy to add UWP support and thus the Microsoft.Toolkit.Uwp.UI.Controls, please let me know. Thanks! – Dave Nov 16 '20 at 23:57