【问题标题】:How do I create a nuget packages.config file from the command line?如何从命令行创建 nuget packages.config 文件?
【发布时间】:2016-12-10 18:58:30
【问题描述】:

当我运行nuget install pdfsharp 之类的命令向项目添加外部库时,该库已安装,但如the nuget documentation 中所述,该命令不会修改项目或packages.config。

由于我要添加到一个空的 hello world,我如何创建这个 packages.config 文件以供 nuget 以后使用 nuget restore?我在文档中找不到此文件的格式。

【问题讨论】:

    标签: c# nuget nuget-package-restore


    【解决方案1】:

    nuget install 将添加包但不会修改项目或 xml 配置,请参阅 - https://docs.nuget.org/ndocs/tools/nuget.exe-cli-reference

    将包安装到当前项目中,但不修改项目或packages.config。

    尝试使用 powershell 命令行开关,请参阅 - https://docs.nuget.org/ndocs/tools/powershell-reference#install-package

    Install-Package pdfsharp
    

    【讨论】:

    猜你喜欢
    • 2015-04-03
    • 2016-07-21
    • 1970-01-01
    • 2012-06-29
    • 2011-04-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-07
    相关资源
    最近更新 更多