github / VisualStudio

GitHub Extension for Visual Studio
https://visualstudio.github.com
MIT License
2.38k stars 1.2k forks source link

Couldn't find service of type GitHub.Api.ILoginManager #2450

Closed timi137137 closed 3 years ago

timi137137 commented 4 years ago

GitHub Extension for Visual Studio version: 2.10.8.8132 Visual Studio version: 2019(16.3.29519.87)

The Bug Used to be : Login failed Unable to retrieve your user info from the server. A proxy server might be interfering with the request. FailedPhoto

Now The BUG is:

EROR [01] ServiceProviderExports    Couldn't find service of type GitHub.Api.ILoginManager
EROR [34] GitHubServiceProvider     Error loading GitHub.Services.IConnectionManager
System.InvalidOperationException: 由于存在死锁的高风险,不能从 AsyncPackage 派生类中的后台线程调用 GetService。应改为调用 GetServiceAsyn (无需在产生的“任务”对象上调用“结果”或“等待”)或在调用 GetService 之前使用 JoinableTaskFactory.SwitchToMainThreadAsync 方法切换到 UI 线程。
   在 Microsoft.VisualStudio.Shell.AsyncPackage.GetService(Type serviceType)
   在 Microsoft.VisualStudio.Shell.Package.System.IServiceProvider.GetService(Type serviceType)
   在 GitHub.VisualStudio.GitHubServiceProvider.TryGetService(Type serviceType)

Steps to reproduce the behavior: There's no procedure, it just comes out of nowhere(He used to be normal!) Open VS2019 ,Then Open Team resource manager

I expect him to get back to normal because this is all about my projects

The log file from AppData\Local\GitHubVisualStudio\extension.log:

2019-11-24 13:57:55.173 [35668] INFO [01] GitHubPackage             Initializing GitHub Extension v2.10.4.8063 in Microsoft Visual Studio 2019 (16.3.29519.87)
2019-11-24 13:57:56.180 [35668] EROR [01] ServiceProviderExports    Couldn't find service of type GitHub.Api.ILoginManager
2019-11-24 14:12:22.188 [17760] EROR [01] ServiceProviderExports    Couldn't find service of type GitHub.Api.ILoginManager
2019-11-24 14:12:25.060 [17760] INFO [01] GitHubPackage             Initializing GitHub Extension v2.10.8.8132 in Microsoft Visual Studio 2019 (16.3.29519.87)
2019-11-24 14:15:22.220 [17760] EROR [20] GitHubServiceProvider     Error loading GitHub.Services.IConnectionManager
System.InvalidOperationException: 由于存在死锁的高风险,不能从 AsyncPackage 派生类中的后台线程调用 GetService。应改为调用 GetServiceAsyn (无需在产生的“任务”对象上调用“结果”或“等待”)或在调用 GetService 之前使用 JoinableTaskFactory.SwitchToMainThreadAsync 方法切换到 UI 线程。
   在 Microsoft.VisualStudio.Shell.AsyncPackage.GetService(Type serviceType)
   在 Microsoft.VisualStudio.Shell.Package.System.IServiceProvider.GetService(Type serviceType)
   在 GitHub.VisualStudio.GitHubServiceProvider.TryGetService(Type serviceType)
2019-11-24 14:19:28.412 [35028] EROR [01] ServiceProviderExports    Couldn't find service of type GitHub.Api.ILoginManager
2019-11-24 14:23:54.865 [33388] EROR [01] ServiceProviderExports    Couldn't find service of type GitHub.Api.ILoginManager
2019-11-24 14:23:59.207 [33388] INFO [01] GitHubPackage             Initializing GitHub Extension v2.10.8.8132 in Microsoft Visual Studio 2019 (16.3.29519.87)
2019-11-24 14:26:54.830 [33388] EROR [34] GitHubServiceProvider     Error loading GitHub.Services.IConnectionManager
System.InvalidOperationException: 由于存在死锁的高风险,不能从 AsyncPackage 派生类中的后台线程调用 GetService。应改为调用 GetServiceAsyn (无需在产生的“任务”对象上调用“结果”或“等待”)或在调用 GetService 之前使用 JoinableTaskFactory.SwitchToMainThreadAsync 方法切换到 UI 线程。
   在 Microsoft.VisualStudio.Shell.AsyncPackage.GetService(Type serviceType)
   在 Microsoft.VisualStudio.Shell.Package.System.IServiceProvider.GetService(Type serviceType)
   在 GitHub.VisualStudio.GitHubServiceProvider.TryGetService(Type serviceType)
2019-11-24 14:38:38.103 [34412] EROR [01] ServiceProviderExports    Couldn't find service of type GitHub.Api.ILoginManager
timi137137 commented 4 years ago

I've tried: Completely reinstall the extension Update Git and .NetFramework(now is 4.8) Reinstallation VisualStudio2019 Find Google Run "sfc" command

jcansdale commented 4 years ago

Hi @timi137137,

I'm afraid I don't know what's going on. There has been a similar report here #2465.

Do you have any other versions of Visual Studio installed? Does the extension work on them?

timi137137 commented 4 years ago

Hi @timi137137,

I'm afraid I don't know what's going on. There has been a similar report here #2465.

Do you have any other versions of Visual Studio installed? Does the extension work on them?

Yes, his symptoms are the same as mine。I reinstalled it three times, 2017,2018,2019. But it didn't work。Looking forward to repair

jcansdale commented 4 years ago

I'd be very interested to know if this extension is working (in VS 2017): https://marketplace.visualstudio.com/items?itemName=KristianAdrup.CommitFormatterforVisualStudio2015

It looks like MEF might not be working. 😢

jcansdale commented 4 years ago

Hi @timi137137,

I think the issue you've been seeing might be this #2560. I've opened a PR that I hope will resolve the problem.

Could you try installing the artifact from this build: https://github.com/github/VisualStudio/pull/2562/checks?check_run_id=1309274757

You can find it here: https://github.com/github/VisualStudio/suites/1400504505/artifacts/23266202

After opening and installing the VSIX, can you let me know if it works any better? Any help confirming this fix would be much appreciated!

timi137137 commented 3 years ago

The problem has been solved on January 20, 2012. The root cause of the problem is that I moved the AppData folder to another hard disk that is not the default one. This can be resolved by reinstalling the system. Leave a solution here in the hope of helping others 关于此问题已在2021/02/20解决,问题根源是因为我将APPDATA文件夹移动至其他非默认硬盘上导致。重装系统后可以得到解决。在此留下解决方法希望能帮助别人