Installing private feed Nuget packages from packages.config

女生的网名这么多〃 提交于 2020-01-24 10:19:12

问题


I have a private nuget feed on one of our internal servers.

I can install packages in this feed from command line like this

nuget install "PackageName" -source "\\DevServer\NugetFeed"

However if I try to install the packages from our packages.config file like this

nuget install "MyProject\Packages.config" -source "\\DevServer\NugetFeed"

It errors with can't find package for each of the packages in my packages.config file. It looks like it's ignoring the -Source switch and looking in a different nuget feed.

My packages.config looks like this

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Package1" version="1.0.0" />
  <package id="Package2" version="1.0.0" />
</packages>

Any ideas how I can make this work? Can you include the source location in packages.config or something similar?


回答1:


This is likely to be related to the naming of files on the feed. Your first command line doesn't specify a version number, so it will pick up anything named "PackageName".

Make sure the files in your feed are called "Package1.1.0.0" and "Package2.1.0.0", and that should do the trick.



来源:https://stackoverflow.com/questions/9275112/installing-private-feed-nuget-packages-from-packages-config

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!