I have to run Visual Studio in admin mode because of code signing certificates. Everything is fine except when debugging my WinForms application. Invoking Excel (Microsoft.Office.Interop.Excel) throws an exception:
m_excelApp = new Excel.Application();
System.Runtime.InteropServices.COMException: 'Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).'
Consequently, I cannot test that specific part of my application.
Of course, if I remove certificates and run VS as not being admin, everything works fine. Equally, the code also works in the released executable (which is a "ClickOnce" application, so I cannot test whether it would work in admin mode).
I guess I would have to specify somewhere that the Excel executable should also be started in admin mode.
User contributions licensed under CC BY-SA 3.0