Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Total failure of plugin #1153

Closed
effree opened this issue Nov 3, 2023 · 10 comments · Fixed by #1246
Closed

Total failure of plugin #1153

effree opened this issue Nov 3, 2023 · 10 comments · Fixed by #1246
Assignees
Labels
bug Something isn't working install Installation-related issues released Available in a released installer
Milestone

Comments

@effree
Copy link

effree commented Nov 3, 2023

Problem to Solve

I was able to download and install the latest version. But as soon as i click on My Styles, or Table Styles (since I've turned on the error popups), it says:

"An exception occurred while calling function "GetStyleGalleryItemCount". The exception message is:

Unable to cast COM object to type 'Microsoft.Office.Interop.OneNote.ApplicationClass' to interface type 'Microsoft.Office.Interop.OneNote.IApplicationCOM'. 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: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY))."

After clicking okay, I can now see the menu next time i click on the dropdown, but nothing functions. Checking the logs, i have more of the same style errors.

To Reproduce

Steps to reproduce the behavior:

  1. Go to 'Any Dropdown Menu on the Ribbon'
  2. Click on 'Anything'
  3. Nothing happens

Expected Behavior

To be able to open the menu's without error. To be able to click on menu options and see other parts of the addon. I can't even click Settings or About OneMore, because nothing happens.

Environment (if applicable)

  • OneNote Version: O365, 64bit?]
  • OneMore Version: Latest

Additional Context

I have reviewed and seen some similar errors, but none were exactly the same. Either way I've done the following testing:

  1. Uninstalled OneMore multiple times and reinstalled
  2. Tried using the repair for OneMore
  3. Updated all of the latest Windows 10 updates, including all .NET Framework updates that were available to be through Windows Update.
  4. Uninstalled All Office Applications and my Standalone install of OneNote
  5. Reinstalled OneNote only and installed OneMore
  6. Uninstalled OneNote again, and reinstalled Office Suite
  7. I restarted between each step above.
  8. Installed OneMore again

Still getting the same error.

01| Starting dllhost 14832, 2195 Mhz, 9 MB, en-US/en-US, v5.9.0, OneNote 15.0, Office 16.0, 2023-11-01 13:08
01| ..C:\Program Files\Microsoft Office\root\Office16\ONENOTE.EXE (16.0.16924.20124)
01| ..OnConnection(ConnectionMode:ext_cm_Startup,custom[1:Int32])
01| ..OneAddInsUpdate(custom[])
01| ..building ribbon
01| ..building ribbon colorizer commands
01| ..OnStartupComplete(custom[])
01| ..starting command service
01| ..starting reminder service
01| ..starting navigation service
01| ..ready
06| error invoking action
06| System.InvalidCastException
Message: Unable to cast COM object of type 'Microsoft.Office.Interop.OneNote.ApplicationClass' to interface type 'Microsoft.Office.Interop.OneNote.IApplicationCOM'. 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: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).
Source: mscorlib
StackTrace: at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, IntPtr& ppTarget, Boolean& pfNeedsRelease)
at Microsoft.Office.Interop.OneNote.ApplicationClassCOM.FindMeta(String bstrStartNodeID, String bstrSearchStringName, String& pbstrHierarchyXmlOut, Boolean fIncludeUnindexedPages, XMLSchema xsSchema)
at River.OneMoreAddIn.OneNote.<>c__DisplayClass72_0.b__0()
at River.OneMoreAddIn.OneNote.d__35.MoveNext()
TargetSite: [mscorlib] System.StubHelpers.StubHelpers::GetCOMIPFromRCW()

07| navigation service exception 0
07| System.InvalidCastException
Message: Unable to cast COM object of type 'Microsoft.Office.Interop.OneNote.ApplicationClass' to interface type 'Microsoft.Office.Interop.OneNote.IApplicationCOM'. 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: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).
Source: mscorlib
StackTrace: at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, IntPtr& ppTarget, Boolean& pfNeedsRelease)
at Microsoft.Office.Interop.OneNote.ApplicationClassCOM.get_Windows()
at River.OneMoreAddIn.OneNote.get_CurrentPageId()
at River.OneMoreAddIn.Commands.NavigationService.d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at River.OneMoreAddIn.Commands.NavigationService.<b__11_0>d.MoveNext()
TargetSite: [mscorlib] System.StubHelpers.StubHelpers::GetCOMIPFromRCW()

