Note that there are some explanatory texts on larger screens.

plurals
  1. POCOM component works 100% from a console app, but fails when called from a service
    primarykey
    data
    text
    <p>I need your advice for the following C# code:</p> <pre><code>EgarDDSEnt.IIVDDSEnt dds = null; // This line executes fine. dds = new IVDDSEnt(); // This line fails with an exception ... dds.Connect("username", "password"); // ... which makes this line fail too. </code></pre> <p>Here are the symptoms:</p> <p>Windows Server 2008 R1:</p> <ul> <li>Code fails when executed from a Windows service app.</li> <li>Code works 100% when executed from a console app.</li> </ul> <p>Windows 7:</p> <ul> <li>Code works 100% when executed from a Windows service app.</li> <li>Code works 100% when executed from a console app.</li> </ul> <p>The class IVDDSEnt() is a COM object that is installed you install the "ivolatility SDK".</p> <p><strong>Update:</strong></p> <ul> <li>When I execute "System.IO.Directory.GetCurrentDirectory()" from the console application, it returns "D:\MyDevDirectory\"</li> <li>When I execute "System.IO.Directory.GetCurrentDirectory()" from the service application, it returns "C:\windows\system32\".</li> <li>The application is actually the <em>same binary</em> for both service and console (its a hybrid app that can run in console mode, or install itself as a service if you pass "-service" to it on the command line).</li> </ul> <p><strong>Update:</strong></p> <p>Added try/catch, and "e.GetBaseException" (defined as "Returns the exception which is the root cause of one or more subsequent exceptions"):</p> <pre><code>System.Runtime.InteropServices.COMException (0x80080005): Retrieving the COM class factory for component with CLSID {FA944FE7-AEB8-4B5B-8315-11D19B1F6264} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)). at PhiDataOnSchedule.ConsoleApplication.MyMain(Boolean dummyRun) </code></pre> <p><strong>Update:</strong></p> <p>Still can't fix the problem - the easiest way might be to just upgrade from Windows Server 2008 R1 to Windows Server 2008 R2 (if it works on Win7, and Windows Server 2008 R2 has a Win7 core, perhaps it'll work around the underlying issue somehow?).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload