2012-06-14 84 views
6

我有一個Visual Studio 2010解決方案包含一個類庫(項目A)和兩個的Sharepoint項目(項目B &項目C)。相關性順序是項目B引用ProejctA和項目C引用了兩個項目A &項目B。程序集綁定錯誤:綁定結果:hr = 0x80070002。該系統找不到指定的文件

在一個特定的開發機,我得到試圖建立項目C時,出現以下錯誤:

Compilation failed. Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

當尋找到融合日誌我注意到以下錯誤:

* Assembly Binder Log Entry (14/06/2012 @ 09:38:32) *

The operation failed.

Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll

Running under executable C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe

--- A detailed error log follows.

=== Pre-bind state information === LOG: User = DOMAIN\username

LOG: DisplayName = ProjectB, Version=0.0.0.0, Culture=neutral, PublicKeyToken=aaaaaaaaaaaaaaaa, processorArchitecture=MSIL (Fully-specified)

LOG: Appbase = file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/

LOG: Initial PrivatePath = NULL

LOG: Dynamic Base = NULL

LOG: Cache Base = NULL

LOG: AppName = devenv.exe

Calling assembly : (Unknown).

LOG: This bind starts in default load context.

LOG: Using application configuration file: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.Config

LOG: Using host configuration file:

LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.

LOG: Post-policy reference: ProjectB, Version=0.0.0.0, Culture=neutral, PublicKeyToken=aaaaaaaaaaaaaaaa, processorArchitecture=MSIL

LOG: GAC Lookup was unsuccessful.

LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/ProjectB.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/ProjectB/ProjectB.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PublicAssemblies/ProjectB.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PublicAssemblies/ProjectB/ProjectB.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/ProjectB.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/ProjectB/ProjectB.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/TemplateProviders/ProjectB.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/TemplateProviders/ProjectB/ProjectB.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/DataCollectors/ProjectB.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/DataCollectors/ProjectB/ProjectB.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/DataCollectors/x86/ProjectB.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/DataCollectors/x86/ProjectB/ProjectB.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/Editor/ProjectB.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/Editor/ProjectB/ProjectB.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Platform/Debugger/ProjectB.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Platform/Debugger/ProjectB/ProjectB.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/ProjectB.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/ProjectB/ProjectB.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PublicAssemblies/ProjectB.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PublicAssemblies/ProjectB/ProjectB.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/ProjectB.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/ProjectB/ProjectB.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/TemplateProviders/ProjectB.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/TemplateProviders/ProjectB/ProjectB.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/DataCollectors/ProjectB.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/DataCollectors/ProjectB/ProjectB.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/DataCollectors/x86/ProjectB.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/DataCollectors/x86/ProjectB/ProjectB.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/Editor/ProjectB.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/Editor/ProjectB/ProjectB.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Platform/Debugger/ProjectB.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Platform/Debugger/ProjectB/ProjectB.EXE. LOG: All probing URLs attempted and failed.

我曾嘗試:

  1. 刪除對ProjectB的引用並重新添加它們:
    • a)中的項目引用
    • b)中作爲直接的手動參考項目B的調試夾
  2. 手動放置ProjectB.dll到GAC
  3. 更改 「複製本地」選項從真到假(並回到真)

而且只有(2)將程序集放在GAC中允許ProjectC構建。 爲什麼它沒有找到它應該(並在其他機器上)的組件?

+0

是否所有的機器64位或僅這一項呢? –

+0

所有64位Windows Server 2008 R2 – mundeep

回答

3

因此,原來的組件不能被發現,因爲我們是Delayed Signing the Assemblies這意味着理由:

Because the assembly does not have a valid strong name signature, the verification of that signature must be turned off. You can do this by using the –Vr option with the Strong Name tool.

然而,我在64位的Visual Studio命令只已經這樣做了所有需要的公共密鑰提示。我還需要在Visual Studio命令提示符的x86版本中添加跳過x86的驗證。

我只是設法找到這一點,因爲想一個特定的命令基於構建/部署腳本,我注意到與測試組件之一以下異常:

Could not load file or assembly 'ProjectC.Tests, Version=0.0.0.0, Culture=neutral, PublicKeyToken=e72f8d3506b83180' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)

3

公鑰= aaaaaaaaaaaaaaaa可以是不同的或可能是組件的版本號是不同的。我認爲你應該使用 Fusion Log Viewer to Debug作爲描述,並希望你完全可以解決你的問題。

+1

一)融合登錄高於我能理解從那就是它檢查GAC,然後由於某種原因而不是IDE文件夾的項目bin文件夾中。 (b)作爲上述,如果我手動將項目B組件中可以發現的GAC(這意味着關鍵是正確的)提到的 - 我剛人工檢查(SN-T)和密鑰是相同的。 – mundeep

+0

您可以粘貼您使用過的密鑰(sn-T)以及程序集的版本號。 – MMK

+0

所以我從GAC刪除的項目B的dll,並試圖重新建立我得到融合如下:===預綁定狀態信息=== LOG:用戶=域\用戶名 LOG:顯示名稱=項目B,版本= 0.0.0。0,Culture = neutral,PublicKeyToken = e72f8d3506b83180,processorArchitecture = MSIL (Fully-specified) LOG:Appbase = file:/// C:/ Program Files(x86)/ Microsoft Visual Studio 10.0/Common7/IDE/ .. ... 日誌:策略後引用:ProjectB,Version = 0.0.0.0,Culture = neutral,PublicKeyToken = e72f8d3506b83180,processorArchitecture = MSIL LOG:GAC查找失敗。 – mundeep

相關問題