09| navigation service exception 1
09| System.InvalidCastException
Message: Unable to cast COM object of type 'Microsoft.Office.Interop.OneNote.ApplicationClass' to interface type 'Microsoft.Office.Interop.OneNote.IApplicationCOM'. 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: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).
Source: mscorlib
StackTrace: at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, IntPtr& ppTarget, Boolean& pfNeedsRelease)
at Microsoft.Office.Interop.OneNote.ApplicationClassCOM.get_Windows()
at River.OneMoreAddIn.OneNote.get_CurrentPageId()
at River.OneMoreAddIn.Commands.NavigationService.d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at River.OneMoreAddIn.Commands.NavigationService.<b__11_0>d.MoveNext()
TargetSite: [mscorlib] System.StubHelpers.StubHelpers::GetCOMIPFromRCW()

THE FINE PRINT This is a hobby project that I started for myself. I'm happy to take requests and will promise to
consider each one carefully but offer no guarantees that I will ultimately agree to their
usefulness or have time to implement any of them. If OneNote offers a "close enough" work-around
then I will probably reject the request - you've been warned!

@effree effree added bug Something isn't working unread I have seen it or had time to refine it yet labels Nov 3, 2023
@stevencohn
Copy link
Owner

stevencohn commented Nov 3, 2023

Rename this file %APPDATA%\OneMore\Themes\Default.xml to Default-hide.xml and restart OneNote
If that works, please send me that file, attach it here or share online.

If it doesn't work, trying renaming %APPDATA%\OneMore\Settings.xml to Settings-hide.xml and restart OneNote
If that works, please send me that file.

@stevencohn stevencohn removed the unread I have seen it or had time to refine it yet label Nov 3, 2023
@effree
Copy link
Author

effree commented Nov 3, 2023

I don't see either file in that directory.
MicrosoftTeams-image

@effree
Copy link
Author

effree commented Nov 6, 2023

I tried installing a newer .NET Framework so i went with 4.8.1. Restarted, Repaired Office Again, Removed and Reinstalled OneMore and still have the same above issues. It appears to not create the files that you expected it to create. I think it could be an issue with mscorelib. I checked my c:\Windows\Assembly folder, and i have legacy versions of that file/dll but i don't think i have ones that are being harnessed. No amount of google is helping me find a way to replace the file if it is missing. I'm also not sure if it should be in the program files/river directory with all the other .dll files.

@effree
Copy link
Author

effree commented Nov 14, 2023

Additional Research:
I can't seem to find {452AC71A-B655-4967-A208-A4CC39DD7949} in the registry in the location I expected to see it. I'm wondering if the wrong CLSID if being grabbed, due to old versions being installed at some point or something.

Also, like I mentioned before, there is no mention of mscorlib.dll on my system anywhere, so it could just be that this is missing, but after looking all over the internet, I can't find anyone with a similar issue.

  1. Is there a place I should be finding this dll on my system, so I can check the specific location?
  2. Do you have a list of all registry key entries you try to create when installing, so I can hunt them down and see if they were created properly?
  3. Do you know where I should specifically be finding this CLSID from my error logs on the registry? If it is not there, what should it have under it and I can manually attempt to create this.

@stevencohn
Copy link
Owner

stevencohn commented Nov 14, 2023

It should be here HKEY_CLASSES_ROOT\Interface\{452AC71A-B655-4967-A208-A4CC39DD7949}
and possibly here HKEY_CLASSES_ROOT\WOW6432Node\Interface\{452AC71A-B655-4967-A208-A4CC39DD7949}
same for HKEY_LOCAL_MACHINE\Software\Classes... and a couple of other spots.

