Visual Studio 2017中的Git速度非常慢

Visual Studio 2017中的Git速度非常慢,git,visual-studio,visual-studio-2017,ntfs,Git,Visual Studio,Visual Studio 2017,Ntfs,我做了一些基本的检查,比如在网络驱动器上没有文件夹、更改某些git配置设置、使用不同的repo、反病毒扫描等 到目前为止,我知道问题与我的Windows帐户无关。在另一台设备上,切换分支只需几秒钟,而不是一分钟。我们注意到慢速PC上的网络流量大得多 当我在安全模式下运行Visual Studio时 devenv.exe /SafeMode 我立即在团队资源管理器中看到以下错误: 如上所述,我尝试的第一件事是: devenv.exe /updateConfiguration 但这并没有解决问题

我做了一些基本的检查,比如在网络驱动器上没有文件夹、更改某些git配置设置、使用不同的repo、反病毒扫描等

到目前为止,我知道问题与我的Windows帐户无关。在另一台设备上,切换分支只需几秒钟,而不是一分钟。我们注意到慢速PC上的网络流量大得多

当我在安全模式下运行Visual Studio时

devenv.exe /SafeMode
我立即在团队资源管理器中看到以下错误:

如上所述,我尝试的第一件事是:

devenv.exe /updateConfiguration
但这并没有解决问题。然后我跑:

devenv.exe /setup
它给出以下错误消息:

无法完成该操作。请求的操作需要 海拔高度

我在日志中看到的错误有:

Error loading UI library for package WebEditorPackage. HrLoadNativeUILibrary failed with 0x800a006f.
Error loading UI library for package Microsoft.VsSDK.ExtensibilityProjectFlavor.ExtensibilityProjectFlavorPackage. HrLoadNativeUILibrary failed with 0x800a006f.
Failed to find CTMENU resource '#1000' in loaded UI library.
我以管理员的身份运行VisualStudio。问题仍然存在,但在以后以用户身份以安全模式运行时,日志中不再有任何错误行

我在常规启动时看到一个错误和许多警告:

ERROR Encountered an ArgumentException when trying to look up the key binding information for ({ef254ccf-cee3-43e9-a22c-3ae3ab08e7fe},256) in the scope {5efc7975-14bc-11cf-9b2b-00aa00573819}.
Unexpected system error mode before loading package [Microsoft.VisualStudio.Services.Promotions.PromotionsPackage]
Unexpected system error mode before loading package [InstallerPackage]
About to block on async service creation because the service was requested via GetService. This has the potential to deadlock. Async initializing services should be retrieved via GetServiceAsync.

PkgDef syntax or I/O error at line 1: Section header: additional characters after closing bracket
      [$RootKey$\Setup\[ProductName]]  80004005 - E_FAIL
PkgDef syntax or I/O error at line 3: Section header: additional characters after closing bracket
      "SrcPath"="[SourceDir]"  80004005 - E_FAIL
Could not process PkgDef file
      C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\Extensions\Community\Detection_Keys_Reg.pkgdef 
Visual Studio修复也没有修复该问题。我正在使用VisualStudio15.6.5


我运行了sfc来检查Windows系统文件

sfc /scannow

Beginning system scan.  This process will take some time.

Beginning verification phase of system scan.
Verification 100% complete.

Windows Resource Protection found corrupt files but was unable to fix some
of them. Details are included in the CBS.Log windir\Logs\CBS\CBS.log. For
example C:\Windows\Logs\CBS\CBS.log. Note that logging is currently not
supported in offline servicing scenarios.
有许多类似的错误:

CSI    000010f2 [DIRSD OWNER WARNING] Directory [l:48 ml:49]'\??\C:\Program Files\Windows Identity Foundation' is not owned but specifies SDDL in component c2wtsres, arch amd64, nonSxS, pkt {l:8 b:31bf3856ad364e35}
CSI    000010f3 [DIRSD OWNER WARNING] Directory [l:53 ml:54]'\??\C:\Program Files\Windows Identity Foundation\v3.5' is not owned but specifies SDDL in component c2wtsres, arch amd64, nonSxS, pkt {l:8 b:31bf3856ad364e35}
CSI    000010f4 Error - Overlap: Duplicate ownership for directory \??\C:\Program Files\Windows Identity Foundation in component c2wtsres, version 10.0.14393.0, arch amd64, nonSxS, pkt {l:8 b:31bf3856ad364e35}
CSI    000010f5 Error - Overlap: Duplicate ownership for directory \??\C:\Program Files\Windows Identity Foundation\v3.5 in component c2wtsres, version 10.0.14393.0, arch amd64, nonSxS, pkt {l:8 b:31bf3856ad364e35}

