Issue Description:
When using the PDFStamp SDK on a server, some users encounter the following error:
Retrieving the COM class factory for component with CLSID {5E13F0FD-FD2D-4331-A27D-07ADA7766E66} failed due to the following error: 8000401a. The server process could not be started because the configured identity is incorrect. Check the username and password.
This error appears sporadically, working correctly at times while failing at others. The root cause is often related to misconfigured COM identity or outdated project references.
The web page for the PDFStamp SDK product is available at the link below:
https://www.verypdf.com/app/pdf-stamp/try-and-buy.html
Proposed Solution
-
Remove and Re-add PDFStampCom Reference in C# Project:
- Open your C# project in Visual Studio.
- Delete the existing reference to
PDFStampCom
. -
Add a new reference by navigating to the
PDFStampCom.exe
file.- Go to Project > Add Reference > Browse, locate
PDFStampCom.exe
, and add it.
- Go to Project > Add Reference > Browse, locate
- Recompile the project to ensure the new reference is properly integrated.
This step refreshes the connection between your project and the COM component, resolving potential corruption or misalignment issues.
Other Steps to Ensure Stability
-
Check DCOM Configuration on the Server:
- Launch Component Services (
dcomcnfg
) on the server. - Navigate to DCOM Config under Component Services > Computers > My Computer > DCOM Config.
- Find the CLSID
{5E13F0FD-FD2D-4331-A27D-07ADA7766E66}
orPDFStampCom
. - Right-click and choose Properties.
-
In the Identity tab, confirm that the correct user credentials are configured:
- Use a domain or local user account with necessary permissions.
- Double-check that the username and password are accurate and up to date.
- Launch Component Services (
-
Grant File System Permissions:
- Ensure the account specified in the DCOM Identity has full access to the directory containing
PDFStampCom.exe
. - Verify that the account also has permission to write to temporary or output directories required by the PDFStamp SDK.
- Ensure the account specified in the DCOM Identity has full access to the directory containing
-
Address Application Pool Configuration (for IIS Users):
- If the PDFStamp SDK is used in an IIS-hosted application, review the application pool identity:
-
In IIS Manager, navigate to Application Pools.
- Select the pool associated with your application and open Advanced Settings.
- Set the Identity to a user with sufficient permissions, such as
LocalSystem
or a specific service account.
-
Restart COM+ Service:
- Restart the COM+ System Application service to refresh all related settings:
- Open Services.msc, find COM+ System Application, and restart it.
-
Test the Application:
- After making the above changes, deploy and test the application to confirm that the error is resolved and functionality is consistent.
Why This Error Occurs
The error is caused by:
- Incorrect or expired identity credentials in DCOM configuration.
- Broken or outdated project references to the COM component.
- Insufficient permissions for the COM process to access required resources.
Conclusion
By removing and re-adding the PDFStampCom
reference in your C# project, coupled with proper DCOM configuration and permission adjustments, you can eliminate this intermittent error. These steps ensure that the PDFStamp SDK operates consistently on your server, reducing downtime and improving reliability.