开发者

How do I build a .NET web application project using Albacore's msbuild task?

开发者 https://www.devze.com 2023-01-29 12:49 出处:网络
I have a solution with a web application project (WAP), which builds and packages in Visual Studio. But, when I run this Albacore msbuild task, it doesn\'t work.

I have a solution with a web application project (WAP), which builds and packages in Visual Studio. But, when I run this Albacore msbuild task, it doesn't work.

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

I get this error

The target "Package" does not exist in the project ....Solution.sln

How do I build a WAP and make a package using Albacore and rake?

Update: wor开发者_StackOverflow中文版king task

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 


When you build a solution file you can only use the following targets.

  • Build
  • Rebuild
  • Clean
  • Publish

If you are trying to invoke the Package target on a Web Application Project (WAP) then, you can use the following syntax to call it for every WAP in that solution.

msbuild YourSolution.sln /p:DeployOnBuild=true;DeployTarget=Package

WAP projects have a special hook to invoke any target during a build. That is enabled by the when the property DeployOnBuild=true and the target that is invoked is defined by the DeployTarget property.

I'm not sure what the Rake syntax is for that, but if you could post it here for others that would be ideal.

0

精彩评论

暂无评论...
验证码 换一张
取 消