2014-02-10 69 views
1

構建服務器上出現奇怪的錯誤,這不會在本地發生。構建服務器上的SpecFlow錯誤

Error during file generation. The target file 'C:...\AcceptanceTest\Features\HelloWorld.feature.cs' is read-only, but different from the transformation result. This problem can be a sign of an inconsistent source code package. Compile and check-in the current version of the file from the development environment or remove the read-only flag from the generation result. To compile a solution that contains messaging project on a build server, you can also exclude the messaging project from the build-server solution or set the msbuild project parameter to 'true' in the messaging project file.

我不知道怎樣做才能解決這個問題,我沒有「消息」項目(或知道什麼是被提及過)。和代碼是最新的

這是完整的郵件(一些文件夾名稱已被混淆):

13>C:\Builds\2\Services\PService\src\packages\SpecRun.Excel.1.1.0\tools\TechTalk.SpecFlow-buildfix.targets(47,5): error : Error during file generation. The target file 'C:\Builds\2\Services\PService\src\PService\Test\PService.AcceptanceTest\Features\HelloWorld.feature.cs' is read-only, but different from the transformation result. This problem can be a sign of an inconsistent source code package. Compile and check-in the current version of the file from the development environment or remove the read-only flag from the generation result. To compile a solution that contains messaging project on a build server, you can also exclude the messaging project from the build-server solution or set the msbuild project parameter to 'true' in the messaging project file. [C:\Builds\2\Services\PService\src\PService\Test\PService.AcceptanceTest\PService.AcceptanceTest.csproj] 13>C:\Builds\2\Services\PService\src\packages\SpecRun.Excel.1.1.0\tools\TechTalk.SpecFlow-buildfix.targets(47,5): error : Could not find file 'C:\Users\tfsbuild\AppData\Local\Temp\tmpPWithData.feature.xlsx.cs'. [C:\Builds\2\Services\PService\src\PService\Test\PService.AcceptanceTest\PService.AcceptanceTest.csproj] 13>C:\Builds\2\Services\PService\src\PService\Test\PService.AcceptanceTest\Features\PWithData.feature.xlsx : error : Generation error: Could not find file 'C:\Users\tfsbuild\AppData\Local\Temp\tmpPWithData.feature.xlsx.cs'. [C:\Builds\2\Services\PService\src\PService\Test\PService.AcceptanceTest\PService.AcceptanceTest.csproj]

回答

0

我不知道是什麼消息項目指的是,這件事情我避風港」沒見過。

但是錯誤讀取,如果問題是由於與*.feature.cs*.feature文件的生成問題,但我很困惑,爲什麼這應該在構建服務器上發生的事情。正常情況下,當您保存*.feature文件時,IDE中會生成*.feature.cs。這將通過一些版本控制系統(VCS)進行檢入,您可能會以只讀文件狀態結束。

由於構建服務器試圖重新生成*.feature.cs文件並且無法覆蓋它,所以會顯示錯誤消息。

有些事情要檢查;

  • 您運行的是什麼VCS?它是否將簽入的文件保留爲只讀?
  • 你如何構建生成服務器上的文件?是否有涉及的自定義步驟,還是隻是一個簡單的編譯?
  • 您是否可以通過將*.feature.cs設置爲只讀並在本地計算機上運行相同的構建腳本來在該計算機上覆制此錯誤?

祝你好運。

1

從源代碼管理中刪除HelloWorld.feature.cs

TFS將在構建期間將文件簽出爲只讀文件,因此SpecFlow無法重新生成該文件,因爲它已經存在並且SpecFlow不會覆蓋只讀文件。

我創建了SpecFlow一個新的請求,以不將文件自動添加到源代碼控制瀏覽:https://github.com/techtalk/SpecFlow/issues/592

相關問題