Eric Snyder

Error running Document Manager

Discussion created by Eric Snyder on Feb 19, 2020
Latest reply on Mar 16, 2020 by Eric Snyder

Using C#. I have a document manager license key from 2018. I am using SolidWorks 2020.

 

I am getting the following error:

 

System.Runtime.InteropServices.COMException: 'Retrieving the COM class factory for component with CLSID {6E7EFCDD-4A76-4753-A2A4-3F5735026C7A} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).'

My code looks like this:

SwDMClassFactory swClassFact = default(SwDMClassFactory);
SwDMApplication4 swDocMgr = default(SwDMApplication4);
SwDMDocument24 swDoc = default(SwDMDocument24);


swClassFact = new SwDMClassFactory();
var settings = new Properties.Settings();
swDocMgr = (SwDMApplication4)swClassFact.GetApplication(settings.DocumentManagerKey);
SwDmDocumentOpenError result;
swDoc = (SwDMDocument24)swDocMgr.GetDocument(model.GetPathName(), SwDmDocumentType.swDmDocumentAssembly, true, out result);
SwDMSearchOption swDMSearchOption = new SwDMSearchOption();

It's pretty close to straight out of the docs on this page. I am getting the error on the last line:

SwDMSearchOption swDMSearchOption = new SwDMSearchOption();

Although I did not have any issues installing Solidworks I did go ahead and register SwDocumentMgr.dll and Dimxpert.dll and as suggested on this page. They both registered (using admin user) without issue.

 

Is this because I am using a 2018 key with 2020? I have asked for a 2020 key but that takes a while.

Could this be something else?

Outcomes