0

我已经构建了一个 MSBuild 脚本,它可以自动将我们的编程团队签入的最新代码每天部署到 2 或 3 台服务器之一(取决于参数)以进行测试。我还编写了一个快速 BAT 文件来启动它,它只使用给定的参数调用“MSBuild.exe”。在 MSBuild 脚本中,它所做的第一件事是从 TFS 中“获取最新”。这是一个代码片段...

<Project DefaultTargets="BuildLatest" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="C:\Program Files (x86)\MSBuild\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>
<UsingTask AssemblyFile="C:\Program Files\MSBuild\ExtensionPack\4.0\MSBuild.ExtensionPack.dll" TaskName="TFSSource"/>

...

<PropertyGroup>
   <TFSourceLoc>$/SourceCode</TFSourceLoc>
</PropertyGroup>

...

<Target Name="BuildLatest" >
   <TFSSource TaskAction="Get" ItemCol="$(TFSourceLoc)" />
</Target>

错误又回来了... ERROR ...\AutoDeploy.xml(163,5): Win32Exception: The system cannot find the file specified

... BAT 文件结束。

真正奇怪的是,我可以最小化 VS 2010 并从资源管理器中运行完全相同的 BAT 文件而没有问题。

那我没看到什么?为什么这不在 VS 2010 中运行?

提前感谢你的帮助!

4

1 回答 1

1

I did a lot more research, which should have happened before I asked the question, but anyways...

Instead of calling a batch file, I decided to try the suggestion of calling MSBuild.exe directly and putting my parms (which will change every couple weeks with a new Sprint) in generic Response files.

I believe it was an issue with the Start/Initial Directory that was resolved by specifying the right directories on the "External Tools" dialog box.

于 2012-08-14T15:52:22.463 回答