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

后端 未结 1 749
遇见更好的自我
遇见更好的自我 2021-01-05 05:29

This code run without problem in release r debug when Visual studio isn\'t started as an admin.

Marshal.GetActiveObject(\"Outlook.Application\");
         


        
1条回答
  •  情话喂你
    2021-01-05 06:02

    I would guess that you are running Visual Studio as Administrator (started via Run as Administrator) while Outlook was opened as user, who was logged in as under Windows logon. So the Visual Studio is running under different user than Outlook client.

    0 讨论(0)
提交回复
热议问题