1

I'm trying to add DiffSharp.Backends.Torch package to my MS Visual Studio 2022 project, but says I only have .NET5.0 installed, despite having installed .NET SDK 6.0 and 7.0, but these do not show up as available options when creating new projects, any ideas why?

See exact error message below: Severity Code Description Project File Line Suppression State Error NU1202 Package DiffSharp.Backends.Torch 1.0.7 is not compatible with net5.0 (.NETCoreApp,Version=v5.0). Package DiffSharp.Backends.Torch 1.0.7 supports: net6.0

Loco Barocco
  • 121
  • 7
  • 1
    You need to update `` section inside project file to target `net6.0`. Dotnet doesn't automatically roll forward onto newest installed version – JL0PD Oct 25 '22 at 10:42
  • I use VS 2022 Professional, and I believe it takes care of installing the needed stuff. If you installed it separately, might that become a problem? It's a wild guess on my part. – Bent Tranberg Oct 25 '22 at 16:00
  • I thought Visual Studio 2022 included .NET6.0, however I had previously installed it manually to be on the safe side. I adjusted as described above which made it appear in project properties and allowed downloading nuget packages, but it still seems like VS still cannot find the SDK files when compiling the project, hence the bin folder is empty and nothing to be executed. Now when trying to compile, I get the following error message: "NETSDK1045 The current .NET SDK does not support targeting .NET 6.0. Either target .NET 5.0 or lower, or use a version of the .NET SDK that supports .NET 6.0" – Loco Barocco Oct 26 '22 at 02:29
  • Adding a global.json to the project directory was the only way to make it work actually! – Loco Barocco Oct 26 '22 at 03:24

0 Answers0