在TFS上构建要复制Node.js测试项目中的可执行文件
我使用Node.js工具为量角器测试环境创建了一个Node.js项目,以在团队基础服务器上测试Web应用程序。在本地,我可以创建测试项目并使用调试器运行它。但是,在TFS上的构建不起作用。
I created a Node.js project for an protractor test environment using the Node.js Tools to test a web application on a team foundation server. Locally i can create the test project and run it with the debugger. However, the build on the TFS does not work.
日志:
"<PATH>\TestProject.Web.Protractor.Tests.njsproj" (13) on node 2 (default targets).
13>PrepareForBuild:
Creating directory "obj\Debug\".
CoreCompile:
Creating directory "bin".
Copying file from "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Node.js Tools\Microsoft.NodejsTools.WebRole.dll" to "bin\Microsoft.NodejsTools.WebRole.dll".
_CopyWebApplicationLegacy:
Copying Web Application Project Files for TestProject.Web.Protractor.Tests
Creating directory "<PATH>\bin\_PublishedWebsites\TestProject.Web.Protractor.Tests\bin".
13>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets(136,5): error MSB3030: Could not copy the file "obj\Debug\TestProject.Web.Protractor.Tests.exe" because it was not found.
分析Microsoft.WebApplication.targets后,我发现切换 Disable_CopyWebApplication
禁用复制过程。
After analyzing the Microsoft.WebApplication.targets i found the switch Disable_CopyWebApplication
to disable the copy process.
在我的项目文件中TestProject.Web.Protractor.Tests。 njsproj将< Disable_CopyWebApplication> True< / Disable_CopyWebApplication>
添加到属性组,它将可以正常工作:)
Inside the project file for me TestProject.Web.Protractor.Tests.njsproj add <Disable_CopyWebApplication>True</Disable_CopyWebApplication>
to the property group and it will work fine :)
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
...
<Disable_CopyWebApplication>True</Disable_CopyWebApplication>
</PropertyGroup>
...