2010-08-30 44 views
5

這是針對VS2010下的windows窗體項目。錯誤RG0000:無法加載文件或程序集「xxx」或其某個依賴項。訪問被拒絕

下面是我從的MSBuild得到消息:

error RG0000: Could not load file or assembly '3rdPartyAssemblyUsedByProject, Version=1.1.263.0, Culture=neutral, PublicKeyToken=687bce93d7ce902c' or one of its dependencies. Access is denied. Line 174 , position 5. [C:\xxx\src\BackOffice.csproj]

這裏是用來踢這一關的命令行:

c:/WINDOWS/Microsoft.NET/Framework/v4.0.30319/msbuild.exe BackOffice.csproj /p:PlatformTarget=x86 

線的RESX文件174歸因於錯誤:

<data name="generalImages.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64"> 
    <value> 
     ... 
    </value> 
    </data> 

generalImages是一個ImageList控件,帶有用於表單上按鈕的圖像。

這對我的開發機器很好,但是在我的構建服務器上是一個問題。我的工作站是Windows 7 64位,構建服務器是Windows 2008 Server 64位。生成服務器確實安裝了Windows 7.1 sdk。

如果我從v3.5框架使用msbuild,編譯會成功完成。我確實得到了這個警告信息,並不會導致我在這個問題上有任何問題: 項目文件包含ToolsVersion =「4.0」,該版本的MSBuild不支持該項目文件。處理項目就好像它有ToolsVersion =「3.5」。

這樣做的全部原因是實際上以4.0框架爲目標,並使用諸如方法默認值之類的東西,而這些方法在定位3.5時不起作用。

我已經在這一個搜索和搜索。我遇到過很多與32位/ 64位問題有關的點擊 - 圖像格式是問題,但這不是我的問題。這個錯誤說「訪問被拒絕」。我確實使用fuslogvw試圖找出拒絕訪問的來源 - 但我沒有看到它,但實際上並沒有找到任何程序集。程序集不在GAC中,而是在項目文件引用所在的項目文件的切線目錄中。

這裏是融合日誌:

* Assembly Binder Log Entry (8/30/2010 @ 1:44:48 PM) *

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

Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v2.0.50727\mscorwks.dll Running under executable C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\ResGen.exe --- A detailed error log follows.

=== Pre-bind state information === LOG: User = domain\user LOG: DisplayName = 3rdPartyAssemblyUsedByProject, Version=1.1.263.0, Culture=neutral, PublicKeyToken=687bce93d7ce902c (Fully-specified) LOG: Appbase = file:///C:/Program Files/Microsoft SDKs/Windows/v7.1/Bin/ LOG: Initial PrivatePath = NULL LOG: Dynamic Base = NULL LOG: Cache Base = NULL LOG: AppName = NULL Calling assembly : System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089. === LOG: This bind starts in default load context. LOG: Using application configuration file: C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\ResGen.exe.Config LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v2.0.50727\config\machine.config. LOG: Post-policy reference: 3rdPartyAssemblyUsedByProject, Version=1.1.263.0, Culture=neutral, PublicKeyToken=687bce93d7ce902c LOG: GAC Lookup was unsuccessful. LOG: Attempting download of new URL file:///C:/Program Files/Microsoft SDKs/Windows/v7.1/Bin/3rdPartyAssemblyUsedByProject.DLL. LOG: Attempting download of new URL file:///C:/Program Files/Microsoft SDKs/Windows/v7.1/Bin/3rdPartyAssemblyUsedByProject/3rdPartyAssemblyUsedByProject.DLL. LOG: Attempting download of new URL file:///C:/Program Files/Microsoft SDKs/Windows/v7.1/Bin/3rdPartyAssemblyUsedByProject.EXE. LOG: Attempting download of new URL file:///C:/Program Files/Microsoft SDKs/Windows/v7.1/Bin/3rdPartyAssemblyUsedByProject/3rdPartyAssemblyUsedByProject.EXE. LOG: All probing URLs attempted and failed.

在這一點 - 我很爲難。不知道下一步該去哪裏。任何建議都會受到歡迎。

Cort

回答

0

團隊構建在服務帳戶下運行。您是否檢查此帳戶是否有權訪問第三方程序集所在的程序文件位置?

+0

我手動從命令行中運行此。我已經驗證了我擁有第三方程序集的位置,我登錄的用戶在文件上選中了「完全控制」並且是該文件的所有者。 – Cort 2010-08-30 21:08:34

+0

...還有,我試圖從包括我融合日誌顯示 - 該組件從來沒有真正發現 - 它的位置是在../lib/3rdpartyassembly.dll從的csproj文件的位置。 – Cort 2010-08-30 21:20:47

+0

您可以指定/ P DLL的位置:ReferencePath =」 \ 」。 – 2010-08-30 21:31:27

1

我有一個類似的問題與ResGen:錯誤RG0000:無法加載引用程序集。在我的情況下,原來解決方案中的一個項目文件沒有正確升級到vs2010。一旦我將工具引用修復爲4.0,它就可以正常工作。

3

它看起來很像已知的VS 2010 bug描述here on blogs.msdn.com。如果是這樣的話,似乎微軟決定不在最早的Visual Studio 11之前解決它,對於很多人(包括我們)來說,在後期工作中沒有提到任何解決方法。祝你好運。

0

我所面臨的具體問題,如@張貼的工作對我來說,以節省時間別人,我只用了半天的時間試圖解決辦法的解決辦法的Joel.Thought在答覆中提到在這個MSDN blog描述。

,我曾經在博客文章是搜索j00L,並在錯誤發生RESX與j0yL取代它的註釋部分討論解決方法。文件。這個解決方法的壞處是你需要編輯resx。文件,每次你對圖像列表進行更改。

相關問題