title: How can I build a Xamarin iOS app using MSBuild?
body: <p>I have an iOS App project, builds fine in Visual Studio (paired with my Mac build host). I want to build this project using an MSBuild command, so that I can use Teamcity for my builds. (My build agent is a Windows machine which will pair with a Mac build host).</p>
  
  <p>Currently I run the following command:</p>
  
  <pre><code>msbuild MyApp.App.iOS.csproj /t:_RemoteBuild /p:ServerAddress=macmini2.local;Configuration="Debug";Platform="iPhoneSimulator";OutputPath="C:\Projects\MySolution\MyApp.App.iOS\bin\iPhoneSimulator\Debug"
  </code></pre>
  
  <p>And this builds my 2 library projects, but it seems to fail when building my main project:</p>
  
  <pre><code>_GenerateBundleContentDir:
    Preparing application bundle
    Copying file from "C:\Projects\MySolution\MyApp.App.iOS\bin\iPhoneSimulator\Debug\MyApp.Business.Core.dll" to "C:\Projects\MySolution\MyApp.App.iOS\obj\iPhoneSimulator\Debug\build_package\assemblies\MyApp.Business.Core.dll".
    Copying file from "C:\Projects\MySolution\MyApp.App.iOS\bin\iPhoneSimulator\Debug\MyApp.Business.Core.pdb" to "C:\Projects\MySolution\MyApp.App.iOS\obj\iPhoneSimulator\Debug\build_package\assemblies\MyApp.Business.Core.pdb".
    Copying file from "C:\Projects\MySolution\MyApp.App.iOS\bin\iPhoneSimulator\Debug\MyApp.Business.Core.dll.mdb" to "C:\Projects\MySolution\MyApp.App.iOS\obj\iPhoneSimulator\Debug\build_package\assemblies\MyApp.Business.Core.dll.mdb".
    Copying file from "C:\Projects\MySolution\MyApp.App.iOS\bin\iPhoneSimulator\Debug\MyApp.Business.iOS.dll" to "C:\Projects\MySolution\MyApp.App.iOS\obj\iPhoneSimulator\Debug\build_package\assemblies\MyApp.Business.iOS.dll".
    Copying file from "C:\Projects\MySolution\MyApp.App.iOS\bin\iPhoneSimulator\Debug\MyApp.Business.iOS.pdb" to "C:\Projects\MySolution\MyApp.App.iOS\obj\iPhoneSimulator\Debug\build_package\assemblies\MyApp.Business.iOS.pdb".
    Copying file from "C:\Projects\MySolution\MyApp.App.iOS\bin\iPhoneSimulator\Debug\MyApp.Business.iOS.dll.mdb" to "C:\Projects\MySolution\MyApp.App.iOS\obj\iPhoneSimulator\Debug\build_package\assemblies\MyApp.Business.iOS.dll.mdb".
  C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.MonoTouch.Common.targets(195,3): error MSB3030: Could not copy the file "C:\Projects\MySolution\MyApp.App.iOS\bin\iPhoneSimulator\Debug\MyAppAppiOS.exe" because it was not found. [C:\Projects\MySolution\MyApp.App.iOS\MyApp.App.iOS.csproj]
  </code></pre>