Source unreachable when using the NuGet Package Manager Console

后端 未结 13 1916
面向向阳花
面向向阳花 2020-12-12 15:11

We are moving our package management from manually updating files to NuGet. I am trying to install older versions of packages to match the one we already have in source cont

13条回答
  •  隐瞒了意图╮
    2020-12-12 16:08

    I'm not sure what can cause your issue, but there is indeed a way to override package sources on a per-solution basis, but only if you've enabled NuGet Package Restore on the given solution.

    Once a solution has enabled NuGet Package Restore a folder called ".nuget" gets added to the solution. Under this will be a file called "NuGet.targets" that has an ItemGroup whose Condition is " '$(PackageSources)' == '' " like the one you'll see in the attached image.

    If the ItemGroup is empty (or completely commented out, as in the illustration) then the solution will use a specific file that should be the same as the sources listed under TOOLS >> OPTIONS. But if you uncomment or add PackageSource items to that ItemGroup the solution will search the package sources listed and ONLY the ones listed.

    Contents of the Nuget.targets file

提交回复
热议问题