Cannot open Nuget package manager in Visual Studio 2015:
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.<CreateValue>b__10_0(RuntimeImport import)
at System.Linq.Enumerable.WhereSelectArrayIterator
2.MoveNext()
at System.Linq.Buffer1..ctor(IEnumerable
1 source)
at System.Linq.Enumerable.ToArrayTSource
at System.Lazy1.CreateValue()
at System.Lazy
1.get_Value()
at System.Linq.Enumerable.FirstOrDefaultTSource
at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable
1 source)
at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable
1 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.Lazy
1.LazyInitValue()
at System.Lazy1.get_Value()
at Microsoft.VisualStudio.Composition.NetFxAdapters.MefV1ExportProvider.<>c__DisplayClass12_0.<UnwrapExport>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.<>c__DisplayClass12_0
1.<CreateStronglyTypedLazyOfT>b__1()
at System.Lazy1.CreateValue()
at System.Lazy
1.LazyInitValue()
at System.Lazy1.get_Value()
at Clide.Composition.ExportsServiceLocator.<DoGetInstance>b__0(Lazy
1 e)
at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable
1 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.<CreateValue>b__10_0(RuntimeImport import)
at System.Linq.Enumerable.WhereSelectArrayIterator
2.MoveNext()
at System.Linq.Buffer1..ctor(IEnumerable
1 source)
at System.Linq.Enumerable.ToArrayTSource
at Microsoft.VisualStudio.Threading.JoinableTaskFactory.RunT
at Microsoft.VisualStudio.Threading.JoinableTaskFactory.RunT
at Microsoft.VisualStudio.Threading.JoinableTaskFactory.RunT
at Microsoft.VisualStudio.Threading.JoinableTaskFactory.RunT
at Microsoft.VisualStudio.Threading.JoinableTaskFactory.RunT
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()
What version of the nuget extension are you using (the latest is 3.4.4, and the latest pre-release is 3.5-RC1 available on https://www.nuget.org/downloads
Just installed 3.5-RC1 and I'm getting same error.
Same.
Thanks @HEBOS and @craigajohnson.
We are not seeing this locally, so would be very helpful if you can share more details about your setup (version of VS, Windows, what other extensions you have installed).
Visual Studio 2015 with Update 3
Windows 10 Build 14915
Happens on either NuGet 3.4.4.1321 or latest 3.5 RC
Sometimes going in and out of VS and loading from a new solution will work. Once the "NuGet - Solution" view has loaded successfully at least once it will usually allow subsequent loads on different solutions.
Copy of Diag info from VS:
Microsoft Visual Studio Enterprise 2015
Version 14.0.25425.01 Update 3
Microsoft .NET Framework
Version 4.6.02001
Installed Version: Enterprise
Architecture and Modeling Tools 00322-90000-00223-AA767
Microsoft Architecture and Modeling Tools
UML® and Unified Modeling Language™ are trademarks or registered trademarks of the Object Management Group, Inc. in the United States and other countries.
LightSwitch for Visual Studio 2015 00322-90000-00223-AA767
Microsoft LightSwitch for Visual Studio 2015
Microsoft Visual Studio Tools for Applications 2015 00322-90000-00223-AA767
Microsoft Visual Studio Tools for Applications 2015
Visual Basic 2015 00322-90000-00223-AA767
Microsoft Visual Basic 2015
Visual C# 2015 00322-90000-00223-AA767
Microsoft Visual C# 2015
Visual C++ 2015 00322-90000-00223-AA767
Microsoft Visual C++ 2015
Visual F# 2015 00322-90000-00223-AA767
Microsoft Visual F# 2015
Windows Phone SDK 8.0 - ENU 00322-90000-00223-AA767
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.20810.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
Clang with Microsoft CodeGen 14.0.25516
Clang with Microsoft CodeGen
Clear MEF Component Cache 1.3.1
Clears the Visual Studio MEF component cache to fix issues with cache corruption.
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
KofePackagePackage Extension 1.0
KofePackagePackage Visual Studio Extension Detailed Info
Microsoft .NET Core Tools (Preview 2) 14.1.20810.0
Microsoft .NET Core Tools (Preview 2)
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
Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers
NuGet Package Manager 3.4.4
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.
Office Developer Tools for Visual Studio 2015 ENU 14.0.23928
Microsoft Office Developer Tools for Visual Studio 2015 ENU
PreEmptive Analytics Visualizer 1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.
Python Tools for Visual Studio 2.2.40623.00
Python Tools for Visual Studio provides IntelliSense, projects, templates, Interactive windows, and other support for Python developers.
Python Tools for Visual Studio - Django Integration 2.2.40623.00
Provides templates and integration for the Django web framework.
Python Tools for Visual Studio - Profiling Support 2.2.40623.00
Profiling support for Python projects.
R Tools for Visual Studio 0.4.20623.1711
Provides project system, R Interactive window, plotting, and more for the R programming language.
SQL Server Analysis Services 13.0.1605.88
Microsoft SQL Server Analysis Services Designer
Version 13.0.1605.88
SQL Server Data Tools 14.0.60629.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.1605.88
Microsoft SQL Server Reporting Services Designers
Version 13.0.1605.88
TypeScript 2.0.2.0
TypeScript tools for Visual Studio
Visual C++ for Cross Platform Mobile Development (Android) 14.0.25401.00
Visual C++ for Cross Platform Mobile Development (Android)
Visual C++ for Cross Platform Mobile Development (iOS) 14.0.25401.00
Visual C++ for Cross Platform Mobile Development (iOS)
Visual Studio Tools for Apache Cordova Update 10
Visual Studio Tools for Apache Cordova
Visual Studio Tools for Universal Windows Apps 14.0.25527.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.
Workflow Manager Tools 1.0 1.0
This package contains the necessary Visual Studio integration components for Workflow Manager.
Xamarin 4.2.0.675 (c54ec37)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin.Android 7.0.0.15 (f4db8a5)
Visual Studio extension to enable development for Xamarin.Android.
Xamarin.iOS 10.0.0.4 (d1ee3ba)
Visual Studio extension to enable development for Xamarin.iOS.
Thanks, we are taking a look
@HEBOS Can you provide an error log for 3.5-RC1? thanks
@craigajohnson I can't get an repro, do you have a consistent repro? Please share repro step or repro solution? thanks
There may be a correlation with the latest Xamarin for Visual Studio extensions (beta channel). If I open any solution containing Xamarin projects as the FIRST solution, I always get the error. If, however, I open a non-Xamarin solution first, I do not get the error and then I am able to load the Xamarin solution(s).
craigajohnson, this is also true at my side.
I'm also using beta channel. When I rollback to stable channel (this requires repairing Visual Studio), everything was all right, than after swiching to beta channel again, I get same "GetFullVsVersionString must be called on the UI thread" problem.
@craigajohnson thank you, that's helpful, I guess for some reason, Xamarin project trigger nuget initialization on a non-UI thread. What's the beta Version of Xamarin for visual studio extension?
Version at present is 4.2.675.
Here is my error log:
ActivityLog.zip
My configuration is as follows:
Microsoft Visual Studio Professional 2015
Version 14.0.25425.01 Update 3
Microsoft .NET Framework
Version 4.6.01038
Installed Version: Professional
LightSwitch for Visual Studio 2015 00322-40000-00000-AA317
Microsoft LightSwitch for Visual Studio 2015
Microsoft Visual Studio Tools for Applications 2015 00322-40000-00000-AA317
Microsoft Visual Studio Tools for Applications 2015
Visual Basic 2015 00322-40000-00000-AA317
Microsoft Visual Basic 2015
Visual C# 2015 00322-40000-00000-AA317
Microsoft Visual C# 2015
Visual C++ 2015 00322-40000-00000-AA317
Microsoft Visual C++ 2015
Windows Phone SDK 8.0 - ENU 00322-40000-00000-AA317
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 (RC1 Update 1) 14.1.20203.0
ASP.NET and Web Tools 2015 (RC1 Update 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 14.0.20316.0
Azure App Service Tools v2.9
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.0.6000.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.
Devart Entity Developer 6.0.82.0
Devart Entity Developer
Copyright © 2008-2016 Devart. All rights reserved.
Web: www.devart.com/entitydeveloper
Support: [email protected]
JavaScript Language Service 2.0
JavaScript Language Service
JavaScript Project System 2.0
JavaScript Project System
JetBrains ReSharper Ultimate 2016.2 Build 106.0.20160818.163633
JetBrains ReSharper Ultimate package for Microsoft Visual Studio. For more information about ReSharper Ultimate, visit http://www.jetbrains.com/resharper. Copyright © 2016 JetBrains, Inc.
Microsoft Azure HDInsight HQL Service 2.0.6000.0
Language service for Hive query
Microsoft Azure HDInsight Tools for Visual Studio 2.0.6000.0
An integrated development environment for HDInsight application development.
Microsoft Azure Mobile Services Tools 1.4
Microsoft Azure Mobile Services Tools
Multilingual App Toolkit 4.0.1605.0
Multilingual App Toolkit helps you localize your Windows Store app by providing file management, pseudo and machine translation, translation editor, and build integration. http://aka.ms/matinstallv4
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.
SAPReferenceManager 1.0
Manages References to Shared Projects
SQL Server Analysis Services 13.0.1605.88
Microsoft SQL Server Analysis Services Designer
Version 13.0.1605.88
SQL Server Data Tools 14.0.60629.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.1605.88
Microsoft SQL Server Reporting Services Designers
Version 13.0.1605.88
tangible T4 Editor 2.3.0
tangible engineering GmbH
ToolWindowHostedEditor 1.0
Hosting json editor into a tool window
TypeScript 1.8.36.0
TypeScript tools for Visual Studio
Xamarin 4.2.0.675 (c54ec37)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin.Android 7.0.0.15 (f4db8a5)
Visual Studio extension to enable development for Xamarin.Android.
Xamarin.iOS 10.0.0.4 (d1ee3ba)
Visual Studio extension to enable development for Xamarin.iOS.
zhili1208, I created a new bug ticket on https://bugzilla.xamarin.com/show_bug.cgi?id=44146 3 days ago, but they haven't begun resolving it yet.
If you want you can join discussion there and I'm sure your suggestions will be priceless.
@HEBOS @craigajohnson I updated to beta version 4.2.675 and created some IOS and android project, but I can't repro this issue, is there any special thing I need to do for repro?
@mrward @mhutch Can you look at this issue? Looks like Xamarin trigger nuget initialization on a non-UI thread.
@zhili1208 if I create a brand new solution with no packages it works. I will try to add the packages in the solution that is causing errors one-by-one and see if there is a clear repro.
@zhili1208 see link to zipped solution on OneDrive - I pared down my errant solution until it can get no smaller. In this case it appears to be with a Xamarin Component.
This does cause an error every time I run it.
cc @kzu ^
I cannot reproduce error using new clean project, even if I use packages.config from my project and make full reinstall of nuget packages. I downloaded @craigajohnson project also, and couldn't reproduce the error using it. It must be that project files are somehow corupted.
@craigajohnson, I just found temporary workaround.
Before you open any project, open Nuget Package Manager Settings, and click ok.
Now open your project, and everything works, until next VS restart.
On Tue, Sep 13, 2016, 9:36 AM HEBOS [email protected] wrote:
@craigajohnson https://github.com/craigajohnson, I just found temporary
workaround.
Before you open any project, open Nuget Package Manager Settings, and
klick ok.
Now open your project, and everything works, until next VS restart.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/NuGet/Home/issues/3419#issuecomment-246667180, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAKW6zgwoFkKPAsuEI8vxhuF9YRLa9Vnks5qppjDgaJpZM4J2odX
.
/kzu from mobile
I was able to repo this on my machine with I updated. I uninstalled Xamarin and re-Installed Xamarin and it fixed it up for me. I attached some logs into the Bugzilla report private though for the team to look at.
@jamesmontemagno uninstalling and reinstalling Xamarin on Windows did not fix it for me. I uninstalled from Add/Remove programs and then re-installed using the Xamarin installer. If there are other steps to perform for the uninstall/reinstall besides that then I will try them.
@craigajohnson that is what I did via the add/remove and then used the Xamarin installer from the site. odd....
@kzu - your workaround works for me.
Odd that I have two systems here, both updated with the latest Xamarin for VS this morning and the laptop is playing up while the workstation is fine.
You mean the clean MEF one?
On Wed, Sep 14, 2016, 4:29 AM Dave Carson [email protected] wrote:
@kzu https://github.com/kzu - your workaround works for me.
Odd that I have two systems here, both updated with the latest Xamarin for
VS this morning and the laptop is playing up while the workstation is fine.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/NuGet/Home/issues/3419#issuecomment-246929323, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAKW64-OR8iSBATeEgnwh0-OIOEfw0GAks5qp6JhgaJpZM4J2odX
.
/kzu from mobile
@kzu - I meant this one:
Before you open any project, open Nuget Package Manager Settings, and click ok.
Now open your project, and everything works, until next VS restart.
Ah, I was sure I hadn't provided any workarounds :)
Is there anything Xamarin should be doing to mitigate this? I guess we
could request a service provided by NuGet that would cause it to initialize
on the right thread?
On Wed, Sep 14, 2016, 8:37 AM Dave Carson [email protected] wrote:
@kzu https://github.com/kzu - I meant this one:
Before you open any project, open Nuget Package Manager Settings, and
click ok.Now open your project, and everything works, until next VS restart.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/NuGet/Home/issues/3419#issuecomment-246985652, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAKW62WTxmBjcbeuzZK57I1X4Dxh9Jcsks5qp9xdgaJpZM4J2odX
.
/kzu from mobile
My guess is that you are initializing NuGet from a background thread, which is not supported. We haven't been able to reproduce the scenario, so we can't help you yet with where to make a fix.
There are ways to make to force initialization back on the main thread, but the concern there is deadlocks which are even worse than the situation today.
@yishaigalatzer forgive dumb question but what is the risk in NuGet basically re-Invoking the initialization request on the UI thread (just catching Xamarin's/any one else's mistake?)
@yishaigalatzer well, it does look like nuget is using the JoinableTaskFactory, so it should be safe for us to initialize using the same, which is intended to prevent such deadlocks...
@craigajohnson the risk is deadlocks, and @kzu got it right,
extension is available to solve this issue . http://xvs.xamarin.com/patcheddrops/NuGetFixer.vsix untill it is fully fixed, this extension cold be used.
Same problem here, thanks @dktechindia your fix works for me
Cool, thanks confirming my little tool fixes the issue. I'll implement that
in our package now. (Essentially, ensure the NuGet package is loaded when
we load, on the UI thread).
On Thu, Sep 15, 2016, 7:01 AM Ciani Afonso [email protected] wrote:
Same problem here, thanks @dktechindia https://github.com/dktechindia
your fix works for me—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/NuGet/Home/issues/3419#issuecomment-247287383, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAKW604LJ6Kz5GLg41h4ug0Au8RhDrmMks5qqRd4gaJpZM4J2odX
.
/kzu from mobile
@ciani since you have a clear repro, I could use your help in implementing the fix in a smart way so that it doesn't negatively impact perf. for users that aren't facing the issue.
If you uninstall the extension, can you reproduce the issue again? (This will allow me to implement a selective fix and get your help in testing it out :))
If you uninstall the extension, can you reproduce the issue again?
uninstall, reboot, install
+.
Ok, @yishaigalatzer @rrelyea here is a simple repro of the issue. Create a new VSIX project, add a VS Package, and place this code in it:
[ProvideAutoLoad(UIContextGuids.SolutionExists)]
[PackageRegistration(UseManagedResourcesOnly = true)]
[Guid(PackageGuidString)]
public sealed class NuGetFixerPackage : Package
{
public const string PackageGuidString = "bc833460-e835-42e5-b487-68bf8f19c544";
protected override void Initialize()
{
base.Initialize();
var components = (IComponentModel)GetService(typeof(SComponentModel));
System.Threading.Tasks.Task.Run(() =>
{
try
{
var solution = components.DefaultExportProvider.GetExportedValue<object>("NuGet.PackageManagement.ISolutionManager");
}
catch (Exception ex)
{
Debug.Fail(ex.ToString());
}
});
}
}
The Debug.Fail
will kick in with the exact same exception shown in the stacktrace pasted in the original report.
Since MEF components can't assume they are being instantiated in the UI thread, I think it's improper for them to require being called on it. Sending a PR in a minute.
PR submitted.
@bondarenkod @ciani @dktechindia could you verify this updated extension fix still works for you?
https://visualstudiogallery.msdn.microsoft.com/77ffcb6d-3d94-47fa-8259-3112efac0a3e
Thank you - your extension has helped me!
Awesome :)
Our MEF component needs to run on the main thread because it accesses DTE, which must happen on the UI thread.
Please make sure you initialize NuGet on the main thread. Happy to have further discussion if you disagree.
Don't believe we should do any code change in NuGet for this...(we could fail faster...)
As the PR shows, the only reason this is failing with the reported stacktrace is because you're retrieving the VS version from the DTE and ensuring that the helper is called from the UI thread. You can safely do that from any thread. A simple test will show this:
[ProvideAutoLoad(UIContextGuids.SolutionExists)]
[PackageRegistration(UseManagedResourcesOnly = true)]
[Guid(PackageGuidString)]
public sealed class NuGetFixerPackage : Package
{
public const string PackageGuidString = "bc833460-e835-42e5-b487-68bf8f19c544";
protected override void Initialize()
{
base.Initialize();
System.Threading.Tasks.Task.Run(() =>
{
var dte = (DTE)GetService(typeof(DTE));
Trace.WriteLine($"Visual Studio Version: {dte.Version} ({dte.Edition})");
});
}
}
This totally works, because the DTE has already been initialized, and those properties don't fail when accessed from another thread.
Again, not trying to solve the general issue of MEF vs IVs* services and threading, but for the users currently experiencing the issue, this is the best route. The alternative would be for us to force NuGet to load earlier, as shown on my "fixer" extension. That would be bad if we're only doing it to avoid an exception when building a simple version string (which is what the stack trace and my repro/fix shows).
@kzu I do agree with you general assessment. Looking more into it I think that the fix has to be in Xamarin. There are a two reasons I can think of
@kzu
@bondarenkod @ciani @dktechindia could you verify this updated extension fix still works for you?
yes. thank you!
One questions for the affected users: you all happen to have Xamarin Components in at least one of the projects, don't you?
@kzu as per an earlier comment, yes, the simplest repro case I could generate involved a Xamarin Component. I kept removing packages one-by-one (at the time curious if it was package-specific) and it wasn't until I removed the components that it worked. Adding back in a component then raised the error (once out and back in to VS).
@kzu I can tell you this:
No VS restart between 4 and 5?? :o)
/kzu from mobile
Closing won't fix, as I think that is where we have landed on this issue. Xamarin needs to take a fix, as this needs to work with VS2015 as well as VS "15". Please chime in if I didn't capture the current thinking.
Same problem here, thanks @dktechindia your fix works for me
Has been resolved in the latest beta release: https://releases.xamarin.com/beta-preview-cycle-8-service-release-0/
I was experiencing this same issue with the 3.5 release, without having Xamarin installed. I'd say this is definitely a nuget issue rather than a Xamarin. I reverted to 3.4.4 where this does not happen.
Thanks for reporting in @Eric-Lizotte, we'll take a look.
Re-opening and leaving in 3.5 RTM milestone.
@Eric-Lizotte, could you provide some repro steps? Up until now, it seems like the reports of this error have involved Xamarin.
As I originally mentioned, this can happen if anyone (not just Xamarin),
consumes the NuGet interop assemblies from any extension at any point
before the package is loaded. Easily avoidable too :P
On Fri, Oct 14, 2016 at 1:15 PM Joel Verhagen [email protected]
wrote:
@Eric-Lizotte https://github.com/Eric-Lizotte, could you provide some
repro steps? Up until now, it seems like the reports of this error have
involved Xamarin.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/NuGet/Home/issues/3419#issuecomment-253848335, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAKW6-vgDkcW0-qj_ix_Pdwe-FNvqRbVks5qz6pygaJpZM4J2odX
.
/kzu from mobile
Hmm you know what? Looking at the extensions "Get Xamarin" is installed. I hadn't realized it was as I hadn't purposefully installed it myself. Uninstalling that did fix it, so sorry, it does look like a Xamarin issue. I'm not even sure what the "Get Xamarin" is, probably a teaser or some sort of prompting to get you to download the full Xamarin package? MS must be installing it by default with VS 2015 now. This is a brand new laptop that just had VS installed on 10/10/16 so perhaps you should be ready for some more people encountering this issue :)
That sounds very weird. IIRC, that extension just provides a template and
definitely does not interact with the nuget interfaces at all. /cc
@victorgarciaaprea @josegallardo
On Fri, Oct 14, 2016 at 1:48 PM Eric-Lizotte [email protected]
wrote:
Hmm you know what? Looking at the extensions "Get Xamarin" is installed. I
hadn't realized it was as I hadn't purposefully installed it myself.
Uninstalling that did fix it, so sorry, it does look like a Xamarin issue.
I'm not even sure what the "Get Xamarin" is, probably a teaser or some sort
of prompting to get you to download the full Xamarin package? MS must be
installing it by default with VS 2015 now. This is a brand new laptop that
just had VS installed on 10/10/16 so perhaps you should be ready for some
more people encountering this issue :)—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/NuGet/Home/issues/3419#issuecomment-253856421, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAKW646SZaMMf5IETG2r1hBo3zWqEO48ks5qz7JpgaJpZM4J2odX
.
/kzu from mobile
The "Get Xamarin" extension is installed by VS 2015 and just provides a template breadcrumb, which should show only if Xamarin is not already installed.
That "Get Xamarin" extension is the only Xamarin related extension I have installed too and I'm seeing the same problem.
I _did_ install a bunch of Azure SDK and Service Fabric stuff two days ago though. Whatever the latest versions as of the comment are in the Web Installer.
I hadn't seen this issue until today.
That is true of myself as well, the azure SDK + service fabric
Just wanted to add some data at @rrelyea 's request, I have VS 2015 Update 3 (14.0.25421.03) and the Nuget Extension (3.5.0.1484) and despite having Xamarin SDK stuff for months, this problem showed up for the first time for me restoring packages after a seemingly unrelated Windows Update reboot happened. I'll have the machine in this state for a bit longer if you want any more information or to investigate on it.
I get the same issue ... no xamarin
Hey @MrTortoise, could you describe your steps to reproduce this issue? Also, what version of Visual Studio and NuGet do you have?
sure
Reproduction steps i am not clear on. Now i get it whenever i open a new solution. The workaround with solution closed open package manager settings click ok has worked at least once.
I had just forked this:
https://github.com/Pxtl/XmlCommentMarkDownGenerator
with the intent of adding
Tried to reproduce again, had problems. When I add the microsoft curated feeds it wasnt broken. Removed then restarted and it came back. However have just tried to reproduce 5-6 times and failed. All seems to be fine. No doubt itl fail as soon as i post this.
My VS info
Microsoft Visual Studio Enterprise 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.6.01586
Installed Version: Enterprise
Architecture and Modeling Tools 00322-80000-00000-AA043
Microsoft Architecture and Modeling Tools
UML® and Unified Modeling Language™ are trademarks or registered trademarks of the Object Management Group, Inc. in the United States and other countries.
Visual Basic 2015 00322-80000-00000-AA043
Microsoft Visual Basic 2015
Visual C# 2015 00322-80000-00000-AA043
Microsoft Visual C# 2015
Visual C++ 2015 00322-80000-00000-AA043
Microsoft Visual C++ 2015
Visual F# 2015 00322-80000-00000-AA043
Microsoft Visual F# 2015
Application Insights Tools for Visual Studio Package 7.9.01013.2
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.8.1 14.0.11123.0
Azure App Service Tools v2.8.1
Common Azure Tools 1.8
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
Fabric.DiagnosticEvents 1.0
Fabric Diagnostic Events
GhostDoc 5.3.16270.0
GhostDoc automatically generates XML documentation comments.
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 Mobile Services Tools 1.4
Microsoft Azure Mobile Services Tools
MySQL for Visual Studio 1.2.6
Data design and management tools for MySQL. Copyright © 2007-2015 Oracle, Inc.
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.
Python Tools for Visual Studio 2.2.40825.00
Python Tools for Visual Studio provides IntelliSense, projects, templates, Interactive windows, and other support for Python developers.
Python Tools for Visual Studio - Django Integration 2.2.40825.00
Provides templates and integration for the Django web framework.
Python Tools for Visual Studio - Profiling Support 2.2.40825.00
Profiling support for Python projects.
Sandcastle Help File Builder SHFB
Visual Studio integration for the Sandcastle Help File Builder.
https://GitHub.com/EWSoftware/SHFB
SQL Server Data Tools 14.0.60519.0
Microsoft SQL Server Data Tools
TechTalk SpecFlow 2015.1
TechTalk SpecFlow - Binding business requirements to .NET code, http://www.specflow.org
Copyright © 2009–2013 TechTalk
TypeScript 1.8.36.0
TypeScript tools for Visual Studio
Visual Studio Spell Check Everywhere VSSpellCheckEverywhere
An extension that enables spell checking within any Visual Studio file editor or tool window that uses WPF text boxes.
https://GitHub.com/EWSoftware/VSSpellChecker
Visual Studio Spell Checker VSSpellChecker
An editor extension that checks the spelling of comments, strings, and plain text as you type or interactively with tool windows.
https://GitHub.com/EWSoftware/VSSpellChecker
This started happening for me on Friday, whenever opening NuGet package manager, without any relation to Xamarin projects. However, updating Xamarin to latest stable build _did_ fix it!
That's because our workaround was to force load the nuget extension on
solution load.
On Sat, Oct 15, 2016, 3:49 AM Sander Saares [email protected]
wrote:
This started happening for me on Friday, whenever opening NuGet package
manager, without any relation to Xamarin projects. However, updating
Xamarin to latest stable build _did_ fix it!—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/NuGet/Home/issues/3419#issuecomment-253966978, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAKW6ylXymnu866negox0SQqW-8epuuwks5q0HdtgaJpZM4J2odX
.
/kzu from mobile
Starting to see this problem myself today. Have not got Xamarin installed but _did_ install Service Fabric earlier on today. Uninstalling the Service Fabric Tools for Visual Studio stops the error from occurring. I'm on the NuGet beta channel (which is showing version 3.5.0) in VS 2015
Got this error as of today, log attached
Edit: Fixed it by uninstalling NuGet Package Manager 3.4.4 and installing 3.3.0.
Having the same issue, would be glad to get it fixed someday.
Thanks!
Hey guys, thanks for all the reports of this issue. I am working on getting a fix into dev
right now. In the mean time, could you try this private build out for Visual Studio 2015 (dev14)?
https://dotnet.myget.org/F/nuget-vsix/vsix/NuGet.0d421874-a3b2-4f67-b53a-ecfce878063b-3.6.0.2363.vsix
You will need to uninstall the old version of NuGet first before trying this one.
Hi,
In my case, whenever I added a specific project (Azure Service Fabric App project) to my solution I would get a message box with a path to a log file. In the log file, I would see the exception described in this issue - the only difference being the component namespace.
I tried @joelverhagen 's private package and it does stop the error message from popping up when I add the project now.
VisualStudio is badly foo barred. Open VS with no Solution. Open Package Manager Console. Now open a solution. The Console window asks you to restore packages. Click Restore. It appears that the packages get restored. Then nothing shows up in the SOlution Explorer window. Absolutely nothing. And if you try to open code say from ClassView then exceptions will be thrown.
jeffsaremi - can you explain what version you have installed, and how you got into that state?
this is what I had:
Microsoft Visual Studio Enterprise 2015
Version 14.0.25425.01 Update 3
Microsoft .NET Framework
Version 4.6.01586
I don't know how i got to that state
Problems started with getting the error which is the subject of this thread (GetFullVsVersionString must be called on the UI thread) suddenly out of nowhere.
Reading through some of the comments here, i thought it would be interesting to see what happens if I load Nuget by way of opening the console and then try to open a solution (any solution). And that's where the SolutionExplorer started becoming completely blank
I must mention that I exited VS. Installed the vsix which is posted a few comments above and that resolved all my problems completely.
@jeffsaremi - great. Glad you are in a good state again. thx.
developing xamarin apps in visual studio is a nightmare. everytime i pull in a change something breaks in vs.
@eoinahern as showcased in this bug, it's not always Xamarin's fault, with all the complex matrix of dependencies we have. But as you can also see here, we're working closely with other teams to improve the experience.
If you're facing other issues, I'd definitely like to know. Please do report at bugzilla.xamarin.com and feel free to ping me at kzu at microsoft dot com or @kzu on Twitter.
Thanks!
I installed Telerik and this occured
@n873 Thanks for the Telerik comment - I had installed an update and noticed 2 extensions for Visual Studio got installed. I removed them and the error disappeared.
Also agree to the Telerik comment... that was messing me up. I updated the components I was using and the error seems to have gone away. I'm guessing they fixed something on their end with their VS integration pieces.
I also installed the latest Telerik on VS2015 Update 3(latest) Enterprise and this occured. My issue was fixed by installing this plugin
Most helpful comment
@craigajohnson, I just found temporary workaround.
Before you open any project, open Nuget Package Manager Settings, and click ok.
Now open your project, and everything works, until next VS restart.