我正在尝试使用创建一个 nuget 包http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package#From_a_convention_based_working_directory http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package#From_a_convention_based_working_directory作为参考。
Visual Studio 中的包管理器控制台不允许我使用“nuget”命令。
我能够“获取帮助 nuguet”,它显示:
包含以下 NuGet cmdlet。
Cmdlet Description
------------------ ----------------------------------------------
Get-Package Gets the set of packages available from the package source.
Install-Package Installs a package and its dependencies into the project.
Uninstall-Package Uninstalls a package. If other packages depend on this package,
the command will fail unless the –Force option is specified.
Update-Package Updates a package and its dependencies to a newer version.
Add-BindingRedirect Examines all assemblies within the output path for a project
and adds binding redirects to the application (or web)
configuration file where necessary.
Get-Project Returns a reference to the DTE (Development Tools Environment)
for the specified project. If none is specifed, returns the
default project selected in the Package Manager Console.
Open-PackagePage Open the browser pointing to ProjectUrl, LicenseUrl or
ReportAbuseUrl of the specified package.
Register-TabExpansion Registers a tab expansion for the parameters of a command.
- 但是,每当我使用 nuget 开始命令时都会给出:
术语“nuget”不被识别为 cmdlet、函数、脚本文件或可操作程序的名称。检查名称的拼写,或者如果包含路径,请验证路径是否正确并尝试 ag
艾恩。
行:1 字符:6
+ nuget
我尝试过以下解决方案:
1>关闭所有项目并重新启动
2> 卸载并重新安装
3>创建一个powershell配置文件(这之前不存在,这实际上破坏了一切)
当我将 Visual Studio 2012 Ultimate 试用版升级为注册版后,问题开始出现。我最初安装的是 VS 12 Pro。我不知道这是否真的与此有关,但我注意到其他有类似问题的人安装了 vs 10 和 12。
我的问题是“有人知道还能尝试什么吗?”我的理论是 nuget 命令的路径丢失,但我找不到如何配置包管理器控制台使用的路径,并且我不确定 cmdlet nuget 实际存储在哪里。
已更新——尝试按照下面的建议下载命令行工具。这导致什么都不能再工作。我尝试卸载,现在我在 nuget 的 vs2010 扩展中有一个项目,但没有启用安装或卸载按钮。这让我相信这与 2010 年和 2012 年安装的扩展有关,这些扩展在我的小戏剧中占有一席之地。如果有人也知道如何删除可卸载的扩展,请也提供建议,但我会尝试另一个问题。