有人知道如何以这种方式管理nuget包吗?
根据
NuGet CLI reference
:
文件,前提是这些引用已经存在。
所以当我们使用NuGet时。exe更新包,我们不仅需要这些包。配置,但也需要解决方案/项目,否则,您将得到错误:
您可以从安装了Visual Studio的机器上复制一个简单的项目,然后使用下面的命令行更新
package.config
文件:
nuget update "YourProjectPath\packages.config"
详细步骤
:
-
nuget.org
,将其设置为本地计算机。
-
%appdata%
,添加
NuGet.Config
repositoryPath
,只需设置即可“
D:\NuGetServer
":
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
<config>
<add key="repositoryPath" value="D:\NuGetServer" />
</config>
</configuration>
-
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EntityFramework" version="6.1.0" targetFramework="net45" />
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net45" />
<package id="NUnit" version="3.7.0" targetFramework="net45" />
</packages>
-
你会在包裹中找到包裹。配置更新为最新版本。