2

Hudson を継続的インテグレーション サーバーとして使用しています。ジョブは、最終的に MSBuild を開始します。皆さん、時々、私のビルドは MSBuild からの非コード コンパイル エラーで失敗します。

C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(2703,9): error MSB3021: Unable to copy file "..\Lib\Microsoft\Microsoft.Practices.Unity.Configuration.dll" to "bin\Debug\Microsoft.Practices.Unity.Configuration.dll". Access to the path 'bin\Debug\Microsoft.Practices.Unity.Configuration.dll' is denied.

「bin\Debug\Microsoft.Practices.Unity.Configuration.dll」を調べると、0 バイトのファイルであることがわかりました。

このファイルに問題がある理由がわかりません。何か案は?

4

4 に答える 4

6

MS Build Copy タスクには文書化されていない機能があり、少なくとも Google は黙っています。システム全体の環境変数 MSBUILDALWAYSRETRY=1 を設定すると、コピー操作中にアクセス拒否例外が発生しても、このタスクはファイルのコピーを再試行します。

出力例

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets (3513): Got System.UnauthorizedAccessException: Access to the path 'C:\Builds\8\28\Binaries\Release\fr\System.Spatial.resources.dll' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost)
   at System.IO.File.Copy(String sourceFileName, String destFileName, Boolean overwrite)
   at Microsoft.Build.Tasks.Copy.CopyFileWithLogging(FileState sourceFileState, FileState destinationFileState)
   at Microsoft.Build.Tasks.Copy.DoCopyWithRetries(FileState sourceFileState, FileState destinationFileState, CopyFileWithState copyFile) copying C:\Builds\8\28\Sources\Main\Solutions\packages\System.Spatial.5.2.0\lib
et40\fr\System.Spatial.resources.dll to C:\Builds\8\28\Binaries\Release\fr\System.Spatial.resources.dll and HR is -2147024891
 C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets (3513): Retrying on ERROR_ACCESS_DENIED because MSBUILDALWAYSRETRY = 1
 C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets (3513): Could not copy "C:\Builds\8\28\Sources\Main\Solutions\packages\System.Spatial.5.2.0\lib
et40\fr\System.Spatial.resources.dll" to "C:\Builds\8\28\Binaries\Release\fr\System.Spatial.resources.dll". Beginning retry 1 in 1000ms. Access to the path 'C:\Builds\8\28\Binaries\Release\fr\System.Spatial.resources.dll' is denied.
于 2013-03-23T06:45:43.140 に答える
1

プロセスが bin\Debug\Microsoft.Practices.Unity.Configuration.dll を開いたままにしているようです。「bin」の名前を「bin-old」などの別の名前に変更してから「bin-old」を削除することで、以前に確認できます。「bin」内のファイルを開いたままにしているプロセスがある場合、名前の変更は失敗します。

于 2009-07-16T16:01:22.560 に答える