2014-02-10 70 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

相关问题