Class not registered when running unit test but runs OK in debug

0

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?

c#
unit-testing
com
asked on Stack Overflow Feb 28, 2020 by Eric Snyder

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0