如何使用Albacore&x27;s的msbuild任务?

如何使用Albacore&x27;s的msbuild任务?,msbuild,rake,albacore,Msbuild,Rake,Albacore,我有一个带有web应用程序项目(WAP)的解决方案,它在VisualStudio中构建和打包。但是,当我运行这个Albacoremsbuild任务时,它不起作用 msbuild :build do |msb| msb.solution = '../../src/Solution.sln' msb.targets :clean, :build, :Package msb.properties = { :configuration => :Dev } end 我

我有一个带有web应用程序项目(WAP)的解决方案,它在VisualStudio中构建和打包。但是,当我运行这个Albacore
msbuild
任务时,它不起作用

msbuild :build do |msb| 
  msb.solution = '../../src/Solution.sln'
  msb.targets :clean, :build, :Package
  msb.properties = { 
    :configuration => :Dev
  } 
end
我得到这个错误

项目中不存在目标“包…”Solution.sln

如何使用Albacore和rake构建WAP并制作包

更新:工作任务

msbuild :build do |msb| 
  msb.solution = '../../src/Solution.sln'
  msb.targets :clean, :build
  msb.parameters = '/p:DeployOnBuild=true;DeployTarget=Package'
  msb.properties = { 
    :configuration => :Dev
  } 
end 

构建解决方案文件时,只能使用以下目标

  • 建造
  • 重建
  • 干净的
  • 发表
如果您试图在Web应用程序项目(WAP)上调用包目标,则可以使用以下语法为该解决方案中的每个WAP调用它

msbuild YourSolution.sln /p:DeployOnBuild=true;DeployTarget=Package
WAP项目有一个特殊的钩子,可以在构建过程中调用任何目标。当属性
DeployOnBuild=true
且调用的目标由DeployTarget属性定义时,将启用该属性

我不确定Rake语法是什么,但是如果你能在这里为其他人发布它,那将是理想的