2012-08-22 48 views
0

我無法上傳Excel文件到AppHarbor,然後打開它,即使它在本地正常工作。我將文件上傳到App_Data,並將AppHarbor設置設置爲寫入文件目錄。其實上傳OK(我認爲),但是當我嘗試使用Excel的dll文件:無法在AppHarbor上使用Excel dll

var excel = new Application(); 

它生成此錯誤:

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)

我必須Microsoft.Office.Interop參考.Excel在我的項目中,甚至嘗試在本地複製它並在那裏引用它。有任何想法嗎?

+0

Excel是否安裝在AppHarbor?我猜不是,因爲MS特別建議不要這樣做...... –

+0

Excel未安裝在AppHarbor應用程序服務器上。 – friism

回答

1

Interop庫僅用作Excel應用程序的接口,它必須安裝在運行代碼的任何位置。似乎它不適用於AppHarbor。

+0

謝謝,我最終不得不將我的應用程序更改爲只接受csv上傳。 – Justin