Bug 10969 - xbuild fails with Xamarin.Mac projects
Summary: xbuild fails with Xamarin.Mac projects
Status: RESOLVED ANSWERED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Mac Add-in ()
Version: 4.0.8
Hardware: Macintosh Mac OS
: --- enhancement
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-03-07 12:58 UTC by David Aramant
Modified: 2015-04-10 13:00 UTC (History)
5 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description David Aramant 2013-03-07 12:58:24 UTC
I cannot successfully compile a solution that uses Xamarin.Mac with xbuild.

1) Create a new Xamarin.Mac Project
2) Attempt to build the solution at the console with xbuild
3) Build fails

I've tried both Mono 3 and 2.  Ideally we would like to use 3.  I have seen two types of failures; I'm not sure how to make one or the other show up.

Currently it is failing with a bunch of CS0246 compiler errors indicating that it can't find the MonoMac namespace.

The other error condition I've seen (which I am currently unable to reproduce) is that it cannot find /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/v0.0/Xamarin.Mac.targets.  I've looked for this file under the Mono.framework and Xamarin.Mac.framework folders and I couldn't find it.  It is referenced in the project file as:
$(MSBuildExtensionsPath)\Xamarin\Mac\v0.0\Xamarin.Mac.targets

There are two reasons why we want to build our solution in xbuild:

1) We depend on some conditional logic in the csproj files for different references depending on the platform (Win/Mac).  Xamarin Studio / MonoDevelop does not seem to support this like VS does.
2) For the CI server.
Comment 1 Curtis Wensley 2013-05-01 11:36:48 UTC
I would love to see xbuild support for Xamarin.Mac as well - it would make compiling cross platform apps a lot easier, and bring better support for adding custom targets and leveraging utilities like nuget.
Comment 2 Aaron Bockover [MSFT] 2013-05-21 17:02:24 UTC
xbuild support is on the radar, but I do not have a time estimate. Currently the tooling uses Xamarin Studio's internal build support.

You can build Xamarin.Mac projects on the command line using mdtool however, so you at least don't need to open the IDE:

/Applications/Xamarin\ Studio.app/Contents/MacOS/mdtool build --help
/Applications/Xamarin\ Studio.app/Contents/MacOS/mdtool build Project.sln
/Applications/Xamarin\ Studio.app/Contents/MacOS/mdtool build -t:Clean Project.sln
Comment 3 Chris Hamons 2015-04-10 13:00:13 UTC
Sorry for the long delay in responding to this bug.

Xamarin.Mac Unified projects are now msbuild under the hood. We don't expect classic XM projects to move to msbuild in the medium term.