I've written a unit test. The code under test references Microsoft.Office.Interop.Excel.dll.
The test runs fine on my machine but fails on the build server. It fails on the line where the Excel application is instantiated:
var application = new Application { Visible = Visible };
The error is:
System.Runtime.InteropServices.COMException:
Retrieving the COM class factory for component with CLSID
{00024500-0000-0000-C000-000000000046} failed due to the following error:
80040154 Class not registered
Does this mean I have to install the Redistributable Primary Interop Assemblies on my build server? And if so, do I also need to install Excel on the build server?
Edit:
Microsoft.Office.Interop.Excel.dll is included in my solution and it is referenced from there.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…