日志显示在Git和VS之间切换。磁盘操作本身很快,但在Git.exe文件关闭后
C:\Program Files(x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\bin\Git.exe
关闭几乎需要一秒钟的时间。在git.exe发生QueryNameInformationFile事件几乎一秒钟后,它在
C:\Windows\System32\conhost.exe
上关闭了文件

当没有什么特别的事情发生的时候,我拍摄了线鲨。我看到我的电脑和公司代理webdefence.cluster-x.websense.net之间的流量很大。流量比我的同事多得多,他们没有看到错误

当使用有线、无线或在家使用VPN连接时,问题仍然存在

我怀疑这是NTFS权限的问题


我试着跑,但没有用

SFCFix Has Crashed


Something has gone horribly wrong and SFCFix has crashed. Would you like SFCFix
to submit a crash report to the developer so that this problem can be fixed?
Type "y" for yes or "n" for no and press enter to continue:
我尝试的其他工具也没有成功

D:\Tools>DISM /Online /Cleanup-Image /StartComponentCleanup /ResetBase

Deployment Image Servicing and Management tool
Version: 10.0.14393.0

Image Version: 10.0.14393.0

[===========                20.0%                          ]
The operation completed successfully.

D:\Tools>Dism /Online /Cleanup-Image /RestoreHealth

Deployment Image Servicing and Management tool
Version: 10.0.14393.0

Image Version: 10.0.14393.0

[==========================100.0%==========================]
Error: 0x800f081f

The source files could not be found.
Use the "Source" option to specify the location of the files that are required to restore the feature. For more information on specifying a source location, see http://go.microsoft.com/fwlink/?LinkId=243077.

The DISM log file can be found at C:\WINDOWS\Logs\DISM\dism.log


Tweaking.com-也无法修复文件权限。

这可能是联想L460-e-ID阅读器i7 SSD的硬件问题

系统重新启动。证监会发现了一些错误,可以修复。Wireshark的流量看起来正常,但问题依然存在。首次登录系统的同事也有同样的问题

我注意到的另一件事是,当Opera浏览器启动时,不可能在第一分钟内显示新网页。网站持续加载很长时间。

删除此目录中的“Git”文件夹,然后重新启动VS

C:\ProgramFiles(x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer

该文件夹覆盖了正常的Git执行

PS:如果您使用的不是“社区”版本,请进行相应修改。
Cheers

(1)使用stanfalone git切换分支是否也很慢(2)在长分支切换过程中进程树是什么样子的,哪个进程(如果有)消耗CPU。问得好。我已经安装了Ortoisegit,但还没有测试它。没有问题:切换分支不到4秒。没有CPU消耗弹出。尽管如此,一些进程需要很多时间才能完成。也许它会在一些网络呼叫中等待。因此,请发现共享流程树的相关部分在这里并不是最佳选择,因为它使用了另一个实现。windows cli的标准git会更好。windows CMD的git也可以正常工作。似乎删除此文件夹只会强制VS使用系统上默认安装的git。所以在我的情况下,它一开始很有帮助,直到我更新到git版本2.23。更新之后,一切又开始缓慢地工作。恢复到2.22版完全解决了这个问题。
SFCFix Has Crashed


Something has gone horribly wrong and SFCFix has crashed. Would you like SFCFix
to submit a crash report to the developer so that this problem can be fixed?
Type "y" for yes or "n" for no and press enter to continue:
D:\Tools>DISM /Online /Cleanup-Image /StartComponentCleanup /ResetBase

Deployment Image Servicing and Management tool
Version: 10.0.14393.0

Image Version: 10.0.14393.0

[===========                20.0%                          ]
The operation completed successfully.

D:\Tools>Dism /Online /Cleanup-Image /RestoreHealth

Deployment Image Servicing and Management tool
Version: 10.0.14393.0

Image Version: 10.0.14393.0

[==========================100.0%==========================]
Error: 0x800f081f

The source files could not be found.
Use the "Source" option to specify the location of the files that are required to restore the feature. For more information on specifying a source location, see http://go.microsoft.com/fwlink/?LinkId=243077.

The DISM log file can be found at C:\WINDOWS\Logs\DISM\dism.log