Xamarin and El Capitan

So recently I upgraded my development Mac from Yosemite to El Capitan and all of Xamarin projects stopped compiling a produced a NuGet related message with code 127. After some research I found out that this was directly related to the upgrade as a result Apple strips away third party binaries in /usr which is where Xamarin stores its mono link, this results in Xamarin Studio being unable to build.

Reading through various blogs on this the solution was to create a link back to the mono binary located in /Library/Frameworks/Mono.framework/Commands/mono in /usr/bin. If you do this on El Capitan you will likely receive an “Operation Not Permitted” message even if you use an sudo.

The reason for this is Apple, in El Capitan, has revoked the root user and runs El Capitan in “rootless” mode which disallow any user, event with sudo rights to modify certain directories, including /usr

Most of what I read indicating the need to log into the Mac in recovery mode and use the System Configuration utility to disable the “rootless”. However, try as I might, I could not find this utility in the recovery screen. In the end, this forum must pertaining to Xamarin.Mac (https://forums.xamarin.com/discussion/45683/xamarin-mac-10-11-fix-preview) held the fix for me.

Once you boot into the recovery code access the terminal (under Utilities) and issue the following command: csrutil disable – this will disable the “rootless” mode. Boot back into normal Mac and you should be able to perform the linking action from earlier which resulted in the Operation Not Permitted message.

Once you recreate the missing mono command restart Xamarin Studio and things should be working. Not sure when a fix from Xamarin is coming since I get why Apple went to “rootless” mode and I don’t like circumventing it. From what I have found this was known since early September and still not fixed after a month.

Advertisements

One thought on “Xamarin and El Capitan

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