Bug 58781 - "The Xamarin Build Agent is not running on the Mac" error appears after update to Visual Studio 2017 version 15.3 due to unexpected installation of Xamarin.iOS 10.99 Xcode 9 preview version (under certain conditions)
Summary: "The Xamarin Build Agent is not running on the Mac" error appears after updat...
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: XMA ()
Version: 4.6.0 (15.3)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2017-08-15 17:11 UTC by Yuri
Modified: 2017-08-23 16:11 UTC (History)
13 users (show)

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

log file xamarin (87.72 KB, application/octet-stream)
2017-08-23 13:29 UTC, brux88

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 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:

Description Yuri 2017-08-15 17:11:58 UTC
I am connected to MAC, the icon is green. If I press "Show iOS Simulator" it pops up on MAC but when I try to build I get an error:
The Xamarin Build Agent is not running on the Mac. An active Build Agent is required to perform the build

Microsoft Visual Studio Enterprise 2017 
Version 15.3.0
Microsoft .NET Framework
Version 4.7.02046

Installed Version: Enterprise

Architecture Diagrams and Analysis Tools   00369-60000-00001-AA777
Microsoft Architecture Diagrams and Analysis Tools

Visual Basic 2017   00369-60000-00001-AA777
Microsoft Visual Basic 2017

Visual C# 2017   00369-60000-00001-AA777
Microsoft Visual C# 2017

Visual C++ 2017   00369-60000-00001-AA777
Microsoft Visual C++ 2017

Visual F# 4.1   00369-60000-00001-AA777
Microsoft Visual F# 4.1

Application Insights Tools for Visual Studio Package   8.8.00712.1
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2017   15.0.30726.0
ASP.NET and Web Tools 2017

ASP.NET Core Razor Language Services   1.0
Provides languages services for ASP.NET Core Razor.

ASP.NET Template Engine 2017   15.0.30726.0
ASP.NET Template Engine 2017

ASP.NET Web Frameworks and Tools 2017   5.2.50601.0
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0   15.0.30728.0
Azure App Service Tools v3.0.0

Azure Data Lake Node   1.0
This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio   2.2.9000.1
Microsoft Azure Data Lake Tools for Visual Studio

Azure Data Lake Tools for Visual Studio   2.2.9000.1
Microsoft Azure Data Lake Tools for Visual Studio

Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Cookiecutter   3.0.17208.1
Provides tools for finding, instantiating and customizing templates in cookiecutter format.

Fabric.DiagnosticEvents   1.0
Fabric Diagnostic Events

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript Project System   2.0
JavaScript Project System

JavaScript UWP Project System   2.0
JavaScript UWP Project System

Merq   1.1.17-rc (cba4571)
Command Bus, Event Stream and Async Manager for Visual Studio extensions.

Microsoft Azure HDInsight Azure Node   2.2.9000.1
HDInsight Node under Azure Node

Microsoft Azure Hive Query Language Service   2.2.9000.1
Language service for Hive query

Microsoft Azure Service Fabric Tools for Visual Studio   1.7
Microsoft Azure Service Fabric Tools for Visual Studio

Microsoft Azure Stream Analytics Language Service   2.2.9000.1
Language service for Azure Stream Analytics

Microsoft Azure Stream Analytics Node   1.0
Azure Stream Analytics Node under Azure Node

Microsoft Azure Tools   2.9
Microsoft Azure Tools for Microsoft Visual Studio 2017 - v2.9.50719.1

Microsoft Continuous Delivery Tools for Visual Studio   0.3
Simplifying the configuration of continuous build integration and continuous build delivery from within the Visual Studio IDE.

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++ Wizards   1.0
Microsoft Visual C++ Wizards

Microsoft Visual Studio VC Package   1.0
Microsoft Visual Studio VC Package

Mono Debugging for Visual Studio   4.6.8-pre (ec7034f)
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager   4.3.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

Python   3.0.17208.1
Provides IntelliSense, projects, templates, debugging, interactive windows, and other support for Python developers.

Python - Django support   3.0.17208.1
Provides templates and integration for the Django web framework.

Python - IronPython support   3.0.17208.1
Provides templates and integration for IronPython-based projects.

Python - Profiling support   3.0.17208.1
Profiling support for Python projects.

Redgate ReadyRoll
Extend DevOps processes to your SQL Server databases and safely automate database deployments.
Visit https://www.red-gate.com/readyroll for more information.

Copyright (C) 2011 Red Gate Software Ltd. All rights reserved.
This software contains components from Component Owl.
SQL Server is a registered trademark of Microsoft Corporation. 
Visual Studio is a registered trademark of Microsoft Corporation. 

ReadyRoll contains code from the following open source software:

NuGet https://www.nuget.org/
SQL LocalDB Wrapper https://github.com/martincostello/sqllocaldb
Autofac https://autofac.org/
Json.NET https://json.net/
MahApps.Metro http://mahapps.com/
SemVer https://github.com/maxhauser/semver
Log4Net http://logging.apache.org/log4net/
Extended WPF Toolkit https://wpftoolkit.codeplex.com/
Code InfoBox VSX http://www.codeproject.com/Articles/55196/Code-InfoBox-Visual-Studio-Extension-VSX
OctoPack https://github.com/OctopusDeploy/OctoPack
SQLite https://sqlite.org/

