(somewhat related issue)
TravisCI supports C# builds and Elastic Beanstalk deployments. Cool. But I can't get the Package target to build my zip file that gets deployed into EBS IIS.
My .travis.yml file looks like:
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 --version
Mono JIT compiler version 4.0.1 (tarball Thu May 28 09:08:28 UTC 2015)
The (OK) build message is:
...
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)
The (FAIL) /t:Package message looks like:
...
/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)
So my question is, why Target named 'Package' not found in the project
? I've verified /t:Package
works fine with MSBuild on a Windows machine.
Note: I've found that if I add an empty target into the .csproj file like
[Target Name="Package"\]
[/Target]
It no longer complains about a missing target, but does nothing:
...
/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)
Any xbuild help would be greatly appreciated.