Bug 26484 - Only the first SayHelloTask run by a command-line MSBuild process successfully negotiates a connection with the build server
Summary: Only the first SayHelloTask run by a command-line MSBuild process successfull...
Status: VERIFIED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 3.9
Hardware: PC Windows
: High major
Target Milestone: 3.11
Assignee: Jose Gallardo
URL:
: 24063 25268 25409 ()
Depends on:
Blocks:
 
Reported: 2015-01-27 20:58 UTC by Brendan Zagaeski (Xamarin Team, assistant)
Modified: 2015-04-21 10:34 UTC (History)
13 users (show)

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


Attachments
Test case (16.59 KB, application/zip)
2015-01-27 20:58 UTC, Brendan Zagaeski (Xamarin Team, assistant)
Details
Logs from the build host and diagnostic build (41.19 KB, application/zip)
2015-01-27 20:59 UTC, Brendan Zagaeski (Xamarin Team, assistant)
Details


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:
Status:
VERIFIED FIXED

Description Brendan Zagaeski (Xamarin Team, assistant) 2015-01-27 20:58:30 UTC
Created attachment 9526 [details]
Test case

Only the first SayHelloTask run by a command-line MSBuild process successfully negotiates a connection with the build server.

Regression status: Not a regression. Technically there is an old "partial regression" compared to XVS versions lower than 3.5, but the new behavior starting in 3.5 is a pretty good trade-off. The small advantage of XVS < 3.5 for this particular scenario was that users could run the old `_RemoteBuild` target directly, allowing them to skip over the `_SayHello` target and instead re-use the existing build server connection.


This has been reported previously: bug 24063, bug 25409, and bug 25268, but I wanted to file a clean bug with very precise information because the only bug that included a list of steps to reproduce (bug 24063) was marked NEEDINFO.


## Partial workaround

Build each iOS library project and each iOS app project using its own separate `msbuild` invocation.


## Steps to reproduce

1. Ensure the Windows machine has previously successfully paired with the Mac build host.

2. Unzip the attached test case. This is simply 1 Unified API Class Library and 1 Unified API Single View application project put together in 1 solution. Both are set to build in all configurations. Neither project references the other. The class library is listed before the app project in the `.sln` file. In my tests, this ordering in the solution file is a way to change the order in which MSBuild attempts to build the projects.

3. Open a developer command prompt and `cd` into the test case solution directory.

4. Run the following command in the command prompt (note: remove the > greater-than character from the beginning of the line):
> msbuild MultipleIosProjects.sln /t:Build /p:Configuration=Release;Platform=iPhone


## Results

The first project builds completely, including the remote build step on the Mac build host, but the second project only completes the local (Windows) build phase. 

Note that in this particular example the class library does not require a remote build step, but you can also reproduce the problem using a solution that contains 2 iOS app projects.


## First SayHelloTask from the diagnostic build output

> Using "SayHelloTask" task from assembly "C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Tasks.dll".
> Task "SayHelloTask" (TaskId:10)
>   Task Parameter:SessionId=bd9222298b5a8344262640bca284fd35 (TaskId:10)
>   Task Parameter:IntermediateDir=obj\Release\build_package\ (TaskId:10)
>   Task Parameter:MtbsBuildsPath=~/Library/Caches/Xamarin/mtbs/builds (TaskId:10)
>   Task Parameter:ProjectName=UnifiedClassLibrary1 (TaskId:10)
>   Opening control connection (TaskId:10)
>   Control connection to 192.168.1.124 established (TaskId:10)
>   Build server returned a Warning. (TaskId:10)
>   Negotiating server information for pairing process. (TaskId:10)
>   Saying hello to the remote server at http://192.168.1.124:53053/ (TaskId:10)


## Second SayHelloTask from the diagnostic build output

> Using "SayHelloTask" task from assembly "C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Tasks.dll".
> Task "SayHelloTask" (TaskId:51)
>   Task Parameter:SessionId=4a28748300bb1310fc648fc9dfe790ef (TaskId:51)
>   Task Parameter:IntermediateDir=obj\iPhone\Release\build_package\ (TaskId:51)
>   Task Parameter:MtbsBuildsPath=~/Library/Caches/Xamarin/mtbs/builds (TaskId:51)
>   Task Parameter:ProjectName=UnifiedSingleViewUniversal2 (TaskId:51)
>   Fail to resolve address  (TaskId:51)

This correspondingly causes `$(MtouchTargetsEnabled)` to evaluate to `False`, so none of the remote build steps are performed. For example:

> Task "DetectSdkLocationsTask" skipped, due to false condition; ('$(MtouchTargetsEnabled)') was evaluated as ('False').


## Expected results

Hopefully there's a way to adjust the "SayHelloTask" so that both projects will successfully complete the remote build phase.


## Version info

### Windows 8.1 64-bit, in VMWare Fusion 6.0.5 (2209127)
Microsoft Visual Studio Professional 2013
Version 12.0.30723.00 Update 3
Microsoft .NET Framework
Version 4.5.51641

Xamarin   3.9.289.0 (39a70ae)
Xamarin.Android   4.20.0.34 (49a04b966feb40dfdba49d57ba16249b66d606a6)
Xamarin.iOS   8.6.1.0 (3b3ef438017c7ecf486defa9e01567a5f2b3cb2a)


