加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net-core – 在Visual Studio 2015 for ASP.NET Core项目中

发布时间:2020-12-16 04:14:47 所属栏目:asp.Net 来源:网络整理
导读:我正在按照迁移建议将MVC5网站转换为ASP.NET核心网站 – http://docs.asp.net/en/latest/migration/mvc.html并且在尝试使用Bower安装客户端软件包(Bootstrap和jQuery)时遇到困难. 我创建了一个空的ASP.NET 5 Web应用程序,然后我创建了一个bower.json文件,但
我正在按照迁移建议将MVC5网站转换为ASP.NET核心网站 – http://docs.asp.net/en/latest/migration/mvc.html并且在尝试使用Bower安装客户端软件包(Bootstrap和jQuery)时遇到困难.

我创建了一个空的ASP.NET 5 Web应用程序,然后我创建了一个bower.json文件,但是当我保存它时,我在Output窗口中得到以下内容

PATH=.node_modules.bin;C:Program Files (x86)Microsoft Visual Studio 14.0Common7IDEExtensionsMicrosoftWeb ToolsExternal;%PATH%;C:Program Files (x86)Microsoft Visual Studio 14.0Common7IDEExtensionsMicrosoftWeb ToolsExternalgit
"C:Program Files (x86)Microsoft Visual Studio 14.0Common7IDEExtensionsMicrosoftWeb ToolsExternalBower.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 Package Manager,结果相同

我正在使用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 clone …..”命令.如果它工作,这肯定意味着它不是代理/防火墙问题,更可能是Git和VS的问题.

为了解决这个问题,我下载了独立的git安装程序(downloader here),它对我有用.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读