text: I'm currently trying to properly set our CI configuration to build multiplatform Xamarin.Forms projects for iOS and Android. For that purpose, I divided the build stages on a pipeline. When trying to isolate the IPA build (to do it on a macOS server I have lying around the office - different than the one used for Android projects) I had an initial problem when running
  xbuild from the CI CLI I described in:
  As suggested by user radical there:
  You could disable the Android project from being built for your Platform=iPhone case via the Configuration manager (see Solution Configurations section).
  I did so for my project from Xamarin Studio and that worked out to build the IPA for distribution flawlessly.
  However, I hit another stone after including some UI & unit tests in the project. Now the beginning of my
  Project.sln looks like this:
  Project("{[...]}") = "Project", "Project\Project\Project.csproj", "{[...]}" EndProject Project("{[...]}") = "Project.Droid", "Project\Project.Droid\Project.Droid.csproj", "{[...]}" EndProject Project("{[...]}") = "Project.iOS", "Project\Project.iOS\Project.iOS.csproj", "{[...]}" EndProject Project("{[...]}") = "Tests", "Tests\Tests.csproj", "{[...]}" EndProject Project("{[...]}") = "UITests", "UITests\UITests.csproj", "{[...]}" EndProject
  Running my old IPA-generation script:
  xbuild /p:Configuration="Ad-Hoc" /p:Platform="iPhone" /p:IpaPackageDir="./Builds" /t:Build Project.sln that used to succeed now returns the following error output:
  /user/project/Project.sln (Build) -> (Build target) -> /user/project/Tests/Tests.csproj (default targets) -> /Library/Frameworks/Mono.framework/Versions/4.8.0/lib/mono/xbuild/14.0/bin/Microsoft.Common.targets (ResolveAssemblyReferences target) -> /Library/Frameworks/Mono.framework/Versions/4.8.0/lib/mono/xbuild/14.0/bin/Microsoft.Common.targets: warning : Reference 'Microsoft.VisualStudio.QualityTools.UnitTestFramework' not resolved Errors: /user/project/Project.sln (Build) -> (Build target) -> /user/project/Tests/Tests.csproj (default targets) -> /Library/Frameworks/Mono.framework/Versions/4.8.0/lib/mono/xbuild/14.0/bin/Microsoft.CSharp.targets (CoreCompile target) -> RestServiceTests.cs(1,17): error CS0234: The type or namespace name `VisualStudio' does not exist in the namespace `Microsoft'. Are you missing an assembly reference?
  I'm a bit lost after looking here and there for a solution; I tried to do the same for the test stages as I did for Android (disabling it on the Configuration Manager) but tests don't appear there. Are the tests not meant to run on macOS?
  Any ideas about what I'm not doing right? Or problems I might have in my project's config?
  Answers
  Are you able to use MSBuild as part of Visual Studio for Mac? I expect this is the more "supported" way of doing it now...
  I fire mine off from Windows, but it would be something like this I guess?
  "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" /p:Configuration="Ad-Hoc" /p:Platform="iPhone" /p:ServerAddress="remotemac01" /p:ServerUser="admin" /p:ServerPassword="password" /p:OutputPath="Builds/" /t:Build Project.sln
  @RyanDixon yup, I have
  msbuildinstalled on that same build machine but the error output is exactly the same regardless which tool I use
  Btw, I'm not using
  /p:ServerAddress="remotemac01" /p:ServerUser="admin" /p:ServerPassword="password"params as the CI system is directly connected to the macOS server via SSH and actually running the build script on it. Should this change something?
  Not at all, its just me being lazy when I am prototyping builds and want to set up a quick build environment!
  That error is strange though, it almost screams that something needs updating. What happens if you build from the .cspron instead of the solution?
  Sorry for the slow response.
  No problem!
  msbuild /p:IpaPackageDir="./Builds" /t:Build /p:Configuration="Ad-Hoc" /p:Platform="iPhone" /p:BuildIpa=true Project.iOS.csproj:
  Then, removing the Configuration and Platform flags:
  msbuild /p:IpaPackageDir="./Builds" /t:Build /p:BuildIpa=true Project/Project.iOS/Project.iOS.csprojdoes not generate any errors but also does not generate any IPA artifact on the said build dir:
  If I manually comment out the lines that corresponding to the tests:
  It does indeed build the IPA in the right dir. As I did point out in the first message:
  In the config manager, the option does not appear, but apparently can be applied manually like this. However I'd still like to run the tests on the macOS host if possible. Still looking for a way to do so!