Hey there,
We are having some troubles with some custom software we have wrote which interfaces with the SolidWorks API.
Project overview:
- Use EPDM to search for a part file, retrieve its bill of materials.
- Use SolidWorks to open each file and export it to a PDF, stored on the company's local network.
During development, a local IIS service was used on the development workstation. Thus, during development and debugging the developer could see the SolidWorks instance opening and the drawings being loaded as the service executed. I wanted to highlight this as I feel it is the main difference between the development and production environments. In the production environment, the service is running on an IIS server which is not logged in under a user account. Let me note that during development, no issues were encountered and the service executed perfectly.
Now that we are done with development, we went to distribute the service to the IIS server... this is where we hit problems. The software can consume the EPDM API without issue and successfully find parts and retrieve their bill of material. The issue comes when we go to deal with SolidWorks. There is significant logging in our software and we have pin-pointed the failure to a single line where we instantiate the SolidWorks application:
Dim sw As SldWorks = New SldWorks
The above line will hang for approximately a minute before an exception is thrown. The exception thrown is as follows:
Retrieving the COM class factory for component with CLSID {0D825E02-9000-4D82-B4AB-D6BDC2872797} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)). |
From my reading, it sounds that this is a general error and I should look into the server's event log for further details. I did so and found a different message, however not too much more description... just communicates that a general timeout has occurred for some reason:
The server {0D825E02-9000-4D82-B4AB-D6BDC2872797} did not register with DCOM within the required timeout. |
I have confirmed that the API is operational on the production server. I accomplished this by writing a simple command line application that instantiated a SldWorks object and set Visible = 'True'. When executing this while logged into the server, SolidWorks opens successfully. It is only when it is running under the service account or under a non-logged in user that the issue is encountered.
Also, all servers are located on-site, so there are no limitations by third parties, etc. The production server is running Windows Server 2012 with Microsoft IIS 8.0. SolidWorks 2013 and 2014 is installed, but from the CLSID of the COM error, it is trying to launch SW2013 - this is what we want.
I have spent about a day researching this issue and have read the following items and attempted their respective fixes, without success:
- DCOM security privileges - it was mentioned that the user account IIS is using to run the service does not have access privileges to the DCOM objects. I went into Component Services->My Computer and modified both the global default security as well as the individual DCOM object's security. I have additionally tried running the IIS service under different user accounts (
\Administrator, \Administrator, ApplicationPoolIdentity, NetworkService), each time ensuring the respective account had correct DCOM privileges, all without success. - COM internet services - I had read that it could be related to COM internet services (found this one when searching more broadly). As such I tested this by enabling COM internet services. Still had no success.
- Allow service account to interact with desktop - I read that allowing the IIS service to interact with desktop could resolve my problem. As such I went to the IIS service Log On properties and allowed it to interact with desktop; still no success.
- Load user profile - I read that SolidWorks requires a user profile to exist for it to launch correctly. As such, I went to the service application pool's settings and enabled Load User Profile.
Any assistance is greatly appreciated.
Edit 02/24/2014 #1:
I have additionally tried the following solution without success:
http://kb.monitorware.com/event-10010-server-did-not-register-t390.html
Message was edited by: Curtis Watson
Edit 02/24/2014 #2:
I am trying to narrow the scope of the problem... I went into the component services and modified the security for SldWorks 2013 Application - I set the authentication level to None to try and remove DCOM security from one of the possible causes. After setting the security to None I still receive the same issue.
Message was edited by: Curtis Watson
Edit 02/24/2014 #3:
A little more information... I've discovered that the SLDWORKS.exe process is actually being executed for the duration of time that the service hangs on the SldWorks object instantiation. After the DCOM timeout period elapses and the exeception is thrown, this SLDWORKS.exe process then ends. Thanks again to anyone that can provide some guidance or troubleshooting ideas that I haven't yet tried.
Message was edited by: Curtis Watson
SolidworksApi macros