我认为我已经对此问题进行了相当多的研究,但是我找不到相应的问题/解决方案。
要实现的目标
发布解决方案并将其从VS 2017推送到Microsoft Visual Studio Team Services(VSTS)。
可复制示例
已创建带有项目“ ExampleProject”的新解决方案“ GitExample”(/ w已选中“创建新的Git存储库”)。
在“团队资源管理器”窗口中,选择“推送到Visual Studio Team Services”部分下的“发布Git存储库”。我选择我的帐户和域,然后按“发布存储库”。
从Git打印以下错误消息。
Opening repositories:
c:\users\SampleUser\source\repos\PythonApplication4
Commit e3b04515 created locally in repository c:\users\SampleUser\source\repos\PythonApplication4
Error encountered while pushing branch to the remote repository: Git failed with a fatal error.
ArgumentNullException encountered.
Value cannot be null.
Parameter name: path
ArgumentNullException encountered.
Value cannot be null.
Parameter name: path
cannot spawn /C/Program Files/Microsoft Visual Studio/2017/Enterprise/Common7/IDE/CommonExtensions/Microsoft/TeamFoundation/Team Explorer/Git/mingw32/libexec/git-core/git-askpass.exe: No such file or directory
could not read Username for 'https://repodomain.visualstudio.com': terminal prompts disabled
Pushing to https://repodomain.visualstudio.com/_git/PythonApplication4
A new Git repository has been created for you in C:\Users\SampleUser\source\repos\GitExample.
Opening repositories:
C:\Users\SampleUser\source\repos\GitExample
Commit 5d8765b7 created locally in repository C:\Users\SampleUser\source\repos\GitExample
Opening repositories:
C:\Users\SampleUser\source\repos\GitExample
The calling thread cannot access this object because a different thread owns it.
Error encountered while pushing branch to the remote repository: Git failed with a fatal error.
ArgumentNullException encountered.
Value cannot be null.
Parameter name: path
ArgumentNullException encountered.
Value cannot be null.
Parameter name: path
cannot spawn /C/Program Files/Microsoft Visual Studio/2017/Enterprise/Common7/IDE/CommonExtensions/Microsoft/TeamFoundation/Team Explorer/Git/mingw32/libexec/git-core/git-askpass.exe: No such file or directory
could not read Username for 'https://repodomain.visualstudio.com': terminal prompts disabled
Pushing to https://repodomain.visualstudio.com/_git/GitExample
问题似乎出在Git Credential Manager for Windows上。但是,Windows凭据管理器会正确列出具有正确的用户名和密码组合的git:repodomain.visualstudio.com。
已完成的操作:
感谢您为此付出的时间和精力。
答案 0 :(得分:1)
请通过“团队资源管理器”中的“管理连接”从您的电子邮件地址中检查与VSTS帐户的连接。详细步骤如下:
在VS->团队资源管理器->管理连接->连接到项目->检查是否可以连接到VSTS帐户/域(https://repodomain.visualstudio.com)。
此外,还请检查您是否有权在VSTS帐户https://repodomain.visualstudio.com 中创建新项目。检查权限的步骤如下:
在VSTS帐户的“安全性页面(https://repodomain.visualstudio.com/_settings/security)->选择您所在的组->检查是否允许创建新项目的权限。
答案 1 :(得分:0)
我在 Visual Studio 2019 中遇到错误:
cannot spawn /c/program files (x86)/microsoft visual studio/2019/enterprise/common7/ide/commonextensions/microsoft/teamfoundation/team explorer/Git/mingw32/libexec/git-core/git-askpass.exe
就我而言,解决方案是不同的。问题是 Visual Studio 2019 附带的内置 git 没有正确处理两步身份验证。
解决办法:
-First make sure you close all visual studio instances.
-Delete all generic credentials in windows credential manager related to git, devops, azure, SSO_POP_Device, virtualapp/didlogical, etc
-Delete the GitCredentialManager\\tenant.cache in the %appdata% folder
-Bring up the default web browser and open your repository. In my case, I just had to open up the following site:
https://dev.azure.com/myDevOpsSite
通过这种方式,系统会提示您输入用户名/密码,然后在手机上进行两步身份验证。在此之后,凭据将正确存储,您现在可以打开 Visual Studio 并从 Visual Studio 内推/拉而不会出现错误。