We are seeing failures in a production environment that is running some .NET code that calls the GW Admin API. The exception raised is:

Retrieving the COM class factory for component with CLSID {35FC2358-811A-11D0-8A96-00805FC16077} failed due to the following error: 80070057.

The code at the point of failure is pretty simple (fails on line 2):

Dim m_objSystem As AdminTypeLibrary.System
m_objSystem = New AdminTypeLibrary.System

The mysterious thing is this works fine quite often, but then intermittently fails. The system this code is from is used to create GW accounts. Around 50 are created per day. Some days, 90% are successfully created with only a small number of the above errors seen, other days there are no successful creates - every single attempt results in the error.

It is not reproducable in non-prod environments. The .NET code consists of a Windows Service which invokes a separate executable that performs the interaction with the GW Admin API, all running in .NET 3.5. The GW Client installed is v7.0.2.

The code has a re-try mechanism - if it fails, it waits 2 seconds and tries again, and repeats this cycle 10 times. Unfortunately, if it fails the first time, it never succeeds on subsequent re-tries.

Any advice on how to resolve this?