1

I have a project that uses a Nuget package that references some Solidworks dll's version 28.1.0.74. I have a newer version of Solidworks installed on this workstation. My project seems to run fine.

I am trying to use unit tests that tests certain classes in my project. My unit tests need to run Solidworks to get certain tests done. I am running into issues with versions. If I add a reference in my testing project to the installed version of Solidworks I get the following error when I run my unit tests:

System.IO.FileNotFoundException: Could not load file or assembly 'SolidWorks.Interop.sldworks, Version=28.1.0.74, Culture=neutral, PublicKeyToken=7c4797c3e4eeac03' or one of its dependencies. The system cannot find the file specified.

This is clearly looking for the older version of Solidworks.

If I remove the references to the installed version of Solidworks and add references to the version that comes with the NuGet package My project build OK but I get the following when I try to run the unit tests:

Initialization method TestEntityDB.SolidworksFeatureTreeTests.StartTestEnvironment threw exception. System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {D134B411-3689-497D-B2D7-A27CB1066648} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))..

What is the proper answer to this situation? Register the dll's manually? Would doing so screw up any other installations I may have?

Eric Snyder
  • 1,816
  • 3
  • 22
  • 46
  • For the second error, looks like your library dep wraps an old COM component. You'll need to get that into the registry [with regsvr32](https://stackoverflow.com/a/13396451) – StuartLC Oct 25 '21 at 18:43
  • Hmmm.... I get "The module "[removed for brevity]" was loaded but the entry-point DllRegisterServer was not found. Make sure that "[removed for brevity]" is a valid DLL or OCX file and then try again. – Eric Snyder Oct 25 '21 at 19:45

0 Answers0