I am using VS2019 (16.4) within a company walls. I changed the VS Nuget sources and my solution compiles and runs after several requests to our internal foundation to approve Nuget packages.
Now I am trying to use the dotnet publish command, but it fails miserably with bunch of errors such as: error NU1605: Detected package downgrade: System.Runtime.Extensions from 4.3.0 to 4.1.0. Reference the package directly from the project to select a different version..
I figured it is probably not cognizant of the private Nuget sources.....so I searched around and the solution seems to be to include a NuGet.Config file at the solution root:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="Company Artifactory" value="https://repo.comany.com/artifactory/api/nuget/comany-nuget" />
<add key="Company Eval Artifactory" value="https://repo.comany.com/artifactory/api/nuget/comany-nuget-eval" />
</packageSources>
</configuration>
This did not help. It seems that there is a new dotnet command that will allow adding sources via the CLI: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-add-source but unfortunately our version is is 3.1.100 and the new command is applicable to 3.1.200...yes...it will take an act congress to get the new version in our company.
Any help is appreciated.