### OS X 10.9.5, MacBook Air

Xamarin.iOS 8.6.1.20 (Business Edition)
Hash: 3b3ef43
Build date: 2015-01-24 09:42:21-0500

Xcode 6.1 (6604), Build 6A1052d
Comment 1 Brendan Zagaeski (Xamarin Team, assistant) 2015-01-27 20:59:15 UTC
Created attachment 9527 [details]
Logs from the build host and diagnostic build
Comment 2 Brendan Zagaeski (Xamarin Team, assistant) 2015-01-27 21:01:38 UTC
Setting target milestone to 3.10 to match the target milestone of bug 25409.
Comment 3 Brendan Zagaeski (Xamarin Team, assistant) 2015-01-27 21:04:47 UTC
*** Bug 25409 has been marked as a duplicate of this bug. ***
Comment 4 Brendan Zagaeski (Xamarin Team, assistant) 2015-01-27 21:08:06 UTC
*** Bug 25268 has been marked as a duplicate of this bug. ***
Comment 5 Brendan Zagaeski (Xamarin Team, assistant) 2015-01-27 21:09:34 UTC
*** Bug 24063 has been marked as a duplicate of this bug. ***
Comment 6 Saurabh 2015-02-17 07:26:09 UTC
I am also getting this behavior, Class library does not get build. This is the command output for the same: https://gist.github.com/saurabh360/b5a32fdd6edaaf3a48ec

Microsoft Visual Studio Professional 2013
Version 12.0.31101.00 Update 4
Microsoft .NET Framework
Version 4.5.51641

Installed Version: Professional

LightSwitch for Visual Studio 2013   06177-004-0446016-02238
Microsoft LightSwitch for Visual Studio 2013

Team Explorer for Visual Studio 2013   06177-004-0446016-02238
Microsoft Team Explorer for Visual Studio 2013

Visual Basic 2013   06177-004-0446016-02238
Microsoft Visual Basic 2013

Visual C# 2013   06177-004-0446016-02238
Microsoft Visual C# 2013

Visual C++ 2013   06177-004-0446016-02238
Microsoft Visual C++ 2013

Visual F# 2013   06177-004-0446016-02238
Microsoft Visual F# 2013

Visual Studio 2013 Code Analysis Spell Checker   06177-004-0446016-02238
Microsoft® Visual Studio® 2013 Code Analysis Spell Checker

Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.

The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.

Windows Phone SDK 8.0 - ENU   06177-004-0446016-02238
Windows Phone SDK 8.0 - ENU

Application Insights Tools for Visual Studio Package   1.0
Application Insights Tools for Visual Studio

ASP.NET and Web Tools   12.4.51016.0
Microsoft Web Developer Tools contains the following components:
Support for creating and opening ASP.NET web projects
Browser Link: A communication channel between Visual Studio and browsers
Editor extensions for HTML, CSS, and JavaScript
Page Inspector: Inspection tool for ASP.NET web projects
Scaffolding: A framework for building and running code generators
Server Explorer extensions for Microsoft Azure Websites
Web publishing: Extensions for publishing ASP.NET web projects to hosting providers, on-premises servers, or Microsoft Azure

ASP.NET Web Frameworks and Tools 2012.2   4.1.21001.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.21010.0
For additional information, visit http://www.asp.net/

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

Microsoft Azure Mobile Services Tools   1.3
Microsoft Azure Mobile Services Tools

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

Office Developer Tools for Visual Studio 2013 ENU   12.0.30626
Microsoft Office Developer Tools for Visual Studio 2013 ENU

PowerShell Tools   1.3
Provides file classification services using PowerShell

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools   12.0.41012.0
Microsoft SQL Server Data Tools

Windows Phone 8.1 SDK Integration   1.0
This package integrates the tools for the Windows Phone 8.1 SDK into the menus and controls of Visual Studio.

Workflow Manager Tools 1.0   1.0
This package contains the necessary Visual Studio integration components for Workflow Manager.

Xamarin   3.9.325.0 (96e7814)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   4.20.0.34 (49a04b966feb40dfdba49d57ba16249b66d606a6)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   8.6.2.0 (09ae75f83eafce1bdc3fa067f281cbdf1ca7b893)
Visual Studio extension to enable development for Xamarin.iOS.

Xamarin.iOS Unified Migration   1.0
Automated migration for Xamarin iOS Classic projects to Unified
Comment 7 Jose Gallardo 2015-03-19 22:12:35 UTC
Fixed on

master
commit: 54545c29a6a146a498a68f49ae9799deee581240
wrench: 55b92af1a06cd3a0769d444872a9255e682803ed

xvs-cycle5
commit: cc048e56ac28dddd1097def0ccea19f9ce73404e
wrench: c70223b0b846b860ab8024bd2d4aa4524480fed7
Comment 8 Mohit Kheterpal 2015-04-21 10:34:09 UTC
I have checked this issue using XVS 3.11.446 + XI 8.10.0.263, and this issue is working fine now i.e. both projects are building successfully.

Build output : https://gist.github.com/Mohit-Kheterpal/b9b22b78a7876b9fcb26

Hence closing this issue.