【发布时间】:2016-04-12 16:05:56
【问题描述】:
我正在按照迁移建议将 MVC5 网站转换为 ASP.NET Core 网站 - http://docs.asp.net/en/latest/migration/mvc.html,但在尝试使用 Bower 安装客户端包(Bootstrap 和 jQuery)时遇到问题。
我创建了一个空的 ASP.NET 5 Web 应用程序,然后创建了一个 bower.json 文件,但是当我保存它时,我在输出窗口中得到以下内容
PATH=.\node_modules\.bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External;%PATH%;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External\git
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External\Bower.cmd" install jquery#2.1.4 --production --force-latest --save
bower jquery#2.1.4 not-cached https://github.com/jquery/jquery-dist.git#2.1.4
bower jquery#2.1.4 resolve https://github.com/jquery/jquery-dist.git#2.1.4
bower jquery#2.1.4 checkout 2.1.4
bower jquery#2.1.4 ECMDERR Failed to execute "git clone https://github.com/jquery/jquery-dist.git -b 2.1.4 --progress . --depth 1", exit code of #-532462766
我也尝试在 VS 中使用 Bower 包管理器,结果相同
我正在使用 Visual Studio 2015 Update 2 和 ASP.NET Web Tools RC1-update 1
当这不起作用时(有不同的错误),我看过其他帖子,但那些是在公司防火墙/代理后面时,我不是
我不熟悉这个 npm/bower 的东西。我错过了什么?
更新: 我在命令提示符下运行了命令,但它仍然不起作用,但我确实有更多关于潜在错误的详细信息
Unhandled Exception: System.MissingMethodException: Method not found: 'LibGit2Sharp.Branch LibGit2Sharp.RepositoryExtensions.Checkout(LibGit2Sharp.IRepository, LibGit2Sharp.Branch, LibGit2Sharp.Signature)'.
at Microsoft.VisualStudio.GitCli.GitShim.clone(String url, String workingDirectory, String branchName)
at Microsoft.VisualStudio.GitCli.Program.Main(String[] args)
找到了这个链接,其他人似乎也有同样的问题https://connect.microsoft.com/VisualStudio/feedback/details/1322649/bower-cannot-get-packages-with-protocol-git-since-behind-a-firewall
所以看起来是一个问题,MS 发布了这个组件的错误版本
【问题讨论】:
-
我也有同样的问题。你修好了吗?
-
安装独立 git 并检查 PATH 变量是否已设置。
标签: asp.net-core