我正在使用Visual Studio 2013.在我的程序中,我创建了一个Excel文档。它工作正常,但是当我尝试在构建服务器上构建此解决方案时,服务器会抛出此异常:
Result:System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at AutomatedTest.AutoStatistic.AutoConvert(String pathOld, String pathNew, String pathLog, String pathToDocuments) in...
在这一行:
Application xlApp = new Application();
我不想在构建服务器上安装Visual Studio。我需要在构建服务器上安装什么,以便构建可以正确编译?
P.S。我的程序建立在x86平台上。
答案 0 :(得分:0)
构建服务器中缺少的是Excel,而不是Visual Studio。
但是,完全不支持从TFS Build等Windows服务运行Office(请参阅KB 257757)。