title: System.UnauthorizedAccessException: Creating an instance of the COM component fails with error 80070005 (C#)
body: <p>I have a problem with a C# .NET command line application, which main idea is to get data from other program using COM object. It works fine when being executed manually or when running as a child process inside Node.js server, however when the entire project is installed as a windows service the C# app responds with following error:</p>
  
  <pre><code>System.UnauthorizedAccessException: Creating an instance of the COM component with CLSID {D64DB4A9-3B26-4D2B-B556-9DA433C54175} from the IClassFactory failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
     at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean&amp; canBeCached, RuntimeMethodHandleInternal&amp; ctor, Boolean&amp; bNeedSecurityCheck)
     at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark&amp; stackMark)
     at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark&amp; stackMark)
     at System.Activator.CreateInstance(Type type, Boolean nonPublic)
     at System.Activator.CreateInstance(Type type)
     at CurrentCamUri.Program.Main(String[] args)
  </code></pre>
  
  <p>From what I read <a href="https://stackoverflow.com/questions/1491123/system-unauthorizedaccessexception-retrieving-the-com-class-factory-for-word-in">here</a> and on similar threads mainly focused on Office applications, I should see the COM object inside <strong>"DCOM Config"</strong> tab in <code>dcomcnfg /32</code>, however I can't find anything with the related CLSID. I tried running <code>dcomcnfg</code> without the '/32' suffix but also with no success. The main application with which I need to get data from is 32-bit (let's call it mother app). </p>
  
  <p>Any suggestion how can I approach that problem? I would be really grateful. Thanks!</p>