Bug 44146 - "GetFullVsVersionString must be called on the UI thread" when attempting to open "Manage NuGet Packages for Solution" on certain systems, possibly due to Clide.Composition.ExportsServiceLocator
Summary: "GetFullVsVersionString must be called on the UI thread" when attempting to o...
Status: VERIFIED UPSTREAM
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: General (show other bugs)
Version: 4.2.0 (C8)
Hardware: PC Windows
: High critical
Target Milestone: 4.2.1 (C8SR1)
Assignee: Bugzilla
URL:
: 44227 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-09-09 16:44 UTC by Hrvoje
Modified: 2016-09-22 05:41 UTC (History)
12 users (show)

See Also:
Tags: BZSRC8S1_C7SR1S1
Is this bug a regression?: Yes
Last known good build: Cycle 7 SR 1


Attachments

Description Hrvoje 2016-09-09 16:44:41 UTC
With latest beta installed certain commands in Visual Studio 2015/3 are not working.
Some of them are:
- Nuget package manager (sometimes restarting VS) helps
- Build project
Firstly I thought it is SDK, JDK, etc issue and tried reinstall it. But only thing did help is to return to stable channel.
Now that I installed latest beta (cycle 8), I see that same error exists.

Here is the error log:
LegacySitePackage failed for package [NuGetPackage]Source: Microsoft.VisualStudio.Composition
Description: An exception was thrown while initializing part "NuGet.PackageManagement.VisualStudio.VSSolutionManager".
Microsoft.VisualStudio.Composition.CompositionFailedException: An exception was thrown while initializing part "NuGet.PackageManagement.VisualStudio.VSSolutionManager". ---> System.Runtime.InteropServices.COMException: GetFullVsVersionString must be called on the UI thread.
at Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread(String callerMemberName)
at NuGet.PackageManagement.VisualStudio.VSVersionHelper.GetFullVsVersionString()
at NuGet.PackageManagement.VisualStudio.VSSolutionManager..ctor()
--- End of inner exception stack trace ---
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue()
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.Create()
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.<GetExportedValueHelper>b__0()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.<GetExportedValueHelper>b__0()
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportElement(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import, RuntimeExport export, Func3 lazyFactory) at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportSite(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import) at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.&lt;CreateValue&gt;b__10_0(RuntimeImport import) at System.Linq.Enumerable.WhereSelectArrayIterator2.MoveNext()
at System.Linq.Buffer1..ctor(IEnumerable1 source)
at System.Linq.Enumerable.ToArrayTSource
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue()
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.Create()
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()
at Microsoft.VisualStudio.Composition.ExportProvider.<>c__DisplayClass53_0.<CreateExport>b__0()
at System.Lazy1.CreateValue() --- End of stack trace from previous location where exception was thrown --- at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState) --- End of stack trace from previous location where exception was thrown --- at System.Lazy1.CreateValue()
at Microsoft.VisualStudio.Composition.ExportProvider.<>c__DisplayClass53_0.<CreateExport>b__0()
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()
at System.Lazy1.CreateValue() at Microsoft.VisualStudio.Composition.ExportProvider.&lt;&gt;c__DisplayClass53_0.&lt;CreateExport&gt;b__0() at Microsoft.VisualStudio.Composition.NetFxAdapters.MefV1ExportProvider.&lt;&gt;c__DisplayClass12_0.&lt;UnwrapExport&gt;b__1() at System.Lazy1.CreateValue()
at System.ComponentModel.Composition.Primitives.Export.GetExportedValueCore()
at System.ComponentModel.Composition.Primitives.Export.get_Value()
at System.ComponentModel.Composition.ExportServices.GetCastedExportedValueT
at System.ComponentModel.Composition.ExportServices.<>c__DisplayClass12_01.&lt;CreateStronglyTypedLazyOfT&gt;b__1() at System.Lazy1.CreateValue()
at System.Lazy1.LazyInitValue() at System.Lazy1.CreateValue()
at Clide.Composition.ExportsServiceLocator.<DoGetInstance>b__0(Lazy1 e) at System.Lazy1.CreateValue()
at System.Lazy1.get_Value() at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 source)
at System.Lazy1.LazyInitValue() at Clide.Composition.ExportsServiceLocator.DoGetInstance(Type serviceType, String key) at System.Lazy1.get_Value()
at System.ComponentModel.Composition.Primitives.Export.GetExportedValueCore()
at System.ComponentModel.Composition.Primitives.Export.get_Value()
at System.ComponentModel.Composition.ExportServices.GetCastedExportedValueT
at System.ComponentModel.Composition.ExportServices.<>c__DisplayClass12_01.&lt;CreateStronglyTypedLazyOfT&gt;b__1() at Microsoft.VisualStudio.Composition.NetFxAdapters.MefV1ExportProvider.&lt;&gt;c__DisplayClass12_0.&lt;UnwrapExport&gt;b__1() at System.Lazy1.CreateValue()
at System.ComponentModel.Composition.ExportServices.GetCastedExportedValueT
at System.ComponentModel.Composition.ExportServices.<>c__DisplayClass12_01.&lt;CreateStronglyTypedLazyOfT&gt;b__1() at System.Lazy1.CreateValue()
at System.Lazy1.LazyInitValue() at System.Lazy1.CreateValue()
at System.Lazy1.LazyInitValue() at System.Lazy1.get_Value()
at Clide.Composition.ExportsServiceLocator.<DoGetInstance>b__0(Lazy1 e) at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext()
at System.Linq.Enumerable.FirstOrDefaultTSource
at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 source)
at Clide.Composition.ExportsServiceLocator.DoGetInstance(Type serviceType, String key)
at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)
at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()
at Microsoft.VisualStudio.Composition.ExportProvider.<>c__DisplayClass53_0.<CreateExport>b__0()
at System.Lazy1.CreateValue() at System.Lazy1.LazyInitValue()
at System.Lazy1.get_Value() at Microsoft.VisualStudio.Composition.NetFxAdapters.MefV1ExportProvider.&lt;&gt;c__DisplayClass12_0.&lt;UnwrapExport&gt;b__1() at System.ComponentModel.Composition.Primitives.Export.GetExportedValueCore() at System.ComponentModel.Composition.Primitives.Export.get_Value() at System.ComponentModel.Composition.ExportServices.GetCastedExportedValue[T](Export export) at System.ComponentModel.Composition.ExportServices.&lt;&gt;c__DisplayClass12_01.<CreateStronglyTypedLazyOfT>b__1()
at System.Lazy1.CreateValue() at System.Lazy1.LazyInitValue()
at System.Lazy1.get_Value() at Clide.Composition.ExportsServiceLocator.&lt;DoGetInstance&gt;b__0(Lazy1 e)
at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 source)
at Clide.Composition.ExportsServiceLocator.DoGetInstance(Type serviceType, String key)
at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.<GetExportedValueHelper>b__0()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.<GetExportedValueHelper>b__0()
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportElement(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import, RuntimeExport export, Func3 lazyFactory) at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportSite(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import) at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.&lt;CreateValue&gt;b__10_0(RuntimeImport import) at System.Linq.Enumerable.WhereSelectArrayIterator2.MoveNext()
at System.Linq.Buffer1..ctor(IEnumerable1 source)
at System.Linq.Enumerable.ToArrayTSource
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue()
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.Create()
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()
at Microsoft.VisualStudio.Composition.ExportProvider.<>c__DisplayClass53_0.<CreateExport>b__0()
at System.Lazy1.CreateValue() at System.Lazy1.LazyInitValue()
at System.Lazy1.get_Value() at Microsoft.VisualStudio.Composition.ExportProvider.&lt;&gt;c__DisplayClass70_02.<GetExports>b__1()
at System.Lazy1.CreateValue() at System.Lazy1.LazyInitValue()
at System.Lazy1.get_Value() at Microsoft.VisualStudio.Composition.ExportProvider.GetExportedValue[T]() at Microsoft.VisualStudio.ComponentModelHost.ComponentModel.GetService[T]() at NuGet.PackageManagement.VisualStudio.ServiceLocator.&lt;GetComponentModelServiceAsync&gt;d__101.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.PackageManagement.VisualStudio.ServiceLocator.<>c__61.&lt;&lt;GetInstance&gt;b__6_0&gt;d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread() at Microsoft.VisualStudio.Threading.JoinableTask1.CompleteOnCurrentThread()
at Microsoft.VisualStudio.Threading.JoinableTaskFactory.RunT
at Microsoft.VisualStudio.Threading.JoinableTaskFactory.RunT
at NuGet.PackageManagement.VisualStudio.ServiceLocator.GetInstanceTService
at NuGet.PackageManagement.VisualStudio.VSSolutionManager.GetProjectFactory()
at NuGet.PackageManagement.VisualStudio.VSSolutionManager.EnsureNuGetAndEnvDTEProjectCache()
at NuGet.PackageManagement.VisualStudio.VSSolutionManager.OnSolutionExistsAndFullyLoaded()
at NuGet.PackageManagement.VisualStudio.VSSolutionManager.OnCmdUIContextChanged(UInt32 dwCmdUICookie, Int32 fActive)
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()
at Microsoft.VisualStudio.Composition.ExportProvider.<>c__DisplayClass53_0.<CreateExport>b__0()
at System.Lazy1.CreateValue() at System.Lazy1.LazyInitValue()
at System.Lazy1.get_Value() at Microsoft.VisualStudio.Composition.ExportProvider.&lt;&gt;c__DisplayClass70_02.<GetExports>b__1()
at System.Lazy1.CreateValue() at System.Lazy1.LazyInitValue()
at System.Lazy1.get_Value() at Microsoft.VisualStudio.Composition.ExportProvider.GetExportedValue[T]() at Microsoft.VisualStudio.ComponentModelHost.ComponentModel.GetService[T]() at NuGet.PackageManagement.VisualStudio.ServiceLocator.&lt;GetComponentModelServiceAsync&gt;d__101.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.PackageManagement.VisualStudio.ServiceLocator.<>c__61.&lt;&lt;GetInstance&gt;b__6_0&gt;d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread() at Microsoft.VisualStudio.Threading.JoinableTask1.CompleteOnCurrentThread()
at Microsoft.VisualStudio.Threading.JoinableTaskFactory.RunT
at Microsoft.VisualStudio.Threading.JoinableTaskFactory.RunT
at NuGet.PackageManagement.VisualStudio.ServiceLocator.GetInstanceTService
at NuGetVSExtension.NuGetPackage.LoadSettings()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()
at Microsoft.VisualStudio.Composition.ExportProvider.<>c__DisplayClass53_0.<CreateExport>b__0()
at System.Lazy1.CreateValue() at System.Lazy1.LazyInitValue()
at System.Lazy1.get_Value() at Microsoft.VisualStudio.Composition.ExportProvider.&lt;&gt;c__DisplayClass70_02.<GetExports>b__1()
at System.Lazy1.CreateValue() at System.Lazy1.LazyInitValue()
at System.Lazy1.get_Value() at Microsoft.VisualStudio.Composition.ExportProvider.GetExportedValue[T]() at Microsoft.VisualStudio.ComponentModelHost.ComponentModel.GetService[T]() at NuGet.PackageManagement.VisualStudio.ServiceLocator.&lt;GetComponentModelServiceAsync&gt;d__101.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.PackageManagement.VisualStudio.ServiceLocator.<>c__61.&lt;&lt;GetInstance&gt;b__6_0&gt;d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread() at Microsoft.VisualStudio.Threading.JoinableTask1.CompleteOnCurrentThread()
at Microsoft.VisualStudio.Threading.JoinableTaskFactory.RunT
at Microsoft.VisualStudio.Threading.JoinableTaskFactory.RunT
at NuGet.PackageManagement.VisualStudio.ServiceLocator.GetInstanceTService
at NuGetVSExtension.NuGetPackage.GetCredentialProviders()
at NuGetVSExtension.NuGetPackage.SetDefaultCredentialProvider()
at NuGetVSExtension.NuGetPackage.Initialize()
at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsPackage.SetSite(IServiceProvider sp)
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()
at Microsoft.VisualStudio.Composition.ExportProvider.<>c__DisplayClass53_0.<CreateExport>b__0()
at System.Lazy1.CreateValue() at System.Lazy1.LazyInitValue()
at System.Lazy1.get_Value() at Microsoft.VisualStudio.Composition.ExportProvider.&lt;&gt;c__DisplayClass70_02.<GetExports>b__1()
at System.Lazy1.CreateValue() at System.Lazy1.LazyInitValue()
at System.Lazy1.get_Value() at Microsoft.VisualStudio.Composition.ExportProvider.GetExportedValue[T]() at Microsoft.VisualStudio.ComponentModelHost.ComponentModel.GetService[T]() at NuGet.PackageManagement.VisualStudio.ServiceLocator.&lt;GetComponentModelServiceAsync&gt;d__101.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.PackageManagement.VisualStudio.ServiceLocator.<>c__61.&lt;&lt;GetInstance&gt;b__6_0&gt;d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread() at Microsoft.VisualStudio.Threading.JoinableTask1.CompleteOnCurrentThread()
at Microsoft.VisualStudio.Threading.JoinableTaskFactory.RunT
at Microsoft.VisualStudio.Threading.JoinableTaskFactory.RunT
at NuGet.PackageManagement.VisualStudio.ServiceLocator.GetInstanceTService
at NuGetVSExtension.NuGetPackage.LoadSettings()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()
at Microsoft.VisualStudio.Composition.ExportProvider.<>c__DisplayClass53_0.<CreateExport>b__0()
at System.Lazy1.CreateValue() at System.Lazy1.LazyInitValue()
at System.Lazy1.get_Value() at Microsoft.VisualStudio.Composition.ExportProvider.&lt;&gt;c__DisplayClass70_02.<GetExports>b__1()
at System.Lazy1.CreateValue() at System.Lazy1.LazyInitValue()
at System.Lazy1.get_Value() at Microsoft.VisualStudio.Composition.ExportProvider.GetExportedValue[T]() at Microsoft.VisualStudio.ComponentModelHost.ComponentModel.GetService[T]() at NuGet.PackageManagement.VisualStudio.ServiceLocator.&lt;GetComponentModelServiceAsync&gt;d__101.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.PackageManagement.VisualStudio.ServiceLocator.<>c__61.&lt;&lt;GetInstance&gt;b__6_0&gt;d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread() at Microsoft.VisualStudio.Threading.JoinableTask1.CompleteOnCurrentThread()
at Microsoft.VisualStudio.Threading.JoinableTaskFactory.RunT
at Microsoft.VisualStudio.Threading.JoinableTaskFactory.RunT
at NuGet.PackageManagement.VisualStudio.ServiceLocator.GetInstanceTService
at NuGetVSExtension.NuGetPackage.GetCredentialProviders()
at NuGetVSExtension.NuGetPackage.SetDefaultCredentialProvider()
at NuGetVSExtension.NuGetPackage.Initialize()
at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsPackage.SetSite(IServiceProvider sp)
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()
at Microsoft.VisualStudio.Composition.ExportProvider.<>c__DisplayClass53_0.<CreateExport>b__0()
at System.Lazy1.CreateValue() at System.Lazy1.LazyInitValue()
at System.Lazy1.get_Value() at Microsoft.VisualStudio.Composition.ExportProvider.&lt;&gt;c__DisplayClass70_02.<GetExports>b__1()
at System.Lazy1.CreateValue() at System.Lazy1.LazyInitValue()
at System.Lazy1.get_Value() at Microsoft.VisualStudio.Composition.ExportProvider.GetExportedValue[T]() at Microsoft.VisualStudio.ComponentModelHost.ComponentModel.GetService[T]() at NuGet.PackageManagement.VisualStudio.ServiceLocator.&lt;GetComponentModelServiceAsync&gt;d__101.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.PackageManagement.VisualStudio.ServiceLocator.<>c__61.&lt;&lt;GetInstance&gt;b__6_0&gt;d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread() at Microsoft.VisualStudio.Threading.JoinableTask1.CompleteOnCurrentThread()
at Microsoft.VisualStudio.Threading.JoinableTaskFactory.RunT
at Microsoft.VisualStudio.Threading.JoinableTaskFactory.RunT
at NuGet.PackageManagement.VisualStudio.ServiceLocator.GetInstanceTService
at NuGetVSExtension.NuGetPackage.LoadSettings()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()
at Microsoft.VisualStudio.Composition.ExportProvider.<>c__DisplayClass53_0.<CreateExport>b__0()
at System.Lazy1.CreateValue() at System.Lazy1.LazyInitValue()
at System.Lazy1.get_Value() at Microsoft.VisualStudio.Composition.ExportProvider.&lt;&gt;c__DisplayClass70_02.<GetExports>b__1()
at System.Lazy1.CreateValue() at System.Lazy1.LazyInitValue()
at System.Lazy1.get_Value() at Microsoft.VisualStudio.Composition.ExportProvider.GetExportedValue[T]() at Microsoft.VisualStudio.ComponentModelHost.ComponentModel.GetService[T]() at NuGet.PackageManagement.VisualStudio.ServiceLocator.&lt;GetComponentModelServiceAsync&gt;d__101.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.PackageManagement.VisualStudio.ServiceLocator.<>c__61.&lt;&lt;GetInstance&gt;b__6_0&gt;d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread() at Microsoft.VisualStudio.Threading.JoinableTask1.CompleteOnCurrentThread()
at Microsoft.VisualStudio.Threading.JoinableTaskFactory.RunT
at Microsoft.VisualStudio.Threading.JoinableTaskFactory.RunT
at NuGet.PackageManagement.VisualStudio.ServiceLocator.GetInstanceTService
at NuGetVSExtension.NuGetPackage.GetCredentialProviders()
at NuGetVSExtension.NuGetPackage.SetDefaultCredentialProvider()
at NuGetVSExtension.NuGetPackage.Initialize()
at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsPackage.SetSite(IServiceProvider sp)System.Runtime.InteropServices.COMException (0x8001010E): GetFullVsVersionString must be called on the UI thread.
at Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread(String callerMemberName)
at NuGet.PackageManagement.VisualStudio.VSVersionHelper.GetFullVsVersionString()
at NuGet.PackageManagement.VisualStudio.VSSolutionManager..ctor()
Comment 1 Ben Beckley 2016-09-09 20:18:27 UTC
Hello Hrvoje,