I believe it's the CLSID of the OneNote IApplication interface, which tells me that your OneNote and/or Office installation needs to be repaired (I know you mentioned you tried that though!).

OneMore is built using .NET Framework 4.8. You've installed 4.8.1 which should be backwards compatible with OneMore. The mscorlib.dll should be in a few spots including something like C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll and C:\Windows\Microsoft.NET\Framework\v4.0.30319\NativeImages\mscorlib.dll as well as in the GAC

@effree
Copy link
Author

effree commented Nov 15, 2023

Thanks for looking into everything with me. I'm kind of at a point of exhausting all my knowledge. I ran the repair again, offline and online, both for Office and OneNote, and still cannot get it to work.
I ran ProcMon filtering by the PID of the plugin. It called msocorlib.ni.dll from C:\Windows\assembly\NativeImages_v4.0.30319_64\mscorlib\316b66ba76e2cd70541b5fe8161637c9 and didn't seem to cause any noticeable flags in there. I scrolled through everything in there with no major issues.
I checked the Windows Event Manager and saw the same message that you output to the log file, but nothing else.
I also tried to run regsvr32 on the dll in 3 separate locations, all of which didn't work.
At this point I think it might be related to something that my company is doing on their permissions or registry or something like that.

@effree
Copy link
Author

effree commented Jan 2, 2024

I found a fix for my issue. In case anyone else has this problem in the future.

  1. I ran ProcMon from SysInternals.
  2. I filtered to only view the PID of the running OneNote.
  3. Then started capturing and tried clicking on the OneMore Addin in the ribbon. Then it started registering information in ProcMon.
  4. I then stopped capturing and worked through the very first part of the dllhost.exe information. I noticed I was getting PATH NOT FOUND for the OneNote application location.
  5. I went into the RegEdit at the location it was checking which was HKCR\TypeLib\{0EA692EE-BB50-4E3C-AEF0-356D91732725}\1.1\0\win64
  6. This was pointing to a folder where there was no OneNote.exe. It was looking at C:\Program Files\Microsoft Office\Office16\ONENOTE.EXE\3 instead of C:\Program Files\Microsoft Office\root\Office16\ONENOTE.EXE\3. (missing the root folder)
  7. I made this change to the registry entry and the add-in began working immediately.

@effree effree closed this as completed Jan 2, 2024
@stevencohn
Copy link
Owner

That's really interesting. I wonder if running the Office installer in repair mode would have caught that.
I could look into adding a check to the installer to verifiy OneNote registry settings and warn when they look strange.
Thanks for the info.

@effree
Copy link
Author

effree commented Jan 2, 2024

No problem, and also just so you know, I did run the repair a few times and it never picked that up or fixed it. Not sure why, but I am also on a domain network. The install we use for 365 products is managed by a part of the IT team, and it could be related to how that installer is being used. The installer is for Microsoft 365 Apps for enterprise - en-us and OneNote was installed separately. Both repairs failed to work multiple times as well as full uninstall and reinstall. The only fix was to manually edit that location.

Glad to have it fixed, thanks for everything, can't wait to finally use this thing.

@stevencohn stevencohn linked a pull request Jan 6, 2024 that will close this issue
@stevencohn stevencohn added the next-release Addressed but not yet released label Jan 6, 2024
@stevencohn stevencohn self-assigned this Jan 6, 2024
@stevencohn stevencohn reopened this Jan 6, 2024
@stevencohn
Copy link
Owner

Added pre-install verification of OneNote configuration. If any suspect settings are detected, a warning dialog is shown prior to installation.

@stevencohn stevencohn added the install Installation-related issues label Jan 15, 2024
@stevencohn stevencohn added released Available in a released installer and removed next-release Addressed but not yet released labels Jan 21, 2024
weissm pushed a commit to weissm/OneMore that referenced this issue Jan 22, 2024
@stevencohn stevencohn added this to the 6.2.1 milestone Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working install Installation-related issues released Available in a released installer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants