[英]Retrieving the COM class factory for component with CLSID error: 80070005 Access is denied
[英]Error when building on server: Retrieving the COM class factory for component with CLSID
我使用的是Visual Studio2013。在我的程序中,我創建了一個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。 我需要在構建服務器上安裝什么,以便構建可以正確編譯?
PS我的程序基於x86平台構建。
構建服務器(不是Visual Studio)缺少的是Excel。
但是完全不支持從Windows服務(例如TFS Build)運行Office(請參閱KB 257757 )。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.