This product contains icons from http://www.visualpharm.com distributed under a free backlink license.

For license details or other notices relating to the above software, please see NOTICE.TXT and EULA.rtf in the ReadyRoll application folder.

Redgate SQL Prompt
Write, format, and refactor SQL effortlessly

SQL Server Data Tools   15.1.61707.200
Microsoft SQL Server Data Tools

ToolWindowHostedEditor   1.0
Hosting json editor into a tool window

TypeScript tools for Visual Studio

Visual Studio Code Debug Adapter Host Package   1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Tools for Unity
Visual Studio Tools for Unity

Visual Studio Tools for Universal Windows Apps   15.0.26730.00
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

WebJobs Tools v1.0.0   __RESXID_PRODUCTVERSION__
WebJobs Tools v1.0.0

Xamarin (306f76a)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android SDK (0cd0214)
Xamarin.Android Reference Assemblies and MSBuild support.

Xamarin.iOS and Xamarin.Mac SDK (44d03da)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
Comment 1 Brendan Zagaeski (Xamarin Team, assistant) 2017-08-15 18:44:01 UTC
## Bookkeeping note

I will prepare a non-engineering team preliminary quick review for this report.
Comment 2 Brendan Zagaeski (Xamarin Team, assistant) 2017-08-15 19:27:48 UTC
> Xamarin (306f76a)
> Xamarin.Android SDK (0cd0214)
> Xamarin.iOS and Xamarin.Mac SDK (44d03da)
It looks like the Visual Studio installation somehow ended up with out-of-sync versions of the "Xamarin.iOS and Xamarin.Mac SDK" extension and the "Xamarin" (IDE features) extension, probably related in some way to trying an Alpha Xcode 9 support preview version of the "Xamarin.Apple SDK" extension [1] at some point in the past.

What is interesting is that the Visual Studio 2017 version listed in Comment 0 is the new _non-preview_ release from yesterday [2], but in theory the only easy way to get an _Alpha_ Xamarin extension installed is if you are using Visual Studio 2017 _Preview_.  The Xamarin versions in yesterday's _non-preview_ release (copied from my own updated system) should instead be:

> Xamarin (306f76a)
> Xamarin.Android SDK (0cd0214)
> Xamarin.iOS and Xamarin.Mac SDK (bf350ba)
So it's a bit of a puzzle how the Alpha version of the "Xamarin.Apple SDK" got installed within the non-preview version of Visual Studio 2017 in Comment 0.

## Possible fix

In theory, removing and reinstalling the "Mobile development with .NET" workload in the Visual Studio Installer should be sufficient to resolve this issue [3].

## Follow-up question

If by chance you have any suspicions for how the preview version of the "Xamarin.Apple SDK" might have gotten carried over into your non-preview installation of Visual Studio 2017, that would be interesting to know.  For example, if you know you installed the Xcode 9 support preview in Visual Studio 2017 _Preview_ at some point in the past, then if you might also recall the approximate order of installation steps that lead to the current mismatched scenario, it would be interesting to record that information on this bug report for the Xamarin engineers to examine.  But no worries if you aren't sure of the steps.

## Bug status update

I will set the bug to NEEDINFO while awaiting results from the reporter of the bug about the "Possible fix" above.

[1] https://releases.xamarin.com/preview-xcode-9-beta-3-ios-11-macos-10-13-support-preview-1/
[2] https://www.visualstudio.com/news/releasenotes/vs2017-relnotes
[3] https://developer.xamarin.com/guides/cross-platform/getting_started/installation/uninstalling_xamarin/#Uninstalling_Visual_Studio_2017

## Additional background info

Non-public Bug 58699 from a different user showed approximately the same symptoms.  That bug includes some additional background info about why the error happens:

> What looks like to be happening in this case is that the assembly
> versions of the Xamarin [remote connection] framework that the MSBuild
> process uses are out of date and differs from the ones handled by the
> Visual Studio Extension and also the content deployed to the Mac.
> As a security check we require that the Build Agent and the Build
> client has the same assembly versions
> What [has likely happened] is that ... some assemblies in the MSBuild
> folder (Program Files (x86)\Microsoft Visual
> Studio\2017\<Version>\MSBuild\Xamarin\iOS) were not updated so the old
> assemblies are getting loaded, causing the aforementioned version
> mismatch.
Comment 3 Yuri 2017-08-15 21:39:43 UTC
I have 2 versions of VS2017 installed stable and preview. When today I ran VS Installer it said that VS preview has updates, I selected to install them. Apparently it installed it also on release version?
Comment 4 mag@xamarin.com 2017-08-16 04:00:58 UTC
Just as a reference, a very similar case occurred on this bug: https://bugzilla.xamarin.com/show_bug.cgi?id=58699

It was an update from a preview version, which ended up causing an incompatibility between Xamarin VS and Apple SDK, given that the user only updated Xamarin VS.

Adding this comment in case the mentioned thread helps somehow on understanding the issue and the possible manual fixes.

