Calendar Sync not working with two Office-Version installed

Mar 16 at 10:47 AM
Hi all,

every time when I use Calendar Sync I got an error indicating a Problem with Microsoft.Office.Interop.Outlook.Application something about a COM-object that could not be casted (German "umgewandelt". with the Addition of library and Interface with IID 00063001-0000-0000-C000-000000000046 not registered).

This always lead to an Null-Object in OutlookTaskService.cs

I therefor changed the code as shown at the end

When I remove the second entry from my registry everything works fine.

I hope this Information helps to improve this very fine piece of software.

Martin
_
if (application != null)
                {
                    nameSpace = application.GetNamespace("MAPI");
                    if (!string.IsNullOrEmpty(profileName) && !nameSpace.CurrentProfileName.Equals(profileName))
                    {
                        
                        throw new InvalidOperationException(
                            $"Current Outlook instance is opened with a Different Profile Name ({nameSpace.CurrentProfileName}).{Environment.NewLine}Close Outlook and try again.");
                    }
                }
                else
                {
                    Logger.Info("Could not attach to running Outlook-Process: Please check registry if there are two entries for the Microsoft.Office.Interop.Outlook at IID");
                    throw new InvalidOperationException(
                            $"Could not attach to current Outlook process");
                }



_