The "XSharp Project System" package did not load correctly in VS 2019 16.4.1
Posted: Wed Dec 18, 2019 9:42 am
On one out of two computers where I've instealled XSharp 2.2, I get an error when starting Visual Studio 2019 Professional edition 16.4.1 (Version 4.8.03752):
Error: "The 'XSharp Project System" package did not load correctly.
The problem may have been caused by a configuration change or by the installation of another extension. You can get more information by examining the file "C:Users<myusername>AppDataRoamingMicrosoftVisualStudio16.0_5291f88dActivityLog.xml.
Restarting Visual Studio could help resolve the issue.
Continue to show this error message?" Yes/No.
Restarting visual studio does not help.
I've attached ActivityLog.xml, but the key entry seems to be:
SetSite failed for package [XSharp Project System]Source: 'Microsoft.VisualStudio.Shell.14.0' Description: Due to high risk of deadlock you cannot call GetService from a background thread in an AsyncPackage derived class. You should instead call GetServiceAsync (without calling Result or Wait on the resultant Task object) or switch to the UI thread with the JoinableTaskFactory.SwitchToMainThreadAsync method before calling GetService. System.InvalidOperationException: Due to high risk of deadlock you cannot call GetService from a background thread in an AsyncPackage derived class. You should instead call GetServiceAsync (without calling Result or Wait on the resultant Task object) or switch to the UI thread with the JoinableTaskFactory.SwitchToMainThreadAsync method before calling GetService.at Microsoft.VisualStudio.Shell.AsyncPackage.GetService(Type serviceType)at Microsoft.VisualStudio.Shell.Package.System.IServiceProvider.GetService(Type serviceType)at Microsoft.VisualStudio.Package.LanguageService.SetSite(Object site)at XSharp.Project.XSharpProjectPackage.<InitializeAsync>d__16.MoveNext() in C:XSharpDevPublicVisualStudioProjectPackageXSharpProjectPackage.cs:line 287 --- 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.Shell.AsyncPackage.<>c__DisplayClass16_0.<<Microsoft-VisualStudio-Shell-Interop-IAsyncLoadablePackageInitialize-Initialize>b__1>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.<JoinAsync>d__68.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at Microsoft.VisualStudio.Services.VsTask.RethrowException(AggregateException e)at Microsoft.VisualStudio.Services.VsTask.InternalGetResult(Boolean ignoreUIThreadCheck)at Microsoft.VisualStudio.Services.VsTask.GetResult()
I've attached a screenshot of the error message, info about my visual studio version, and ActivityLog.xml (zipped, because of file type limitations)
Error: "The 'XSharp Project System" package did not load correctly.
The problem may have been caused by a configuration change or by the installation of another extension. You can get more information by examining the file "C:Users<myusername>AppDataRoamingMicrosoftVisualStudio16.0_5291f88dActivityLog.xml.
Restarting Visual Studio could help resolve the issue.
Continue to show this error message?" Yes/No.
Restarting visual studio does not help.
I've attached ActivityLog.xml, but the key entry seems to be:
SetSite failed for package [XSharp Project System]Source: 'Microsoft.VisualStudio.Shell.14.0' Description: Due to high risk of deadlock you cannot call GetService from a background thread in an AsyncPackage derived class. You should instead call GetServiceAsync (without calling Result or Wait on the resultant Task object) or switch to the UI thread with the JoinableTaskFactory.SwitchToMainThreadAsync method before calling GetService. System.InvalidOperationException: Due to high risk of deadlock you cannot call GetService from a background thread in an AsyncPackage derived class. You should instead call GetServiceAsync (without calling Result or Wait on the resultant Task object) or switch to the UI thread with the JoinableTaskFactory.SwitchToMainThreadAsync method before calling GetService.at Microsoft.VisualStudio.Shell.AsyncPackage.GetService(Type serviceType)at Microsoft.VisualStudio.Shell.Package.System.IServiceProvider.GetService(Type serviceType)at Microsoft.VisualStudio.Package.LanguageService.SetSite(Object site)at XSharp.Project.XSharpProjectPackage.<InitializeAsync>d__16.MoveNext() in C:XSharpDevPublicVisualStudioProjectPackageXSharpProjectPackage.cs:line 287 --- 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.Shell.AsyncPackage.<>c__DisplayClass16_0.<<Microsoft-VisualStudio-Shell-Interop-IAsyncLoadablePackageInitialize-Initialize>b__1>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.<JoinAsync>d__68.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at Microsoft.VisualStudio.Services.VsTask.RethrowException(AggregateException e)at Microsoft.VisualStudio.Services.VsTask.InternalGetResult(Boolean ignoreUIThreadCheck)at Microsoft.VisualStudio.Services.VsTask.GetResult()
I've attached a screenshot of the error message, info about my visual studio version, and ActivityLog.xml (zipped, because of file type limitations)