GAC に必要なプロジェクト ライブラリをビルドしようとしているので、ビルド後のイベントとして次の行を追加しました。
"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\gacutil.exe" -if "$(TargetPath)"
偶数(2番目のビルド、4番目のビルドなど)のビルド実行ごとに、次のようになります。
------ Build started: Project: Test.BusinessLogic, Configuration: Debug Any CPU ------
Test.BusinessLogic -> C:\Users\Eran\Documents\Test\Trunk\Test.BusinessLogic\bin\Debug\Test.BusinessLogic.dll
Microsoft (R) .NET Global Assembly Cache Utility. Version 3.5.30729.1
Copyright (c) Microsoft Corporation. All rights reserved.
Assembly successfully added to the cache
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
これは良いことです - ビルドは成功しました。
しかし、奇数(最初のビルド、3番目のビルドなど)のビルド実行ごとに、次のようになります。
------ Build started: Project: Test.BusinessLogic, Configuration: Debug Any CPU ------
Test.BusinessLogic -> C:\Users\Eran\Documents\Test\Trunk\Test.BusinessLogic\bin\Debug\Test.BusinessLogic.dll
Microsoft (R) .NET Global Assembly Cache Utility. Version 3.5.30729.1
Copyright (c) Microsoft Corporation. All rights reserved.
Failure adding assembly to the cache: Cannot create a file when that file already exists.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3717,9): error MSB3073: The command ""C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\gacutil.exe" -if "C:\Users\Eran\Documents\Test\Trunk\Test.BusinessLogic\bin\Debug\Test.BusinessLogic.dll"" exited with code 1.
========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========
これは悪く、非常に奇妙です。
この問題を解決するにはどうすればよいですか?