Marshal.GetActiveObject ("Outlook.Application") throws MK_E_UNAVAILABLE when debugging with elevated privileges

This code runs without problems in debug debug when Visual Studio does not start as an administrator.

Marshal.GetActiveObject("Outlook.Application");

However, when I run Vs as an administrator and run the same line in debugging, I get the following error:

System.Runtime.InteropServices.COMException
Operation unavailable (Exception from HRESULT: 0x800401E3 (MK_E_UNAVAILABLE))

How can I fix this.

+4
source share
1 answer

, Visual Studio ( " " ), Outlook , Windows. , Visual Studio , Outlook.

+6

Source: https://habr.com/ru/post/1540860/


All Articles