问题
I am using VS2015 & TFS2013.
I have a GIT repository on TFS which has got a web application and I am trying to publish that using TFS build.
I created a build for deploying that web application which fails.
Here is the full error message:
Cloning repository 'http://localhost:8080/tfs/defaultcollection/GitTest/_git/GitTest' into 'C:\Builds\2014\GitTest\TestGitBuild\src'.
**Exception Message: Response status code does not indicate success: 404 (Not Found).** (type LibGit2SharpException) Exception Data Dictionary: libgit2.code = -1 libgit2.category = 12 Exception Stack Trace: Server stack trace: at LibGit2Sharp.Core.Ensure.HandleError(Int32 result) at LibGit2Sharp.Core.Proxy.git_clone(String url, String workdir, GitCloneOptions& opts) at LibGit2Sharp.Repository.Clone(String sourceUrl, String workdirPath, CloneOptions options) at Microsoft.TeamFoundation.Build.Activities.Git.GitPull.GitClone.GetRepository(String repositoryUrl, String workingFolder, Boolean checkoutSubmodules) at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs) at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase) at System.Func`4.EndInvoke(IAsyncResult result) at Microsoft.TeamFoundation.Build.Activities.Git.GitPull.GitRepositoryBase.EndExecute(AsyncCodeActivityContext context, IAsyncResult result) at System.Activities.AsyncCodeActivity`1.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result) at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
Any idea whats going wrong?
回答1:
Adding "Project Collection Build Services Accounts" and giving Read permissions solved the problem for me.
You can go to this popup by right clicking on your project and then select Security in your Web portal.
来源:https://stackoverflow.com/questions/40112023/tfs-build-fail-when-running-for-tfs-git-repository