When I run my application in debug mode it runs fine. When I run unit tests I get the following:
Test method XXXX.XXXX.ToolingAddIn.UnitTests.SolidWorksPartReferenceTest.CheckForGoodReference threw exception: System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {00AB5D8D-2B8F-416B-9761-92FACC8872BE} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
This is the code that fails:
SwDMClassFactory swClassFact = default;
SwDMApplication4 swDocMgr = default;
SwDMDocument24 swDoc = default;
swClassFact = new SwDMClassFactory(); <---- Fails here
What would cause this? How would I resolve?
User contributions licensed under CC BY-SA 3.0