Trying to get my Service Fabric application building on a build server. When I build the .sln file, the sfproj's Package target is not run. As expected. I cannot seem to get MSBuild to run this target.
First, the only targets available when building against the .sln file are the standard Build and Publish targets.
Second, building against the .sfproj itself DOES get the target running. However, because of the mismatch of $(BuildPlatform), the projects referenced by the .sfproj do not build correctly. The .sfproj has a x64 platform. Most of my other projects are Any CPU.
This is less of a Service Fabric question and more of a general MSBuild question, I suppose. I'm looking for a solution that does not require me to unify all my project's Platform options. Service Fabric REALLY IS x64 only, and my other projects REALLY ARE Any CPU.
[EDIT]
I solved this. What I did was add a new Target to the .sfproj file, called MaybePublish
, and I set it as one of the default targets. MaybePublish
has a Condition
for '$(Package)' == 'true'
. It has DependsOnTarget
set to Package
. Basically, this target optionally packages the Service Fabric application, if a property is set when building the solution.
It occurs to me this is probably how the DeployOnBuild
stuff works in the Web publishing projects. The Service Fabric target files should have this type of support by default.