conan-io / conan-vs-extension

Conan Extension for Visual Studio
https://marketplace.visualstudio.com/items?itemName=conan-io.conan-vs-extension
MIT License
59 stars 34 forks source link

System.InvalidOperationException on build #195

Closed TomSmithGR closed 2 years ago

TomSmithGR commented 2 years ago

Hi,

I have just tried the plugin in visual studio, and I am having an error on building my project. Every build i get a System.InvalidOperationException, exception details are below. I am running VS2019, build 16.11.00.

Severity Code Description Project File Line Suppression State Error 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.Shell.Package.PackageContainer.GetService(Type serviceType) at System.ComponentModel.Container.get_Components() at Microsoft.VisualStudio.Shell.Package.GetDialogPage(Type dialogPageType) at Conan.VisualStudio.Services.VisualStudioSettingsService.GetConanPage() in C:\projects\conan-vs-extension\Conan.VisualStudio\Services\VisualStudioSettingService.cs:line 21 at Conan.VisualStudio.Services.VisualStudioSettingsService.GetConanInstallOnlyActiveConfiguration() in C:\projects\conan-vs-extension\Conan.VisualStudio\Services\VisualStudioSettingService.cs:line 36 at Conan.VisualStudio.Services.VcProjectService.ExtractConanProject(IVCProject vcProject, ISettingsService settingsService) in C:\projects\conan-vs-extension\Conan.VisualStudio\Services\VcProjectService.cs:line 99 at Conan.VisualStudio.Services.VcProjectService.<>c__DisplayClass8_0.b0() in C:\projects\conan-vs-extension\Conan.VisualStudio\Services\VcProjectService.cs:line 115 at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.Tasks.Task.Execute() --- 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 Conan.VisualStudio.Services.VcProjectService.d8.MoveNext() in C:\projects\conan-vs-extension\Conan.VisualStudio\Services\VcProjectService.cs:line 113 --- 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 Conan.VisualStudio.Services.ConanService.d7.MoveNext() in C:\projects\conan-vs-extension\Conan.VisualStudio\Services\ConanService.cs:line 92 --- 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 Conan.VisualStudio.Menu.AddConanDependsProject.d6.MoveNext() in C:\projects\conan-vs-extension\Conan.VisualStudio\Menu\AddConanDependsProject.cs:line 37 --- 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 Conan.VisualStudio.Menu.MenuCommandBase.d__6.MoveNext() in C:\projects\conan-vs-extension\Conan.VisualStudio\Menu\MenuCommandBase.cs:line 31 0

TomSmithGR commented 2 years ago

Actually I now cant reproduce this error, so closing ticket.