本文介绍了OneNote 2013加载项将无法加载。如何调试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照Malte Ahrens的和,都没有得到回应。第一个人已经加载一次,但后来不得不手动启动它每次,我从来没有加载(我还没有签署我的程序集)第二个家伙从来没有得到回应。



正如我所说,即使知道如何进一步调试这一步,也是一个很大的进步。



编辑:



我回到调试我自己的版本,这几乎是相同的,因为我不知道安装程序实际上是做什么,我认为,因为它是一个演示的wix转换器,它只允许我建立



如果我在启动外部程序下添加OneNote.exe并在加载项上运行debug,我会看到以下行出现,当我尝试,加载项在OneNote中的管理COM加载项下。恐怕我还是很绿的,所以我不知道这是什么意思。

 第一次在ONENOTE.EXE中的0x00007ffe4f86ab78异常:0x800401FD:对象未连接到服务器。 
ONENOTE.EXE中0x00007ffe4f86ab78处的第一次异常:0x800401FD:对象未连接到服务器。
ONENOTE.EXE中0x00007ffe4f86ab78处的第一次异常:0x800401FD:对象未连接到服务器。

另外,因为阅读更多,我想我只是把我的dll复制到安装文件夹程序文件\ [manufacturer] \ [application] (因为我没有安装程序)是不够的。我现在执行这对我的dll

  PS C:\WINDOWS\Microsoft.NET\Framework64\v4 .0.30319> .\RegAsm.exe 

并返回

  Microsoft .NET Framework程序集注册实用程序4.0.30319.33440 
Microsoft .NET Framework版本4.0.30319.33440
版权所有(C)Microsoft Corporation。版权所有。

类型已成功注册

dll正确?

解决方案

启用OneNote 2013的日志记录:



创建文件EnableOneNote2013APILogging.reg

  Windows注册表编辑器版本5.00 

[HKEY_CURRENT_USER \ Software \Microsoft\Office\15.0\OneNote\Options\Logging]

EnableLogging= dword:00000001

EnableTextFileLogging= dword:0000001

ttidLogObjectModel= dword:00000001

ttidLogObjectModelAddins= dword:00000001

创建一个文件DisableOneNote2013APILogging.reg

  Windows注册表编辑器版本5.00 

[HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\OneNote\Options\Logging]

EnableLogging= dword:00000000

EnableTextFileLogging= dword:0000000

ttidLogObjectModel= dword:00000000

ttidLogObjectModelAddins= dword:00000000
pre>

这是基于,但您需要添加EnableTextFileLogging; - )。



日志文件创建于%temp%\OneNote.log



对于OneNote 2010,将.reg文件中的路径更改为\14.0 \而不是\15.0 \


I'm following the excellent tutorial by Malte Ahrens on how to create a OneNote add-in.

Initially I followed it step by step, making a few changes (just renaming the class, and using my own name and GUID in the assembly) info. As I'm using VS2012 and am not yet ready to hand-roll a WiX installer I manually copied over the built dll to the correct place and also created a registry file to make the requisite entries. I confirmed that they were all there, loaded up OneNote but no add-in, going to "mange COM addins" section I saw the following error:

Load Behavior: Not loaded. A runtime error occurred during the loading of the COM Add-in.

I spent some time debugging this but didn't get very far. So this afternoon I decided to start again but copy his code verbatim. I simply downloaded the example project, used the trial of Vdproj to Wix to create the installer and built everything.

I get the exact same error.

Why is this please? What does this mean and most importantly how do I debug the problem?

A few specifics about my environment and where it may differ from the original tutorial.

I am running Office 2013 AND it's 64bit. His tutorial is for 2010. This means when I loaded up the demo solution I had to remove the non-existent reference to the Onenote 14 Interop and add the v15 version.

In terms of registry entries they go to the right place, not the WOW6432 registry nodes. I doubly know this as if I load up OneNote and then refresh the HKCR registry node for the add-in, the LoadBehavior switches to 0x00000002, (disabled).

Other things that may be worth noting.

I have enabled OneNote logging and it's quiet on my issue.

There are 2 other posts on here with a seemingly similar problem (but Office 2010) here and here, neither got a response. The first guy had it loading once, but then had to manualy start it each time, mine never loads (and I've not signed my assembly) the second guy never got a response.

As I say, even knowing how to debug this further would be a great step forwards.

Edit:

I've gone back to debugging my own version, which is almost identical anyway as I'm not sure what the installer is actually doing and I think because it's a demo of the wix converter it's only allowing me to build for x86.

If I add OneNote.exe under "start external program" and run debug on my add-in, I see the following lines appear when I try and tick the add-in under "manage COM add-ins" within OneNote. I'm afraid I'm still pretty green at all this so I'm not sure what it means.

First-chance exception at 0x00007ffe4f86ab78 in ONENOTE.EXE: 0x800401FD: Object is not connected to server.
First-chance exception at 0x00007ffe4f86ab78 in ONENOTE.EXE: 0x800401FD: Object is not connected to server.
First-chance exception at 0x00007ffe4f86ab78 in ONENOTE.EXE: 0x800401FD: Object is not connected to server.

Also, since reading up more I think me simply copying my dll into the install folder program files\[manufacturer]\[application] (as I don't have an installer) was not enough. I've now executed this against my dll

PS C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319> .\RegAsm.exe 

and it came back with

Microsoft .NET Framework Assembly Registration Utility version 4.0.30319.33440
for Microsoft .NET Framework version 4.0.30319.33440
Copyright (C) Microsoft Corporation.  All rights reserved.

Types registered successfully

Is there anything else I should be doing to register the dll correctly?

解决方案

Enable logging for OneNote 2013:

Create a file "EnableOneNote2013APILogging.reg"

Windows Registry Editor Version 5.00  

[HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\OneNote\Options\Logging] 

"EnableLogging"=dword:00000001 

"EnableTextFileLogging"=dword:0000001

"ttidLogObjectModel"=dword:00000001 

"ttidLogObjectModelAddins"=dword:00000001

Create a file "DisableOneNote2013APILogging.reg"

Windows Registry Editor Version 5.00  

[HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\OneNote\Options\Logging] 

"EnableLogging"=dword:00000000 

"EnableTextFileLogging"=dword:0000000

"ttidLogObjectModel"=dword:00000000 

"ttidLogObjectModelAddins"=dword:00000000 

This is based on http://blogs.msdn.com/b/descapa/archive/2006/12/08/debugging-the-onenote-api-enable-logging.aspx but you need to add EnableTextFileLogging ;-).

The logfile is created in %temp%\OneNote.log

For OneNote 2010 change the path in the .reg files to \14.0\ instead of \15.0\

这篇关于OneNote 2013加载项将无法加载。如何调试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-25 13:22