Open Thallerich opened 2 years ago
@Thallerich Thank you for reporting this. Which version of OneNote do you have installed? The version that comes with MS Office or only the one that comes with Windows 10?
[2022-07-14 07:29:37.4493] [ERROR] [C:\a\_work\1\s\src\modules\launcher\Wox.Plugin\PluginPair.cs::200]
-------------------------- Begin exception --------------------------
Message: Fail to Init plugin: OneNote
Exception full name : System.InvalidCastException
Exception message : Unable to cast COM object of type 'Microsoft.Office.Interop.OneNote.ApplicationClass' to interface type 'Microsoft.Office.Interop.OneNote.IApplication'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{452AC71A-B655-4967-A208-A4CC39DD7949}' failed due to the following error: Interface not registered (0x80040155).
Exception stack trace:
at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, IntPtr& ppTarget, Boolean& pfNeedsRelease)
at Microsoft.Office.Interop.OneNote.ApplicationClass.GetHierarchy(String bstrStartNodeID, HierarchyScope hsScope, String& pbstrHierarchyXmlOut, XMLSchema xsSchema)
at ScipBe.Common.Office.OneNote.OneNoteProvider.<>c.<get_PageItems>b__3_0(Application oneNote)
at ScipBe.Common.Office.OneNote.OneNoteProvider.CallOneNoteSafely[T](Func`2 action)
at ScipBe.Common.Office.OneNote.OneNoteProvider.get_PageItems()
at Microsoft.PowerToys.Run.Plugin.OneNote.Main.Init(PluginInitContext context)
at Wox.Plugin.PluginPair.InitPlugin(IPublicAPI api)
Exception source : System.Private.CoreLib
Exception target site: IntPtr GetCOMIPFromRCW(System.Object, IntPtr, IntPtr ByRef, Boolean ByRef)
Exception HResult : -2147467262
-------------------------- End exception --------------------------
The one coming with office, install is "Microsoft 365 apps for enterprise", monthly enterprise channel version 2205 (Build 15225.20356)
@palenshus Incompatible OneNote version or bug in plugin code? If it's a compatibility thing we should show an error message instead of crashing.
I had this same problem in build 2209 of the Microsoft 365 version, and fixed it by doing a Quick Repair of that from Windows Settings.
[2022-07-14 07:29:37.4493] [ERROR] [C:\a\_work\1\s\src\modules\launcher\Wox.Plugin\PluginPair.cs::200] -------------------------- Begin exception -------------------------- Message: Fail to Init plugin: OneNote Exception full name : System.InvalidCastException Exception message : Unable to cast COM object of type 'Microsoft.Office.Interop.OneNote.ApplicationClass' to interface type 'Microsoft.Office.Interop.OneNote.IApplication'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{452AC71A-B655-4967-A208-A4CC39DD7949}' failed due to the following error: Interface not registered (0x80040155). Exception stack trace: at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, IntPtr& ppTarget, Boolean& pfNeedsRelease) at Microsoft.Office.Interop.OneNote.ApplicationClass.GetHierarchy(String bstrStartNodeID, HierarchyScope hsScope, String& pbstrHierarchyXmlOut, XMLSchema xsSchema) at ScipBe.Common.Office.OneNote.OneNoteProvider.<>c.<get_PageItems>b__3_0(Application oneNote) at ScipBe.Common.Office.OneNote.OneNoteProvider.CallOneNoteSafely[T](Func`2 action) at ScipBe.Common.Office.OneNote.OneNoteProvider.get_PageItems() at Microsoft.PowerToys.Run.Plugin.OneNote.Main.Init(PluginInitContext context) at Wox.Plugin.PluginPair.InitPlugin(IPublicAPI api) Exception source : System.Private.CoreLib Exception target site: IntPtr GetCOMIPFromRCW(System.Object, IntPtr, IntPtr ByRef, Boolean ByRef) Exception HResult : -2147467262 -------------------------- End exception --------------------------
Any word @Thallerich if that solves your issue too? @htcfreek, in cases where you don't have OneNote or the wrong version of it, it shouldn't crash, this one is something different. We could add an addition catch for InvalidCastException, but that would render the plugin unusable w/o providing any indication that something is wrong, it's probably good that it crashed so we're alerted to it
Nope sorry, still have the problem. Neither a repair nor a complete reinstall helped. I am now on an insider build, still getting the error.
It's probably a weird configuration on my machine. I guess we can close this and i'll just live without the plugin. :)
@Thallerich What I see is that you have Microsoft 365 OneNote (OneClick-Installer). Not sure if this is supported by the plugin.
Mine is also the Microsoft 365 edition, though a normal build. So the issue shouldn't have anything to do with that.
I also have the Windows App version installed, and I had feared that it was some interference between the two versions that was causing my problem, but the Quick Repair fixing the issue for me has disproved that.
I hope you can find a solution.
Under the covers, the plugin just uses the https://github.com/scipbe/ScipBe-Common-Office library for actual OneNote interop. Can you try out this LINQPad script and see if it returns any results?
Nope, also getting this error when running that script. Unable to cast COM object of type 'Microsoft.Office.Interop.OneNote.ApplicationClass' to interface type 'Microsoft.Office.Interop.OneNote.IApplication'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{452AC71A-B655-4967-A208-A4CC39DD7949}' failed due to the following error: Interface not registered (0x80040155).
It's most likely something with my office install or my pc configuration, since an office repair does not help.
is this still an issue in the latest update? /needinfo
Yes, i do still have this problem.
Microsoft PowerToys version
0.60.1
Running as admin
Area(s) with issue?
PowerToys Run
Steps to reproduce
OneNote Plugin is not loading. Immediately after turning on the OneNote Plugin the error message pops up:
Bug Report: PowerToysReport_2022-07-14-07-38-16.zip
✔️ Expected Behavior
No response
❌ Actual Behavior
No response
Other Software
No response