我需要調用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