The ruthless El Capitan

I have been having some painful issues when dealing with Xamarin Studio and El Capitan. I thought I would summarize some of the workaround I’ve had to do to just get things to build again. Note that I haven’t checked any of these for robustness, but these are just the things I did to get my projects building again.

  1. usr/local had its permissions changed to root:wheel.  If you have sudo privileges this is an easy fix.  You can run sudo chown `whoami` /usr/local
  2. The references to various targets files (e.g. Xamarin.iOS.CSharp.Targets) got all screwed up, so basically uninstall and reinstall Xamarin studio
  3. Xamarin Studio cannot find mono anymore.  As you can imagine, this is a ridiculous mess.  If you use nuget you will notice this.  The solution I have taken is to erase all the NuGet.targets references (they are deprecated anyway) and anywhere I use “mono” I have to replace it with $(MonoPrefix) which I define like this:
<PropertyGroup>
    <MonoPrefix Condition=" '$(OS)' == 'Windows_NT' "></MonoPrefix>
    <!-- Silly workaround for OS X 10.11 -->
    <MonoPrefix Condition=" Exists('/Library/Frameworks/Mono.framework/Commands/mono') ">/Library/Frameworks/Mono.framework/Commands/mono </MonoPrefix>
    <MonoPrefix Condition=" '$(MonoPrefix)' == '' And '$(OS)' != 'Windows_NT' ">mono </MonoPrefix>
</PropertyGroup>

EDIT: The less annoying way to deal with this is by running the following two commands.  They will add a symlink to the new mono / xbuild location that is both a) writeable on El Capitan and b) locatable in the Xamarin Studio search path

ln -s /usr/local/bin/mono /Applications/Xamarin\ Studio.app/Contents/MacOS/mono
ln -s /usr/local/bin/xbuild /Applications/Xamarin\ Studio.app/Contents/MacOS/xbuild

Hope this helps a few of you!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s