解决 Outlook 插件挂起的推荐方法是什么?
我有一个 Outlook 插件,它相当稳定并且已经使用了多年。在 Citrix 计算机环境中,如果插件保持打开状态,则会导致 Outlook 挂起。日志没有多大帮助。如果我可以进行原生调试,我该如何解决这个问题?
I am having an outlook addin which is fairly stable and has been used for years. On a citrix machine environment, the addin is causing outlook to hang if it is left open. Logs are not helping much. How can I approach the problem if I can do the native debugging?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Outlook 可能因多种原因而挂起。由于 Outlook 是基于 COM 的,因此它使用 STA 这将导致主 UI 线程在等待长时间运行的操作完成(网络调用、磁盘读/写等)时挂起。
您需要查看源代码以查看组件挂起时执行的行为。插入跟踪语句 (
Trace.TraceInformation
)如果您可以重复挂断,也可能会有所帮助。从ThisAddIn.ThisAddIn_Startup
事件开始,查看 AddIn 的入口点。 DebugView 是一个很棒的实用程序,可以在插件运行时查看其跟踪输出。如果 COM 资源未正确清理 (< code>Marshal.ReleaseComObject) - 随着时间的推移,内存消耗将会增加,这将开始使应用程序变得缓慢 - 尽管它不应该导致它冻结/挂起。
最好的办法是了解插件的行为,看看是什么触发挂起。
Outlook can hang for many reasons. Since Outlook is COM-based, it uses STA which will cause the main UI thread to hang while it waits for a long-running operation to complete (network call, disk read/write, etc.).
You will need to review the source code to review what behaviors the component is performing when it hangs. Inserting trace statements (
Trace.TraceInformation
) may also help if you can repeat the hangup. Start with the eventThisAddIn.ThisAddIn_Startup
to see the entry point to the AddIn. DebugView is a great utility to view the Trace output of your plugin while it's running.If COM resources are not being cleanup up properly (
Marshal.ReleaseComObject
) - over time the memory consumption will grow which will start making the application sluggish - although it shouldn't cause it to freeze/hang.Your best bet is understanding the behavior of the plugin to see what triggers the hang.