我正在尝试从私有的NuGet来源获取Emgu.CV软件包。 NuGet.org上存在一个稍有不同但名称相同且版本相同的Emgu.CV软件包。我尝试从Visual Studio 2017的包管理器控制台中指定源,如下所示:
install-package emgu.cv -source EMGU
Attempting to gather dependency information for package 'emgu.cv.3.4.3.3016' with respect to project 'Yyyy', targeting '.NETFramework,Version=v4.6.2'
Gathering dependency information took 971.01 ms
Attempting to resolve dependencies for package 'emgu.cv.3.4.3.3016' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'emgu.cv.3.4.3.3016'
Resolved actions to install package 'emgu.cv.3.4.3.3016'
Retrieving package 'EMGU.CV 3.4.3.3016' from 'EMGU'.
Adding package 'EMGU.CV.3.4.3.3016' to folder 'C:\xxxx\packages'
Added package 'EMGU.CV.3.4.3.3016' to folder 'C:\xxxx\packages'
Added package 'EMGU.CV.3.4.3.3016' to 'packages.config'
Successfully installed 'EMGU.CV 3.4.3.3016' to Yyyy
Executing nuget actions took 1.27 sec
Time Elapsed: 00:00:02.3311430
输出向我表明它已经起作用,但是当我检查该软件包时,我发现它已经从NuGet.org中检索了该版本。我已经在NuGet.conf中检查了我的Emgu源,它指向正确的位置。我直接使用了源代码而没有任何密钥,它再次似乎可以正常工作,但是再次从NuGet.org获取了该软件包。
我已经阅读了NuGet powershell参考(https://docs.microsoft.com/en-au/nuget/tools/powershell-reference#Install-Package)和相关问题(How to install all NuGet packages from specific source?),但两者似乎都建议我完全按照自己的意愿做。
我只需要确保它从Emgu中获取了Emgu,并且从NuGet.org中打包了我的其他软件包。预先感谢您的帮助。