如何在cmd/powershell中运行Nuget Package Manager主机 [英] How to run Nuget Package Manager Host in cmd / powershell

查看:66
本文介绍了如何在cmd/powershell中运行Nuget Package Manager主机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我当前在Visual Studio 2017 Nuget软件包管理器控制台中使用 Update-Package 命令.我需要在命令提示符下使用它

I am currently using Update-Package command in Visual Studio 2017 Nuget Package Manager Console. I need to use it from command prompt

例如:

nuget Update-Package Newtonsoft.Json 

推荐答案

Visual Studio的Package Manager控制台仅在Visual Studio中可用.NuGet cmdlet与Visual Studio本身进行交互以读取/修改您的项目文件,因此该实现无法在其他Powershell主机中按原样工作.

Visual Studio's Package Manager Console is only available in Visual Studio. The NuGet cmdlets interacts with Visual Studio itself to read/modify your project file, so that implementation can't work as-is in other powershell hosts.

如果您的目标只是编写脚本更新程序包,只要您不受任何 dotnet过时 编写更新脚本.

If your goal is just to script updates to packages, as long as you're not impacted by any limitations or package compatibility issues, you can consider migrating to SDK-style projects and PackageReference instead of packages.config, then you can use dotnet outdated to script your updates.

这篇关于如何在cmd/powershell中运行Nuget Package Manager主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