The Google Cloud Extension Package package did not load correctly

401 views Asked by At

I am having an issue with VS2017 and Google Cloud toolbar. It used to work before and now I am getting this pop up every time I open VS2017.

The 'GoogleCloudExtensionPackage' package did not load correctly. The problem may have been caused by a configuration change or but the installation of another extension. You can get more information by examing the files '...\AppData\Roaming\Microsoft\VisualStudio\15.0_xxxxxxx\ActivityLog.xml'. Restarting Visual Studio could help resolve this issue.

Publish to Google Cloud option is also disabled. Tried reinstalling extension and VS. No matter how many times I restart, re-install, repair, anything it doesn't work. Activity Log shows the following error

LegacySitePackage failed for package [GoogleCloudExtensionPackage]
Source: 'mscorlib' Description: An item with the same key has already been added. 
System.ArgumentException: An item with the same key has already been added. 
  at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) 
  at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer) 
  at GoogleCloudExtension.Accounts.CredentialsStore.LoadAccounts() at GoogleCloudExtension.Accounts.CredentialsStore..ctor() 
  at GoogleCloudExtension.Accounts.CredentialsStore.<>c.<.cctor>b__67_0() 
  at System.Lazy`1.CreateValue() at System.Lazy`1.LazyInitValue() 
  at System.Lazy`1.get_Value() 
  at GoogleCloudExtension.Accounts.CredentialsStore.get_Default() 
  at GoogleCloudExtension.GoogleCloudExtensionPackage.Initialize() 
  at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsPackage.SetSite(IServiceProvider sp)

I also tried deleting the below folders

  • C:\Users\\AppData\Local\Microsoft\VisualStudio\15.0xxxxx
  • C:\Users\\AppData\Roaming\Microsoft\VisualStudio\15.0xxxxx
1

There are 1 answers

0
Morro On

A similar issue was reported to the extension developers on Github, see here. As you can see on this comment this issue was caused by multiple user account files linked to one user account, and should be fixed by deleting the offending files:

Go to %LOCALAPPDATA%\googlecloudvsextension\accounts and you will find several *.json files. Deleting them all (or just the ones with duplicate accounts) should fix this issue.