(有點相關issue)是否有xbuild/t:包支持? (TravisCI)
TravisCI支持C#構建和Elastic Beanstalk部署。涼。但是我無法獲取Package目標來構建我的zip文件,該文件被部署到EBS IIS中。
我.travis.yml文件看起來像:
language: csharp
solution: RestfulWCFService.sln
mono:
- latest
script:
- xbuild RestfulWCFService.sln /p:Configuration=Release /p:Platform="Any CPU" ## OK
- xbuild RestfulWCFService.csproj /t:Package /p:Configuration=Release ## FAIL!
deploy:
- provider: elasticbeanstalk
....
單版本:
$ mono --version
Mono JIT compiler version 4.0.1 (tarball Thu May 28 09:08:28 UTC 2015)
的(OK)建立信息是:
...
Done executing task "CallTarget"
Done building target "Build" in project "/home/vagrant/syllabus/RestfulWCFService.sln".
Done building target "Build" in project "/home/vagrant/syllabus/RestfulWCFService.sln" ("/home/vagrant/syllabus/RestfulWCFService.sln").
Done building project "/home/vagrant/syllabus/RestfulWCFService.sln".
Build succeeded.
Warnings:
/home/vagrant/syllabus/RestfulWCFService.sln (default targets) ->
(Build target) ->
/home/vagrant/syllabus/RestfulWCFService.csproj (default targets) ->
/usr/lib/mono/4.5/Microsoft.Common.targets (ResolveAssemblyReferences target) ->
/usr/lib/mono/4.5/Microsoft.Common.targets: warning : Reference 'System.Web.Entity' not resolved
1 Warning(s)
0 Error(s)
的(失敗)/ t:包裝消息看起來像:
...
/home/vagrant/syllabus/RestfulWCFService.csproj: Importing project /usr/lib/mono/xbuild/Microsoft/VisualStudio/v10.0/WebApplications/Microsoft.WebApplication.targets from extension path /usr/lib/mono/xbuild
Building target "_ValidateEssentialProperties" in project "/home/vagrant/syllabus/RestfulWCFService.csproj" ("/usr/lib/mono/4.5/Microsoft.Common.targets").
Done building target "_ValidateEssentialProperties" in project "/home/vagrant/syllabus/RestfulWCFService.csproj" ("/usr/lib/mono/4.5/Microsoft.Common.targets").
/home/vagrant/syllabus/RestfulWCFService.csproj: error : Target named 'Package' not found in the project.
Done building project "/home/vagrant/syllabus/RestfulWCFService.csproj".-- FAILED
Build FAILED.
Errors:
/home/vagrant/syllabus/RestfulWCFService.csproj (Package) ->
/home/vagrant/syllabus/RestfulWCFService.csproj: error : Target named 'Package' not found in the project.
0 Warning(s)
1 Error(s)
所以我的問題是,爲什麼Target named 'Package' not found in the project
?我已經驗證了/t:Package
可以在Windows機器上正常使用MSBuild。
注:我發現,如果我添加一個空的目標到.csproj的文件中像
[Target Name="Package"\]
[/Target]
它不再抱怨缺少的目標,但什麼都不做:
...
/home/vagrant/syllabus/RestfulWCFService.csproj: Importing project /usr/lib/mono/xbuild/Microsoft/VisualStudio/v10.0/WebApplications/Microsoft.WebApplication.targets from extension path /usr/lib/mono/xbuild
Building target "_ValidateEssentialProperties" in project "/home/vagrant/syllabus/RestfulWCFService.csproj" ("/usr/lib/mono/4.5/Microsoft.Common.targets").
Done building target "_ValidateEssentialProperties" in project "/home/vagrant/syllabus/RestfulWCFService.csproj" ("/usr/lib/mono/4.5/Microsoft.Common.targets").
Building target "Package" in project "/home/vagrant/syllabus/RestfulWCFService.csproj" ("/home/vagrant/syllabus/RestfulWCFService.csproj").
Done building target "Package" in project "/home/vagrant/syllabus/RestfulWCFService.csproj" ("/home/vagrant/syllabus/RestfulWCFService.csproj").
Done building project "/home/vagrant/syllabus/RestfulWCFService.csproj".
Build succeeded.
0 Warning(s)
0 Error(s)
任何xbuild幫助將不勝感激。