Giter VIP home page Giter VIP logo

Comments (18)

lkytal avatar lkytal commented on August 20, 2024 2

Finally, I believe that v3.1.4 solved this problem.

from smoothscroll.

lkytal avatar lkytal commented on August 20, 2024 1

Restored backward support to VS2017, please update to v3.1.0

from smoothscroll.

MagicAndre1981 avatar MagicAndre1981 commented on August 20, 2024 1

3.1.0 can't be installed, because Microsoft.VisualStudio.MPF.12.0 is missing:

image

from smoothscroll.

MagicAndre1981 avatar MagicAndre1981 commented on August 20, 2024 1

@VaheHovh

the extension itself works, I see the different scrolling, but option page loading fails.

from smoothscroll.

Ghost4Man avatar Ghost4Man commented on August 20, 2024

I have the same problem (probably after an automatic update), here's the error message with Fusion log enabled.

from smoothscroll.

lkytal avatar lkytal commented on August 20, 2024

3.1.0 can't be installed, because Microsoft.VisualStudio.MPF.12.0 is missing:

image

What's your VS version?

from smoothscroll.

MagicAndre1981 avatar MagicAndre1981 commented on August 20, 2024

I use VS2017 15.9.11

according to Microsoft this entry is obsolete for a while:

If you have a dependency on Microsoft.VisualStudio.MPF then delete it. This dependency is a legacy one that hasn’t been needed since before Visual Studio 2010.

from smoothscroll.

lkytal avatar lkytal commented on August 20, 2024

I use VS2017 15.9.11

according to Microsoft this entry is obsolete for a while:

If you have a dependency on Microsoft.VisualStudio.MPF then delete it. This dependency is a legacy one that hasn’t been needed since before Visual Studio 2010.

I've just uploaded version v3.1.1, please take a try.

from smoothscroll.

chviladislav avatar chviladislav commented on August 20, 2024

I have the same issues, so I tried the 3.1.1. I'm able to install it now, but after run I got this message (copied from C:\Users\xxxx\AppData\Roaming\Microsoft\VisualStudio\15.0_dec70ffa\ActivityLog.xml):

SetSite failed for package [SmoothScrollPackage]Source: 'Microsoft.VisualStudio.Shell.15.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.Shell.Package.PackageContainer.GetService(Type serviceType) at System.ComponentModel.Container.Site.GetService(Type service) at System.ComponentModel.Component.GetService(Type service) at Microsoft.VisualStudio.Shell.DialogPage.get_SettingsManager() at Microsoft.VisualStudio.Shell.DialogPage.LoadSettingsFromStorage() at Microsoft.VisualStudio.Shell.DialogPage.set_Site(ISite value) at System.ComponentModel.Container.Add(IComponent component, String name) at System.ComponentModel.Container.Add(IComponent component) at Microsoft.VisualStudio.Shell.Package.GetDialogPage(Type dialogPageType) at SmoothScroll.SmoothScrollPackage.<InitializeAsync>d__2.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.Shell.AsyncPackage.<>c__DisplayClass17_0.<<Microsoft-VisualStudio-Shell-Interop-IAsyncLoadablePackageInitialize-Initialize>b__1>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.VisualStudio.Services.VsTask.RethrowException(AggregateException e) at Microsoft.VisualStudio.Services.VsTask.InternalGetResult(Boolean ignoreUIThreadCheck) at Microsoft.VisualStudio.Services.VsTask.GetResult()

from smoothscroll.

lkytal avatar lkytal commented on August 20, 2024

I noticed this risk but it does not happen at VS2019. I've uploaded v3.1.2 with a potential workaround.

from smoothscroll.

MagicAndre1981 avatar MagicAndre1981 commented on August 20, 2024

3.1.2 can be installed in 2017, but still causes the error from @chviladislav

SetSite failed for package [SmoothScrollPackage]Source: 'Microsoft.VisualStudio.Shell.15.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.

from smoothscroll.

lkytal avatar lkytal commented on August 20, 2024

Well, let's try v3.1.3...

from smoothscroll.

MagicAndre1981 avatar MagicAndre1981 commented on August 20, 2024

nope, still error:

image

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.

from smoothscroll.

MagicAndre1981 avatar MagicAndre1981 commented on August 20, 2024

have you tried to call await this.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); before init of SettingsPage?

from smoothscroll.

MagicAndre1981 avatar MagicAndre1981 commented on August 20, 2024

ok, you added it. I saw it in Decompiler.

if nothing helps, create 2 extension in 2 different branches.

SmoothScroll, based on AsyncPackage for VS >=2019
SmoothScrollLegacy based on commit before change to async to support older VS versions up to 2017.

from smoothscroll.

MagicAndre1981 avatar MagicAndre1981 commented on August 20, 2024

I searched a bit in the extension of Mads Kristensen and he only calls OptionsPage = base.GetDialogPage(typeof(OptionsPage)) as OptionsPage; like you did before the async migration. So do this again.

https://github.com/madskristensen/JavaScriptPrettier/blob/master/src/PrettierPackage.cs#L35
https://github.com/madskristensen/WebAccessibilityChecker/blob/master/src/VSPackage.cs#L45

from smoothscroll.

VaheHovh avatar VaheHovh commented on August 20, 2024

v3.1.3 doesn't work with VS 2017.

SetSite failed for package [SmoothScrollPackage]Source: 'Microsoft.VisualStudio.Shell.15.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.Shell.Package.PackageContainer.GetService(Type serviceType) at System.ComponentModel.Container.Site.GetService(Type service) at System.ComponentModel.Component.GetService(Type service) at Microsoft.VisualStudio.Shell.DialogPage.get_SettingsManager() at Microsoft.VisualStudio.Shell.DialogPage.LoadSettingsFromStorage() at Microsoft.VisualStudio.Shell.DialogPage.set_Site(ISite value) at System.ComponentModel.Container.Add(IComponent component, String name) at System.ComponentModel.Container.Add(IComponent component) at Microsoft.VisualStudio.Shell.Package.GetDialogPage(Type dialogPageType) at SmoothScroll.SmoothScrollPackage.<InitializeAsync>b__2_0() 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 SmoothScroll.SmoothScrollPackage.<InitializeAsync>d__2.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.Shell.AsyncPackage.<>c__DisplayClass17_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__78.MoveNext()

from smoothscroll.

MagicAndre1981 avatar MagicAndre1981 commented on August 20, 2024

yes, removing the Task stuff around option page call fixes it for me, extension loads and option page shows up:

image

from smoothscroll.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.