gpt4 book ai didi

c# - 空的 Outlook 加载项会导致立即崩溃

转载 作者:太空宇宙 更新时间:2023-11-03 12:21:29 25 4
gpt4 key购买 nike

环境:VS 2015 Community Edition Update 3; 2016年展望; Windows 10 x64;适用于所有人的最新补丁。

使用 VSTO 和 C# 创建新的 Outlook 加载项时,Visual Studio 会创建一个空项目。 (由于它只是一个空项目的样板,我不会在此处包含它。)但是,尝试启动这个空项目会导致 Outlook 立即崩溃:

FatalExecutionEngineError occurred

Message: Managed Debugging Assistant 'FatalExecutionEngineError' has detected a problem in 'C:\Program Files (x86)\Microsoft Office\root\Office16\outlook.exe'.

Additional information: The runtime has encountered a fatal error. The address of the error was at 0x730e1302, on thread 0xfb4. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.

我在 InternalStartupThisAddIn_Startup 方法上都设置了断点;在命中任何一个之前抛出异常。我还尝试构建为 x86、x86_64 和任何 CPU,但都无济于事。

谁能指导我这里出了什么问题?

最佳答案

回答:默认情况下,新加载项是调试构建,按 F5 以 Debug模式运行它们,这更慢。这是 Outlook 的一个问题,它将缓慢的加载项视为固有缺陷,将它们标记为已损坏并中止 Outlook,以便 Outlook 下次启动时可以跳过“损坏”的插件。

将我的代码切换到 Release 版本并正常运行,在没有调试支持的情况下解决了这个问题。

关于c# - 空的 Outlook 加载项会导致立即崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46965311/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com