我需要调用exec并构建一个wix安装项目。msbuild exec任务调用msbuild
目前我已经在我的TFSbuild.proj以下
<PropertyGroup>
<WebRoot>$(DropLocation)\Latest\x86\Release\_PublishedWebsites\Web</WebRoot>
<DBRoot>$(DropLocation)\Latest\x86\Release\Database</DBRoot>
</PropertyGroup>
<PropertyGroup>
<Msbuildexe>"msbuild"</Msbuildexe>
<Configuration>"/p:Configuration:"Release""</Configuration>
<DefineConstants>" /p:DefineConstants:"WebRoot=$(WebRoot);DBRoot=$(DBRoot)""</DefineConstants>
<WixSolution>"$(MSBuildProjectDirectory)\Setup\Setup.sln"</WixSolution>
</PropertyGroup>
<Message Text="Bulding setup solution" />
<Message Text="$(Msbuildexe) $(Configuration) $(DefineConstants) $(WixSolution)" />
<Exec Command="$(Msbuildexe) $(Configuration) $(DefineConstants) $(WixSolution)" />
我试图简单地尽可能多的,所以我就不会感到困惑的地方“的意思是,当我运行这个调试消息(第二最后的命令)输出
“的msbuild” “/ p:配置:” 释放 “” “ /p:DefineConstants:” 的WebRoot = \服务器\滴\应用\安装程序生成\最新\ x86 \ Release_PublishedWebsites \ Web; DBRoot = \ server \ drops \ app \ Installer Build \ Latest \ x86 \ Release \ Database“” “F:\建立\程序\安装程序生成\ BuildType \ SETUP \ Setup.sln”
而且我得到以下错误日志
' “的MSBuild”' 没有被识别为一个 内部或外部命令,
可操作的程序或批处理文件。 F:\建立\应用\安装 生成\ BuildType \ TFSBuild.proj(538,5): 错误MSB3073:该命令 “” 的msbuild “ ”/ P:配置:“ 释放 ”“” /P:DefineConstants :“WebRoot = \ server \ drops \ app \ Installer Build \ Latest \ x86 \ Release_PublishedWebsites \ Web; DBRoot = \ server \ drops \ app \ Installer Build \ Latest \ x86 \ Release \ Database”“ ”f:\ builds \应用程序\安装 构建\ BuildType \ SETUP \ Setup.sln“” 与代码退出9009
我不知道这是由不能够从命令行调用的MSBuild命令造成的或“一个问题,如果这是因为我不能从命令l调用msbuild像这样的我将如何去引用它,有没有一个属性指向它?
我可能会错过一些东西,但为什么你需要'Exec' MSBuild而不是仅仅添加一个[MSBuild Task](http://msdn.microsoft.com/zh-cn/library/z7f65y0d.aspx)? – Filburt