Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

7
  • You will also need to ensure you're running .NET 4.7.2 or 4.8, since otherwise the code is unable to default to TLS 1.2 through OS settings. Are you? Commented Aug 8, 2022 at 14:39
  • By default this example I tested it uses net 6.0. But I see this error also when I try to use Nuget package manager console in Visual Studio (2022). Where should I check this for IDE itself? Commented Aug 8, 2022 at 14:40
  • Visual Studio 2022 itself is still a .NET 4.x application, so it should use the version of the .NET 4.x framework that's installed (there's only one and it's global). That said, if .NET 6 doesn't work it's probably not going to work there either, since 6 should definitely default to the OS, and I'm not sure what version of NuGet/framework would be used to restore packages if you're building a .NET 6 app -- VS is only the shell and I'd imagine the build system is the .NET 6 SDK throughout, including NuGet. Commented Aug 8, 2022 at 14:51
  • This is what baffles me. Even if the fact that devenv.exe is still a .Net 4.x app, why my core 6 app from the original question still throws an exception under windows 7? It works fine with Win 10 though. I think the issue is not with Visual Studio itself but with the OS and some missing update, I think. Nevertheless, the nuget url opens fine with a browser. I wonder if the old outdated IE would open it though. Commented Aug 8, 2022 at 17:22
  • It seems that the version of the package in this source( apiint.nugettest.org/v3-index/index.json) has not been updated, maybe you can try to use this source" api.nuget.org/v3/index.json". Commented Aug 10, 2022 at 5:01