Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/design-patterns/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用Nuget.exe更新包_Nuget - Fatal编程技术网

如何使用Nuget.exe更新包

如何使用Nuget.exe更新包,nuget,Nuget,对于.NET中的小示例项目(直接在命令行上构建,而不使用Visual Studio),我希望直接使用Nuget.exe检索所需的库,而不必在源存储库中提交它们 我已经能够使用命令安装它们 nuget install packages.config -o $destinationFolder 在packages.config中指定所需的包(如Visual Studio中的Nuget)。 但是,我无法更新已安装的软件包。我已尝试使用此命令 nuget update packages.config

对于.NET中的小示例项目(直接在命令行上构建,而不使用Visual Studio),我希望直接使用
Nuget.exe
检索所需的库,而不必在源存储库中提交它们

我已经能够使用命令安装它们

nuget install packages.config -o $destinationFolder
packages.config
中指定所需的包(如Visual Studio中的Nuget)。 但是,我无法更新已安装的软件包。我已尝试使用此命令

nuget update packages.config -r $destinationFolder
但是
Nuget.exe
抱怨说

unable to locate project file for '...packages.config'`.

我在互联网上搜索过,但我只在Nuget论坛中找到了一个,没有答案。

我阅读了Nuget项目中的相关源文件,我发现更新要成功,
Nuget.exe
需要找到一个Visual C#/Basic/F#项目

然后,我在文件夹中创建了一个空的
csproj
文件,我可以更新以前安装的软件包

我在上做了一个小示例,演示如何使用
Nuget.exe
安装和更新软件包。我还使用了一种变通方法来确保文件夹中只保存库的最新版本

更新2013-04-06 14:20 UTC我已经更新了示例,展示了如何使用