如何远程调试 vsto Outlook 插件?

发布于 2024-10-12 18:55:16 字数 667 浏览 3 评论 0原文

我已经构建了一个 Outlook 插件,我想远程调试它在我的开发机器上的虚拟机内运行(虚拟机是 xpsp3 x32 和 Outlook 2010,我的开发机器是 7 x64 和 Outlook 2007)

我有(经过相当长的一段时间后 )有点搞乱用户帐户等)在 vs2010 和虚拟机虚拟机之间进行远程调试。我可以附加到一个简单的测试应用程序并设置断点,然后它们就会被击中。

但是,我似乎无法对 Outlook 插件执行相同的操作。我不能只附加到计算机上运行的 Outlook.exe 进程,因为它似乎不会加载加载项模块,因此断点永远不会被命中。

我不知道如何让 VS2010 从本地构建的项目在远程计算机上启动 Outlook,我尝试按照 这些 msdn 文档,但设置工作目录的说明似乎不起作用,所以如果我按照示例建议设置它并开始调试它出现一条消息,指出该文件夹不存在。

相反,如果我将 Outlook 插件项目的调试属性中的“启动操作”设置为“启动外部程序”并将其指向 Outlook exe,那么 VS2010 将成功启动该应用程序,但是,断点不会被命中,即使看起来如此表明它们已成功设置。

有人成功远程调试 vsto 插件吗?我做错了什么?

I have built an outlook addin, and I'd like to remote debug it running inside a vm on my dev machine (the vm is xpsp3 x32 and outlook 2010, my dev machine is 7 x64 with outlook 2007)

I have (after quite a bit of messing about with user accounts etc) got remote debugging working between vs2010 and the virtual box vm. I can attach to a simple test application and set breakpoints, and they get hit.

However, I can't seem to do the same with the outlook addin. I can't just attach to the outlook.exe process running on the machine as that does not seem to load the addin modules so the breakpoints never get hit.

I can't figure out how to get VS2010 to start outlook on the remote machine from a locally built project, I tried to follow these msdn docs but the instructions to set the working directory don't seem to work, so if I set it as the example suggests and start debugging it comes up with a message saying that the folder does not exist.

If instead I set the Start Action in the debug properties for the outlook addin project to 'Start External Program' and point it at the outlook exe, then VS2010 will successfully start the app, however, the breakpoints are not hit, even though it seems to indicate that they have been successfully set.

Has anyone been successful in remote debugging vsto addins? What am I doing wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

っ左 2024-10-19 18:55:16

我知道这是一个相当老的问题,但以防万一有人遇到这篇文章,这里有一个解决方案:

  1. 在主机上的 VSTO 项目中,将其添加到启动方法的顶部。

    MessageBox.Show("调试"); 
    
  2. 将外接程序部署到远程计算机,打开 Outlook,并且 MessageBox 应显示

  3. 在远程计算机上运行 Visual Studio 远程调试监视器
  4. 在主机上,在 MessageBox 后面的行上设置断点
  5. 在 Visual Studio 中,从菜单中选择“调试/附加到进程”,然后附加到在远程计算机上运行的 Outlook 进程
  6. 在远程计算机上,单击“确定”按钮您在步骤 1 中添加的 MessageBox
  7. 您在步骤 5 中设置的断点现在将被命中

I know this is quite an old question, but just in case someone comes across this post, here is a solution:

  1. On the host machine, in the VSTO project, add this at the top of the startup method.

    MessageBox.Show("Debug"); 
    
  2. Deploy the add in to the remote machine, open Outlook and the MessageBox should display

  3. Run the Visual Studio Remote Debugging Monitor on the remote machine
  4. On the host machine, set a breakpoint on the line after the MessageBox
  5. In Visual Studio, select Debug/Attach to Process from the menu and attach to the Outlook process running on the remote machine
  6. On the remote machine, click on the OK button on the MessageBox you added in step 1
  7. The breakpoint you set in step 5 will now be hit
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文