Comment 5 Yuri 2017-08-16 13:46:17 UTC
The case you gave link for is private, I cannot see it. I updated both sides - VS and MAC.
Comment 6 Yuri 2017-08-16 16:11:08 UTC
Reinstalled Xamarin completely from scratch. That fixed the problem
Comment 7 mag@xamarin.com 2017-08-16 18:54:45 UTC
Good to know that, glad that you fixed the issue.
As a clarification and tip for the next time you use the updater, please if you work with iOS projects, be sure that you always update Xamarin VS and Apple SDK together, given that if there is a mismatch or a version incompatibility between the Apple SDK version and the Xamarin VS version, then the iOS build will not work well because as a security check we enforce as part of the initial build tasks that the Build Agent and Build Client should have the same version, and that will never happen if the Apple SDK differs from the Xamarin VS version.

That said, I consider the issue as Resolved.

Please let us know if you have any other related issue.
Comment 8 Yuri 2017-08-16 19:10:33 UTC
I always update Xamarin VS and Apple SDK together. The issue was caused by Visual Studio 2017 installer which installed Preview version into stable version. Before I ran Preview update everything was fine. You might still look into this issue with installer
Comment 9 Brendan Zagaeski (Xamarin Team, assistant) 2017-08-18 18:41:16 UTC
## Note to the Xamarin team

To brainstorm some steps that might be interesting to try to attempt to replicate the issue:

1. Start with a system that has:

- Visual Studio 2017 version 15.2, with the "Mobile development with .NET" workload installed
- Visual Studio 2017 version 15.3 Preview 7, with the "Mobile development with .NET" workload installed

2. Install Xamarin's first Xcode 9 preview [1] into the Visual Studio 2017 Preview instance using the steps described on the blog post.

[1] https://releases.xamarin.com/preview-xcode-9-beta-3-ios-11-macos-10-13-support-preview-1/

3. Run the "Visual Studio Installer" for Visual Studio 2017, and take the update from Visual Studio 2017 version 15.2 to Visual Studio 2017 version 15.3 (non-preview).

4. Check which version of the Xamarin.iOS extension is now installed in Visual Studio 2017 version 15.3 (non-preview).
Comment 10 Damir Beylkhanov 2017-08-18 22:27:03 UTC
my approach to resolve this problem is downgrading the Xamarin.Apple SDK up to

Also I have applied a fresh release update 15.3.1 on VS
Comment 11 Luigi Maestrelli 2017-08-22 13:14:04 UTC
It worked again when I reverted the Xamarin.Apple SDK from to
Comment 12 Hines Vaughan III 2017-08-22 21:29:07 UTC
I was getting the same issue after initially installing VS 2017 15.3.1 although I have never installed any VS Preview versions.

As  Brendan mentioned, I unchecked 'Mobile development with .NET', did the uninstall, then checked it again, and did the install.

So now everything is working again, but, just like when I initially installed 15.3.1, if I open the Extensions and Updates window in VS and look at the Xamarin channel under the Updates drop-down, there is a new update listed for:

- Xamarin.Apple SDK

So maybe this issue is being caused by the Xamarin Updates Extension?
Comment 13 Brendan Zagaeski (Xamarin Team, assistant) 2017-08-22 21:32:25 UTC
## Tallying additional reports for bookkeeping

4 (likely) users: https://forums.xamarin.com/discussion/100185/the-xamarin-build-agent-is-not-running-on-the-mac/p1 (2017-08-21 to 2017-08-22)
Comment 14 Brendan Zagaeski (Xamarin Team, assistant) 2017-08-22 22:19:33 UTC
Thanks for the additional observations Hines!  I notified the team about the unexpected extension update information being provided by the Xamarin Updater extension, and an adjustment is now in place that should in theory stop this issue from affecting other users who are updating.

If any other user who updates to Visual Studio 2017 version 15.3 after this comment still gets "Xamarin.iOS and Xamarin.Mac SDK (44d03da)" in their version information rather than some 10.12.x.x version, please leave a quick comment either here or on a new bug report to indicate (a) whether you have the Xamarin Updater extension installed and (b) whether "Tools > Extensions and Updates" still offers an update for the "Xamarin.Apple SDK" extension after you have manually removed and reinstalled the "Mobile development with .NET" workload.

I will tentatively mark this issue as "fixed" while waiting on any new user reports that might come up after this comment.

Thanks in advance!
Comment 15 brux88 2017-08-23 13:28:08 UTC Comment hidden (obsolete)
Comment 16 brux88 2017-08-23 13:29:40 UTC
Created attachment 24369 [details]
log file xamarin
Comment 17 Brendan Zagaeski (Xamarin Team, assistant) 2017-08-23 16:11:59 UTC
Hi Brux,

Thanks for the reply.  That looks like a different error (this bug is specifically about the error "The Xamarin Build Agent is not running on the Mac").  When you get a chance, I'd recommend to re-file that information in its own new bug report so that the Xamarin team can take a look at it in its own dedicated thread for investigation.  (Having the user who is seeing the bug as the reporter of the bug is best so that you can update the status of the bug as needed.)  Thanks in advance!