I am following the migration advice to convert a MVC5 website to a ASP.NET Core website - http://docs.asp.net/en/latest/migration/mvc.html and I am stuck when trying to install the client side packages (Bootstrap and jQuery) using Bower.
I have created an empty ASP.NET 5 Web Application and then I create a bower.json file, but when I save it I get the following in the Output window
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
I have also tried using the Bower Package manager inside VS with the same result
I am using Visual Studio 2015 Update 2 with the ASP.NET Web Tools RC1-update 1
I have seen other posts when this doesn't work (with a different error) but those are when behind a corporate firewall/proxy, which I am not
I am new to this npm/bower stuff. What am I missing?
Update: I ran the commands at a command prompt and it still didn't work, but I do have more detail on the underlying error
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)
And found this link, where other people seem to be having the same problem https://connect.microsoft.com/VisualStudio/feedback/details/1322649/bower-cannot-get-packages-with-protocol-git-since-behind-a-firewall
So looks to be an issue where MS has released the wrong version of this component
Dont know why this happens but this is how i solved it :
Install standalone Git from http://git-scm.com/
Open bash and execute to use https instead on git (firewall maybe blocking git protocol) :
git config --global url.https://github.com/.insteadOf git://github.com/
Configure Visual studio to use this new git tool instead :
just add the last line and uncheck the old git command line.
hope this helps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With