发布时出现 C# Outlook 加载项错误 - “找不到加载项 DLL 路径”

本文关键字:加载项 找不到 DLL 路径 错误 布时出 Outlook | 更新日期: 2023-09-27 18:36:44

下午好堆栈交换,

我正在尝试发布我的 Outlook 2013 加载项供其他人使用。我已经在我的计算机上安装了我的插件,首先当我单击功能区按钮时,没有窗口会加载,但它在调试模式下会加载。由于某种原因,现在它似乎在我的 PC 上工作正常,但是当它安装在其他几台人的计算机上时,它会安装并且功能区可见,但是当单击功能区按钮时没有任何反应(一个窗口旨在打开)。

我决定下载"AddInSpy",并在我的电脑和其他人电脑上看看我的应用程序。所有这些都显示有关我的插件的相同错误:

Add-in DLL path is not found. System.BadImageFormatException: Could not load file or assembly 'file:///C:'Users'Alexander Harvey'Desktop'Addin'Application Files'De_Facto_Addin_1_0_0_12'De_Facto_Addin.dll.deploy' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
File name: 'file:///C:'Users'Alexander Harvey'Desktop'Addin'Application Files'De_Facto_Addin_1_0_0_12'De_Facto_Addin.dll.deploy'
   at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
   at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
   at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
   at System.Reflection.Assembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, StackCrawlMark& stackMark)
   at System.Reflection.Assembly.ReflectionOnlyLoadFrom(String assemblyFile)
   at AddInSpy.AssemblyScanner.GetAssemblyInfo(String fileName, String hostName, Boolean isVstoAddIn)

我完全陷入困境,并且一直在尝试找到修复程序 3 小时。因此,任何帮助将不胜感激。谢谢。

发布时出现 C# Outlook 加载项错误 - “找不到加载项 DLL 路径”

您应该尝试使用日志记录。这意味着您将能够查明您的问题。

我建议使用 Log4Net 并在启动时在每一行添加日志输出。

和你有类似的问题,这就是我解决它的方式,最终只是一个愚蠢的拼写错误:P