我是否可以避免在 VSTO 外接程序更改/测试周期中重新启动 Outlook?

发布于 2024-12-28 11:04:29 字数 520 浏览 4 评论 0原文

我们正在使用 VS2010 / VSTO 开发一个小型 Outlook 插件。

这对我们来说是一个新事物,所以我们想知道与我们更熟悉的 Winforms 相比,Outlook 插件中哪些是可能的,哪些是不可能的。因此,我们正在进行一些小的、零碎的更改,并通过在 Outlook 中运行来经常进行检查。

目前,我们的更改/测试周期是这样工作的:

  1. 在 Visual Studio IDE 中以某种小方式添加、更改、修复或扩展代码
  2. F5
  3. 叮! 警告 Outlook 已在运行。 失去生命
  4. 关闭 Outlook
  5. F5
  6. Outlook 启动,测试更改

重新启动 Outlook 使其如此缓慢。

有什么方法可以在不重新启动 Outlook 的情况下进行调试吗?或者,什么会更好,有什么方法可以调试并继续吗?

如果没有,我们能做些什么来让这个开发变得更流畅/更快吗?

We are developing a small Outlook plugin using VS2010 / VSTO.

It's a new thing for us so we're wondering what's possible and what's not possible in an Outlook plug-in versus our more familiar Winforms stuff. So we're making small piecemeal changes and checking frequently by running it in Outlook.

At the moment our change/test cycle works like this:

  1. In the Visual Studio IDE add, change, fix or extend the code in some small way
  2. F5
  3. Ding! Warning that Outlook is already running. Lose a life.
  4. Close Outlook
  5. F5
  6. Outlook starts, test the change

It's the restarting Outlook that makes it so slow.

Is there any way to debug without restarting Outlook? Or, what would be even better, is there any way to debug-and-continue?

If not, is there anything at all we can do to make this bit of dev a touch more fluent/faster?

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

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

发布评论

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

评论(2

温柔戏命师 2025-01-04 11:04:29

据我所知,您无法更改代码并继续调试。您需要重新加载 Outlook,以便它加载到新的 DLL 中。您始终可以编写自己的代码来监视特定的 DLL 并实时加载它,例如

Assembly assembly = Assembly.LoadFrom("dllPath");
AppDomain.CurrentDomain.Load(assembly.GetName());
Type t = assembly.GetType("typeName");

然后您可以处理您的 DLL,修改代码并在 Outlook 仍在运行的情况下重新加载该东西。可能比它的价值更麻烦。

Outlook 2007 在我的机器上启动得非常快(但我有一台功能强大的 i5 机器) - 实际上只需要 2 秒钟即可打开。如果您的 Outlook 启动速度确实很慢,请考虑执行以下操作:

  • 删除 Outlook 中安装的所有其他插件。
  • 您是否可以从当前邮箱中分离出来,只拥有一个离线邮箱?
  • 与所有其他邮箱分离
  • 在计算机上安装更多内存,以便缓存所有内容(便宜的选择,现在内存非常便宜)
  • 关闭计算机上的所有其他应用程序
  • 设置邮箱,使其几乎为空

Outlook 本身是否需要很长时间加载? (例如,最初的启动画面消失)或者它打开后是否嘎嘎作响?

As far as I'm aware you can't make code changes and continue debugging. You need to reload Outlook so that it loads in the new DLL. You could always write your own code that monitors a particular DLL and loads it in real-time, eg

Assembly assembly = Assembly.LoadFrom("dllPath");
AppDomain.CurrentDomain.Load(assembly.GetName());
Type t = assembly.GetType("typeName");

Then you can work on your DLL, modify the code and re-load the thing with outlook still running. Probably more hassle than it's worth though.

Outlook 2007 is very quick to start on my machine (but I've got a beefy i5 machine) - it literally takes 2 seconds to open. If your Outlook is really slow to startup, consider doing the following:

  • Remove all of the other addins that you've got installed in Outlook.
  • Is it possible that you can detach from your current mailbox and only have an offline one?
  • Detach from all of your other mailboxes
  • Install more memory on your machine so that everything is cached (cheap option, memory is very cheap these days)
  • Close down all other apps on your computer
  • Setup your mailbox so that it's practically empty

Is Outlook itself taking ages to load? (Eg for the initial splash screen to go away) Or is it chugging away after it's opened?

调妓 2025-01-04 11:04:29

据我所知,我们无法在 Outlook 已经运行时对其进行调试。因为除非您重新启动它,否则它无法加载我们的新 DLL。

正如 LachlanB 所说,我们可以使用 AppDomains 动态加载 DLL 并使其与 Outlook 一起使用。绝对可以,但我们正在控制将应用程序的 DLL 加载到 Outlook 进程中。这可能需要在设计和编码部分进行一些额外的工作。通常,这将是 Outlook 加载插件 DLL 的工作。

我的建议是,不要改变应用程序的设计和编码来启用调试。这不是最佳实践。相反,请关注为什么您的 Outlook 加载速度非常慢?

您可以尝试 LachlanB 关于配置 Outlook 以加快加载速度的第二个建议。使用这些步骤来清理您的前景。您还可以尝试在 MSDN 论坛中进行讨论 http://social.technet.microsoft.com/Forums/en-US/exchangesvrclients/thread/a117fa73-8f19-4716-9603-eb756b609cd5

As far i know, We can't debug outlook while it is already running. Because it can't load our new DLL's until and unless you restart it.

As LachlanB said, We can use AppDomains to load the DLL dynamically and make it work with Outlook. Absolutely It will work, but we are taking control of loading our application's DLL into Outlook process.This might require some additional work on design and coding part. Normally this will be the job of Outlook to load addins DLL.

My Suggestion is, simply don't change your applications design and coding to enable debugging. It's not a best practice. Instead concentrate on, why your outlook is getting loaded very slowly?

You can try LachlanB's second suggestion on configuring outlook to load faster. use that steps to cleanup your outlook. You can also try discussion in MSDN forums http://social.technet.microsoft.com/Forums/en-US/exchangesvrclients/thread/a117fa73-8f19-4716-9603-eb756b609cd5

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文