Thank you for taking the time to file these bug reports. We were not able to reproduce an issue with the NuGet Package Manager. Could you please provide more information so that we may better reproduce the problem?

- VS version and edition
- NuGet Package Manager version
- Reproduction steps

Thank you.
Comment 2 Hrvoje 2016-09-09 22:46:43 UTC
Hi Ben,

Here it is:

Visual Studio Professional 2015
Version 14.0.25425.01 Update3

Nuget Package Manager 3.4.4

Reproduction steps:
Click on one of the items in menu:
- Build Project
- Nuget Package manager settings

Thanks
Comment 3 Hrvoje 2016-09-09 22:57:07 UTC
Additional note:

When Xamarin project is not open, everything works fine.
Comment 6 Brendan Zagaeski (Xamarin Team, assistant) 2016-09-14 05:05:04 UTC
Copying additional information from duplicate Bug 44227:

> # Steps to reproduce
> Open a Xamarin solution
> Right-click Solution, click "Manage NuGet Packages for Solution..."
> 
> # Expected behavior
> Should display NuGet packages for solution
> 
> # Actual behavior
> Causes error: "System.Runtime.InteropServices.COMException:
> GetFullVsVersionString must be called on the UI thread."
> 
> # Supplemental info (logs, images, videos)
> See corresponding bug reported on NuGet GitHub:
> https://github.com/NuGet/Home/issues/3419
Comment 7 Brendan Zagaeski (Xamarin Team, assistant) 2016-09-14 05:19:54 UTC
Bug 44227, Comment 3 also mentions:

> Also I installed C8 on a clean install of Windows 10 with no beta or alpha
> Xamarin software ever installed.
> 
> I can no longer open Package Manager Console or any GUI related to managing
> NuGet Packages. 
> 
> NuGet Package Manager for Visual Studio 3.5.0.1484


Combined with James's results in non-public Comment 4 and Comment 5, this suggests that perhaps installing on a fresh system will hit this issue with some frequency.




## Possible test for anyone who can hit this problem reliably

This error does seem different from other more common "LegacySitePackage failed for package" errors, but just as a small experiment to be thorough, if someone has a system that's hitting this, it might be worth quickly double-checking that deleting the ComponentModelCache folder(s) [1] does _not_ resolve the issue.

[1] %LOCALAPPDATA%\Microsoft\VisualStudio\1*.0\ComponentModelCache

(The reporter in Bug 44227, Comment 0 does have the "Clear MEF Component Cache" extension installed, so it's fairly likely that this has already been tested without success.)

(See Bug 40781, Comment 19 for a bit more background on the potential issue.)


Thanks!
Comment 8 Brendan Zagaeski (Xamarin Team, assistant) 2016-09-14 05:20:03 UTC
*** Bug 44227 has been marked as a duplicate of this bug. ***
Comment 9 Brendan Zagaeski (Xamarin Team, assistant) 2016-09-14 05:24:12 UTC
## One more possible experiment to try

There was follow up to non-public Comment 4 and Comment 5 in https://github.com/NuGet/Home/issues/3419#issuecomment-246860446:

> I uninstalled Xamarin and re-Installed Xamarin and it fixed it up for me.

So if clearing the MEF component cache doesn't help, it might be worth trying the other thorough uninstall / reinstall steps on [1] to see if by any chance they might resolve the issue.

[1] https://developer.xamarin.com/guides/cross-platform/getting_started/visual_studio_with_xamarin/troubleshooting/uninstall-xamarinvs/
Comment 10 Hrvoje 2016-09-14 05:43:18 UTC
Uninstall / reinstall really helps, but only if we return to stable version.
Installing beta again brings up the problem.
Comment 12 Hrvoje 2016-09-14 06:00:23 UTC
For those who are interested, i found temporary workaround, but you must follow steps every time you open VS:

- before you open any project, open Nuget Package Manager Settings, and click ok.
- now open your project, and everything works, until next VS restart.

It seams that somehow VS holds static reference to nuget package manager and if it was started initialiy on UI thread, it has no problems accessing it again.

So my conclusion is that Xamarin is accessing Nuget package manager while project is opening and that static reference is firstly referenced in the background thread.
Comment 13 Michael Rumpler 2016-09-14 09:06:07 UTC
I have the same problem. The workaround works for me.

@Hrvoje, you usually have to change the status from NEEDINFO back to NEW in order that Xamarin employees look at a ticket again. Although it seems like this time the NuGet ticket also attracted their attention. ;-)
Comment 14 info 2016-09-14 13:13:50 UTC
The problem still exists in the stable XamarinVS 4.2.0, Cycle 8 release.
Comment 15 Daniel Cazzulino 2016-09-14 18:26:04 UTC
I'm struggling to repro it, tested the following scenarios:

