In an attempt to use the TransformWebConfig
and Package
tasks from Microsoft.VisualStudio.Web.Publishing.targets in a Mono-based CI build, I took a dependency on the MSBuild.Microsoft.VisualStudio.Web.target
NuGet package and updated my project file to Import it. The build works fine with MSBuild, but xbuild is unable to process the targets file:
Unable to parse condition "'$(EnableWebPublishProfileFile)'=='true' And '$(WebPublishProfileFile)' != '' And Exists($(WebPublishProfileFile))" : Expected a property at position 90 in condition "'$(EnableWebPublishProfileFile)'=='true' And '$(WebPublishProfileFile)' != '' And Exists($(WebPublishProfileFile))". Missing opening parantheses after the '$'.
Actually, this is the error when I explicitly try to import Microsoft.Web.Publishing.targets
; it is normally imported transitively by importing Microsoft.WebApplication.targets
. I think xbuild is failing (silently) to load the former when I just import the latter, as I simply get the error:
error : Target named 'TransformWebConfig' not found in the project.
Again, this build works fine with MSBuild. The project file has the following Import directive:
<Import Project="$(SolutionDir)\packages\MSBuild.Microsoft.VisualStudio.Web.targets\tools\VSToolsPath\WebApplications\Microsoft.WebApplication.targets" />