从COM加载项窗口中选择[删除]后,无法重新注册VSTO加载项 [英] Unable to re-register VSTO Add-in after choosing [Remove] from COM Add-ins window

查看:396
本文介绍了从COM加载项窗口中选择[删除]后,无法重新注册VSTO加载项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为Word女士开发VSTO加载项. VS 2017中的Run-> Start(F5)运行正常.

I am developing a VSTO add-in for Ms Word. Run -> Start (F5) in VS 2017 worked fine.

今天,我通过发布外接程序(ClickOnce,生成一个.vsto文件)并将其设置在用于开发/调试的同一台计算机上进行了首次测试.为了在Word中进行设置,我双击了.vsto文件,并显示一条绿色的确认消息,指示成功安装了自定义项.

Today I ran my first tests by publishing the add-in (ClickOnce, generating a .vsto file) and setting it up on the same computer I use for developing/debugging. In order to set it up in Word I just double-clicked the .vsto file and get a green-tick confirmation message indicating the customization was successfully installed.

我可以使用发行版没问题.

I could use the release version no problem.

然后,我想回到开发/调试外接程序的位置,但是不会触发断点(实际上VS表示它永远不会中断,因为没有注册任何标志,但是我不再收到此消息了) .我认为该应用程序的发行版仍处于启用状态,也许这是阻止调试版本而非发行版运行的原因. 我进入"COM加载项"窗口,取消选中该加载项,将其选中,然后单击[删除]按钮,然后关闭Word.

Then I wanted to go back to developing/debugging the add-in, but breakpoints would not trigger (in fact at some point VS indicated it would never break because no flags were registered, but I do not get this message anymore). I figured the release version of the app was still enabled and maybe this was what prevented the debug version to run instead of the release version. I went into the "COM Add-ins" window, unticked the add-in, selected it and clicked the [Remove] button, and closed Word.

自那时以来,Word的"COM加载项"窗口中没有任何加载项出现. 我尝试了以下方法:

Since then, no add-in appears in the "COM Add-ins" window of Ms Word. I tried the following:

  • 我确实从添加/删除程序(Windows 10)卸载了加载项
  • 我确实删除了"Computer \ HKEY_CURRENT_USER \ Software \ Microsoft \ Office \ Word \ Addins"中的整个注册表文件夹
  • 我也确实尝试过更改注册表中的清单"字段,以反映Debug或Release版本的路径.
  • 我在Word(Office 365)的文件/选项/加载项"菜单中签入了禁用项"和慢速和禁用加载项"列表, 那里什么都没有.
  • 我确实进行了项目/解决方案的清理/重建.
  • 我尝试了至少使发行版工作的方法,但是通过已发布的.vsto文件重新安装无法正常工作 要么.
  • 不通过"COM加载项"窗口的[添加...]按钮将加载项的发布或调试版本(与.vsto文件一起生成的.exe文件)直接添加到Ms Word中不会有任何效果:尽管我从MS Office自定义安装程序收到了成功确认消息,但没有在同一窗口中将任何新条目添加到列表,并且条目的文件夹已添加到注册表中的"Computer \ HKEY_CURRENT_USER \ Software \ Microsoft \ Office \ Word \ Addins".
  • 修复/重置-无法运行Word应用程序(通过添加或删除程序")
  • 卸载Word应用程序,然后从Microsoft Store重新安装它也不起作用
  • I did uninstall the add-in from add/remove programs (Windows 10)
  • I did hard-delete the entire registry folder in "Computer\HKEY_CURRENT_USER\Software\Microsoft\Office\Word\Addins"
  • I did also try changing the "Manifest" field in the registry to reflect the path to the Debug or also to the Release versions.
  • I checked in the "Disabled Items" and "Slow and Disabled Add-ins" listings of the File/Options/Add-ins menu in Ms Word (Office 365), there is nothing in there.
  • I did run a Clean/Rebuild of the Project/Solution.
  • I tried as a last resort to at least get the release version work, but yet re-installing via the published .vsto file does not work either.
  • Adding the release or debug version (.exe file generated along with the .vsto file) of the add-in via the [Add...] button of the "COM Add-ins" window directly into Ms Word does not have any effect either: no new entry is added to the list in that same window, although I get a success confirmation message from the MS Office Customization Installer, and a folder of entries is added to the registry at "Computer\HKEY_CURRENT_USER\Software\Microsoft\Office\Word\Addins".
  • Repair/Reset -ing the Word App does not work (from "Add or remove programs")
  • Uninstalling the Word App and then re-installing it from the Microsoft Store does not work either

有帮助吗? :D

我能够多次重复该行为:

I was able to repeat the behaviour several times:

  1. 创建一个新的"Word 2013和2016 VSTO加载项"项目
  2. 开始调试(F5),MS Word启动
  3. 在Word女士中:文件/选项/加载项->在下拉列表中选择"COM加载项",然后单击[定位..]按钮以显示"COM加载项"窗口
  4. 选择加载项,然后单击[删除]按钮
  5. 停止调试,这将关闭Word女士
  6. 开始调试(F5),Word女士启动
  7. 该加载项尚未加载,并且未出现在"COM加载项"窗口中

但是,Regedit显示了该加载项的预期条目.

Yet, Regedit shows the expected entries for the Add-in.

推荐答案

到目前为止,我所能做的最好的就是更改程序集名称. 这样,Word女士就可以将解决方案视为另一个加载项,并且可以正确注册. 它可以工作,但这远远不能接受..

So far the best I could do was to change the Assembly Name. This allows the solution to be seen as a different Add-in by Ms Word and to be registered correctly. It works, but this is far from being acceptable..

现在可以使用完全签名的发行版并进行大量测试:这仅是Windows 10的问题,其中ClickOnce与首次安装后所安装的VSTO是分离"的:通过卸载您的ClickOnce应用程序应用程序和设置面板,并且VSTO尚未从Word中注销;或手动注销VSTO,ClickOnce无法将其重新注册到Word中.

Now working with fully signed releases, and following substantial testing: this is an issue with Windows 10 only, where ClickOnce is "cut loose" from the VSTO it installed after it being installed for the first time: uninstall your ClickOnce app via the App & Settings panel, and the VSTO is not unregistered from Word; or unregister the VSTO manually, and ClickOnce is unable to re-register it into Word.

可以在Windows 7下毫无问题地执行上述步骤.

The above steps can be undertaken under Windows 7 with no problems.

看起来与Office的安装版本有关:即点即用与Microsoft Store. Windows 7并未解决此问题,因为Microsoft Store安装不可用.

Looks like this was related to the installation version of Office: Click-to-Run vs Microsoft Store. The issue did not come up with Windows 7 because Microsoft Store installations are not available.

此处的完整回复: https://stackoverflow.com/a/58625402/10794555

这篇关于从COM加载项窗口中选择[删除]后,无法重新注册VSTO加载项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