- Open blank VS, File | New | Cross-Platform Native app, build, manage nuget packages 
- Directly open the above solution from windows explorer, build, manage nuget packages
- Close and open above solution, same actions

I have put together a very simple VSIX extension that loads the NuGet VS package when a solution exists, which should solve the issue for those with a repro, so as to unblock you.

Please let me know if it works. It's available at http://xvs.xamarin.com/patcheddrops/NuGetFixer.vsix 

Thanks
Comment 16 Daniel Cazzulino 2016-09-14 18:35:02 UTC
Just uploaded a small fix to the tool.
Comment 17 Hrvoje 2016-09-14 18:53:50 UTC
This tool works for me.
I hope you will include it in Xamarin setup.
Comment 18 Craig Johnson 2016-09-14 20:17:25 UTC
Tool works for me as well.
Comment 19 Daniel Cazzulino 2016-09-15 15:28:12 UTC
The underlying issue is not a Xamarin issue but a NuGet one. 

Upstream issue report at https://github.com/NuGet/Home/issues/3419
Fix was provided at https://github.com/NuGet/NuGet.Client/pull/871

And this temporary fix extension has been made more broadly available 
for users who face the issue: https://visualstudiogallery.msdn.microsoft.com/77ffcb6d-3d94-47fa-8259-3112efac0a3e

Please reopen the bug if the published updated tool doesn't fix the 
issue for you.


Thanks!
Comment 20 ToddG 2016-09-15 17:11:57 UTC
Your analysis of this fix was superb !!

That NuGet fix (https://github.com/NuGet/Home/issues/3419) worked for me too.  

I feel like it started to occur IMMEDIATELY after I installed the latest Xamarin update.  But, I cannot be sure.

I am using:   

Microsoft Visual Studio Community 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.6.01586

Installed Version: Community

Microsoft Visual Studio Tools for Applications 2015   00322-20000-00000-AA262
Microsoft Visual Studio Tools for Applications 2015

Visual Basic 2015   00322-20000-00000-AA262
Microsoft Visual Basic 2015

Visual C# 2015   00322-20000-00000-AA262
Microsoft Visual C# 2015

Visual C++ 2015   00322-20000-00000-AA262
Microsoft Visual C++ 2015

Visual F# 2015   00322-20000-00000-AA262
Microsoft Visual F# 2015

Windows Phone SDK 8.0 - ENU   00322-20000-00000-AA262
Windows Phone SDK 8.0 - ENU

Application Insights Tools for Visual Studio Package   7.6.00907.1
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2015.1   14.1.20907.0
ASP.NET and Web Tools 2015.1

ASP.NET Web Frameworks and Tools 2012.2   4.1.41102.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.40314.0
For additional information, visit http://www.asp.net/

Azure App Service Tools v2.9.5   14.0.20810.0
Azure App Service Tools v2.9.5

Azure Data Lake Node   1.0
This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio   2.1.0000.0
Microsoft Azure Data Lake Tools for Visual Studio

Command Bus, Event Stream and Async Manager   Merq
Provides ICommandBus, IEventStream and IAsyncManager MEF services for loosely coupled Visual Studio extension components communication and integration.

Common Azure Tools   1.8
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

GitHub.VisualStudio   1.0
A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript Project System   2.0
JavaScript Project System

Microsoft .NET Core Tools (Preview 2)   14.1.20907.0
Microsoft .NET Core Tools (Preview 2)

Microsoft Azure Hive Query Language Service   2.1.0000.0
Language service for Hive query

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

Microsoft Azure Tools   2.9
Microsoft Azure Tools for Microsoft Visual Studio 2015 - v2.9.40715.2

NuGet Package Manager   3.5.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Analysis Services   13.0.1601.5
Microsoft SQL Server Analysis Services Designer 
Version 13.0.1601.5

SQL Server Data Tools   14.0.60525.0
Microsoft SQL Server Data Tools

SQL Server Integration Services   
Microsoft SQL Server Integration Services Designer
Version 13.0.1601.5

SQL Server Reporting Services   13.0.1601.5
Microsoft SQL Server Reporting Services Designers 
Version 13.0.1601.5

ToolWindowHostedEditor   1.0
Hosting json editor into a tool window

TypeScript   1.8.36.0
TypeScript tools for Visual Studio

Visual Studio Tools for Universal Windows Apps   14.0.25420.01
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

Xamarin   4.2.0.680 (c4382f5)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   7.0.0.18 (0e59c36)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS   10.0.0.6 (6c3fee4)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 22 Saurabh 2016-09-22 05:41:15 UTC
I can also reproduced it with XVS 4.2.0.675 after adding xamarin component. This is the screencastf or the same: http://www.screencast.com/t/Vduebrelse with below steps:
1. Add new fresh project
2. added Xamarin Component (Azure Messaging)
3. Reopen same project
4. Right click Solution->Manage NuGet Packages for Solution


I have checked the same with C8SR0 build (XVS 4.2.0.688), With this build I am not seeing this Issue.
Environment Info: https://gist.github.com/saurabh360/e177a27d09a6cb07edde4f6ecb558aff

Notice (2018-05-21): bugzilla.xamarin.com will be switching to read-only mode on Thursday, 2018-05-25 22:00 UTC.

Please join us on Visual Studio Developer Community and GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs and copy them to the new locations as needed for follow-up. The See Also field on each Bugzilla bug will be updated with a link to its new location when applicable.

After Bugzilla is read-only, if you have new information to add for a bug that does not yet have a matching issue on Developer Community or GitHub, you can create a follow-up issue in the new location. Copy and paste the title and description from this bug, and then add your new details. You can get a pre-formatted version of the title and description here:

In special cases you might also want the comments:

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Note You need to log in before you can comment on or make changes to this bug.