最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

.net - My COM Add-In is not loaded on Outlook x32, but loaded on Outlook x64? - Stack Overflow

matteradmin3PV0评论

I developed a COM Add-In for Outlook using VB.NET in Visual Studio 2019. I duplicated the development virtual machine and run one with Outlook 2016 x64 and one with Outlook 2016 x32. The code is synchronized using git. I currently compile the Add-In as DLL (regifyOLAddIn.dll) as MSIL (assembly, "Any CPU").

The problem is, that the x64 Outlook is loading my Add-In without any issues through mscoree.dll.

The Outlook x32 does not. I compile the same source code on both machines.

I activated Fusion logs and all logs regarding my Add-In showing success. No error message. All say they're happy like this:

The operation was successful.
Bind result: hr = 0x0. The operation completed successfully.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable  C:\Program Files (x86)\Microsoft Office\root\Office16\OUTLOOK.EXE
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: Where-ref bind. Location = C:/git/outlook_addin/src/bin/regifyOLAddIn.dll
LOG: Appbase = file:///C:/Program Files (x86)/Microsoft Office/root/Office16/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = OUTLOOK.EXE
Calling assembly : (Unknown).
===
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: IL assembly loaded from C:\git\outlook_addin\src\bin\regifyOLAddIn.dll.

and this

The operation was successful.
Bind result: hr = 0x0. The operation completed successfully.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable  C:\Program Files (x86)\Microsoft Office\root\Office16\OUTLOOK.EXE
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: DisplayName = Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
 (Fully-specified)
LOG: Appbase = file:///C:/Program Files (x86)/Microsoft Office/root/Office16/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = OUTLOOK.EXE
Calling assembly : regifyOLAddIn, Version=2.0.11.0, Culture=neutral, PublicKeyToken=null.
===
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: Start validating all the dependencies.
LOG: [Level 1]Start validating native image dependency mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
LOG: [Level 1]Start validating native image dependency System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
LOG: [Level 2]Start validating native image dependency mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
LOG: [Level 2]Start validating IL dependency System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
LOG: [Level 2]Start validating IL dependency System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
Native image has correct version information.
LOG: [Level 1]Start validating native image dependency System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
LOG: [Level 2]Start validating native image dependency mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
LOG: [Level 2]Start validating native image dependency System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
LOG: [Level 2]Start validating IL dependency System.Numerics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
LOG: [Level 2]Start validating IL dependency System.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
LOG: [Level 2]Start validating IL dependency System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
Native image has correct version information.
LOG: [Level 1]Start validating IL dependency System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
LOG: [Level 1]Start validating IL dependency System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
LOG: [Level 1]Start validating IL dependency System.Deployment, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
LOG: [Level 1]Start validating IL dependency System.Management, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
LOG: [Level 1]Start validating IL dependency System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
LOG: [Level 1]Start validating IL dependency System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
LOG: [Level 1]Start validating IL dependency System.Runtime.Remoting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
Native image has correct version information.
LOG: Validation of dependencies succeeded.
LOG: Bind to native image succeeded.

But it never shows up. The Add-In Connect event is never called.

I tried removing all related registry entries and re-register using IDE and also using regasm.exe. No success.

My DLL is having two other DLL as dependency, but I have correct x32 DLLs in the same folder. Due to ProcessMonitor, these DLLs are not even touched. My Add-In seems not loaded at all.

Outlook simply says, that mscoree.dll failed like "During loading of the COM Add-In a runtime error occurred" (or similar, it's in German). It stays in the "deactivated add-ins" list.

The Windows Event-Logs only list the Add-Ins Outlook has loaded. The list does not mention my Add-In. No error is logged.

I also tried to explicitly build as x32, but it behaves mostly the same.

Of course, Registry LoadBehavior is set to 3, FriendlyName and Description are fine (all set by the IDE anyway). There is no Manifest entry because the InProcServer registry values of the COM classes all contain file path and name of the Add-In. And in x64 it works without Manifest entry anyway.

The only thing I can imagine is, that the issue is because I uninstalled Office x64 and installed a new Outlook x32 version on that machine. iIs that an issue? Can I heal that?

I'm really desperate now. I have no clue what else I can try to make Outlook load my Add-In. It does not even tell me in any way what the error might be.

Post a comment

comment list (0)

  1. No comments so far