2011-11-08 20 views
0

我有一個使用Excel 2003模板(xlt)的VSTO 2005構建的Excel文檔級別自定義項目。現在我已經遷移到VS2010(.NET4)和Excel 2007環境。遷移到VSTO2010後無法打開VSTO 2005/Excel 2003自定義文件

我的應用程序是一個報告工具,用戶可以使用自定義創建Excel報告。所以目前他們有一些現有的* .xls和* .xlsx報告。

我的問題是我將我的解決方案遷移到VSTO2010之後,我無法打開以前創建的報告。它給錯誤,

Could not load file or assembly 'MyApp.BusinessAnalytics, Version=1.0.0.0, 
Culture=neutral, PublicKeyToken=ff90f512e10aef0d' or one of its dependencies. This 
assembly is built by a runtime newer than the currently loaded runtime and cannot be 
loaded. 

我使用MSI爲了安裝應用程序。

當我比較使用VS2005版本和VS2010版本創建的應用報告時,我注意到'_AssemblyName','_AssemblyLocation'和'Solution ID'在2個版本中是不同的。例如,2005/Excel 2003版本對於_AssemblyName有*,但2010有'4E3C66D5-58D4-491E-A7D4-64AF99AF6E8B'。

我已啓用程序集綁定日誌。並觀察使用fuslogvw.exe

在大會綁定日誌條目集綁定例外:

*** Assembly Binder Log Entry (8/3/2011 @ 11:57:28 AM) *** 

The operation failed. 
Bind result: hr = 0x8013101b. No description available. 

Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll 
Running under executable C:\Program Files (x86)\Microsoft Office\Office12\EXCEL.EXE 
--- A detailed error log follows. 

=== Pre-bind state information === 
LOG: User = CORPNET\vohelk 
LOG: DisplayName = Ifs.Application.BusinessAnalytics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ff90f512e10aef0d 
(Fully-specified) 
LOG: Appbase = file:///C:/Program Files (x86)/IFS Applications/IFS Business Analytics/ 
LOG: Initial PrivatePath = NULL 
LOG: Dynamic Base = NULL 
LOG: Cache Base = NULL 
LOG: AppName = NULL 
Calling assembly : (Unknown). 

LOG: This bind starts in default load context. 
LOG: Using application configuration file: C:\Program Files (x86)\IFS Applications\IFS  Business Analytics\Ifs.Application.BusinessAnalytics.dll.config 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework \v2.0.50727\config\machine.config. 
LOG: Post-policy reference: Ifs.Application.BusinessAnalytics, Version=1.0.0.0,  Culture=neutral, PublicKeyToken=ff90f512e10aef0d 
LOG: GAC Lookup was unsuccessful. 
LOG: Attempting download of new URL file:///C:/Program Files (x86)/IFS Applications/IFS Business Analytics/Ifs.Application.BusinessAnalytics.DLL. 
LOG: Assembly download was successful. Attempting setup of file: C:\Program Files (x86)\IFS Applications\IFS Business Analytics\Ifs.Application.BusinessAnalytics.dll 
LOG: Entering download cache setup phase. 
ERR: Error extracting manifest import from file (hr = 0x8013101b). 
ERR: Setup failed with hr = 0x8013101b. 
ERR: Failed to complete setup of assembly (hr = 0x8013101b). Probing terminated. 

你對此有任何線索。非常感謝您對此的幫助。

回答

0

請注意,在你的fushion登錄裝配經理仍然是來自V2.0(這是此消息來自,因爲它試圖加載V4裝配V2運行時內)

升級需要多一點的而不是簡單地在vs2010中打開它,特別是如果你轉向框架V4。一個快速的解決方法,你也可以目標框架3.5而不是4

如何以及你需要改變取決於你來自哪裏以及你正在使用什麼。看看這兩個關於升級的msdn文檔,並仔細查看您的scenerio的這些步驟。這是一個閱讀,但我認爲它是相當完整和有用的。

Upgrading and Migrating Office SolutionsMigrating Office Solutions to the .NET Framework 4

+0

你知道的任何文件或職位,可以幫助某人有2003文檔級定製維持其2003年的源代碼編譯的起源和仍與Excel 2010的工作嗎?我似乎遇到了_AssemblyName和_AssemblyLocation的問題,它們不解決庫背後的代碼。程序集名稱是astrisk(*),位置是GUID。 –

+0

抱歉,不能幫助你。始終更加註重應用級別的插件,而不是文檔級別。也許更好地發佈這個作爲一個新問題。 – Eddy

相關問題