无法识别"nuget",但其他nuget命令正常工作 [英] 'nuget' is not recognized but other nuget commands working

查看:803
本文介绍了无法识别"nuget",但其他nuget命令正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package#From_a_convention_based_working_directory 作为参考. 我在Visual Studio中的Package Manger Console不允许我使用'nuget'命令. 我能够获取帮助",并且显示:

I am trying to create a nuget package using http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package#From_a_convention_based_working_directory as a reference. My Package Manger Console in Visual Studio is not allowing me to use the 'nuget' command. I am able to 'Get-help nuguet' and it displays:

包括以下NuGet cmdlet.

The following NuGet cmdlets are included.

    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,函数,脚本文件或可运行程序的名称.检查名称的拼写,或者是否包含路径,请验证路径是否正确,然后尝试 艾因.

    The term 'nuget' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try ag ain.

    在线:1字符:6 + nuget<<<< + CategoryInfo:ObjectNotFound:(nuget:String)[],CommandNotFoundException + FullyQualifiedErrorId:CommandNotFoundException

    At line:1 char:6 + nuget <<<< + CategoryInfo : ObjectNotFound: (nuget:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException

    我尝试了以下解决方案:

    I have tried the following solutions:

    1>关闭所有项目并重新启动

    1>closing down all items and restarting

    2>卸载并重新安装

    3>创建一个powershell配置文件(之前不存在,实际上破坏了所有内容)

    3>creating a powershell profile file (this didn't exist before and this actually broke everything)

    将Visual Studio 2012 Ultimate试用版升级为已注册后,问题开始出现.我最初安装了VS 12 Pro.我不知道这是否真的与它有任何关系,但是我注意到其他有类似问题的人都安装了vs 10和12.

    The problem started to appear after I upgraded my Visual Studio 2012 Ultimate trial version to registered. I had originally had the VS 12 Pro installed. I don't know if that really has anything to do with it but I noticed that others that had similar problems have vs 10 and 12 installed.

    我的问题是有人知道还有什么可以尝试的吗?"我的理论是nuget命令的路径丢失了,但是我找不到如何配置程序包管理器控制台使用的路径,而且我不确定cmdlet nuget的实际存储位置.

    My question is "does anyone know what else to try?" My theory is that the path to the nuget command is missing but I cannot find how to configure the paths the package manager console uses and I am not sure where the cmdlet nuget is actually stored.

    已更新---尝试按照以下建议下载命令行工具.这导致没有任何工作.我尝试卸载,现在我在vs2010扩展中有一个项目,其中包含未启用安装或卸载按钮的nuget.这使我相信,这与通过2010年和2012年安装的扩展程序有关,这在我的小戏剧中发挥了作用.如果有人也知道如何删除可卸载的扩展程序,也请告知,但我会尝试另一个问题.

    Updated---tried downloading the command line tool as suggested below. This lead to nothing working again. I tried to uninstall and now I have a item in vs2010 extentions for nuget that doesn't have a install or unistall button enabled. This leads me to believe that it has to do with extensions installed via 2010 and 2012 that has a part in my little drama. If anyone also knows how to nuke an uninstallable extension, please advise also but I will try another question for that.

    推荐答案

    您还可以尝试将系统变量路径设置为nuget exe的位置,然后重新启动VS.

    You can also try setting the system variable path to the location of your nuget exe and restarting VS.

    1. 打开系统PATH变量并添加nuget.exe的位置(对我来说是C:\Program Files (x86)\NuGet\Visual Studio 2013)
    2. 重新启动Visual Studio
    1. Open your system PATH variable and add the location of your nuget.exe (for me this is: C:\Program Files (x86)\NuGet\Visual Studio 2013)
    2. Restart Visual Studio

    我会将其作为评论发布到您的 answer @done_merson,但我没有所需的声誉做到这一点.

    I would have posted this as a comment to your answer @done_merson but I didn't have the required reputation to do that.

    这篇关于无法识别"nuget",但其他nuget命令正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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